aboutsummaryrefslogtreecommitdiffstats
path: root/lib/utils.coffee
diff options
context:
space:
mode:
authorStephen Blott2015-05-02 17:32:28 +0100
committerStephen Blott2015-05-03 08:41:55 +0100
commitba4e8018e3d8cd80e0fa9ac541e37e7eee37028f (patch)
treedda565cc9f2d55009329d81405490d467764680b /lib/utils.coffee
parent8329f3cbe95e6a39e500aa15e54c6c44fad9cb7e (diff)
downloadvimium-ba4e8018e3d8cd80e0fa9ac541e37e7eee37028f.tar.bz2
Search completion; tweaks and refactoring.
Diffstat (limited to 'lib/utils.coffee')
-rw-r--r--lib/utils.coffee7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/utils.coffee b/lib/utils.coffee
index 88fe9e2c..5d9696e1 100644
--- a/lib/utils.coffee
+++ b/lib/utils.coffee
@@ -177,6 +177,13 @@ Utils =
delete obj[property] for property in properties
obj
+ # Does string match any of these regexps?
+ matchesAnyRegexp: (regexps, string) ->
+ for re in regexps
+ return true if re.test string
+ false
+
+
# This creates a new function out of an existing function, where the new function takes fewer arguments. This
# allows us to pass around functions instead of functions + a partial list of arguments.
Function::curry = ->