diff options
| author | Stephen Blott | 2014-12-30 12:19:29 +0000 |
|---|---|---|
| committer | Stephen Blott | 2014-12-30 12:19:29 +0000 |
| commit | 3620fec662ab89bd4f7827e66deec49ff4d11b8e (patch) | |
| tree | 4722bc92a9931e91e8a4109e5ce16a971c3d2dac /lib | |
| parent | ba743054dcd26b225db407db261e480ab485e2d0 (diff) | |
| parent | 0b610a6d707bd4cd1eb421605d15d276721ef493 (diff) | |
| download | vimium-3620fec662ab89bd4f7827e66deec49ff4d11b8e.tar.bz2 | |
Merge branch 'smblott-github-passkeys---union-of-rules'
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/utils.coffee | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/utils.coffee b/lib/utils.coffee index 1bedb3d1..8f6dca2a 100644 --- a/lib/utils.coffee +++ b/lib/utils.coffee @@ -116,6 +116,12 @@ Utils = # detects both literals and dynamically created strings isString: (obj) -> typeof obj == 'string' or obj instanceof String + # Transform "zjkjkabz" into "abjkz". + distinctCharacters: (str) -> + unique = "" + for char in str.split("").sort() + unique += char unless 0 <= unique.indexOf char + unique # Compares two version strings (e.g. "1.1" and "1.5") and returns # -1 if versionA is < versionB, 0 if they're equal, and 1 if versionA is > versionB. |
