diff options
| author | Stephen Blott | 2014-12-30 12:18:12 +0000 | 
|---|---|---|
| committer | Stephen Blott | 2014-12-30 12:18:12 +0000 | 
| commit | 0b610a6d707bd4cd1eb421605d15d276721ef493 (patch) | |
| tree | 4722bc92a9931e91e8a4109e5ce16a971c3d2dac /lib/utils.coffee | |
| parent | ba743054dcd26b225db407db261e480ab485e2d0 (diff) | |
| parent | bab498fcf2a54cacd2d1751106bf6c499644e0dc (diff) | |
| download | vimium-0b610a6d707bd4cd1eb421605d15d276721ef493.tar.bz2 | |
Merge branch 'passkeys---union-of-rules' of https://github.com/smblott-github/vimium into smblott-github-passkeys---union-of-rules
Diffstat (limited to 'lib/utils.coffee')
| -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. | 
