From ba4e8018e3d8cd80e0fa9ac541e37e7eee37028f Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Sat, 2 May 2015 17:32:28 +0100 Subject: Search completion; tweaks and refactoring. --- lib/utils.coffee | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib') 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 = -> -- cgit v1.2.3