Sha256: 71b852b4b43005e105114818a488783bc9b8ba7f71bb06979ab246936d41ee4c

Contents?: true

Size: 527 Bytes

Versions: 69

Compression:

Stored size: 527 Bytes

Contents

define(['./filter'], function(filter){

    /**
     * @return {array} Array of unique items
     */
    function unique(arr, compare){
        compare = compare || isEqual;
        return filter(arr, function(item, i, arr){
            var n = arr.length;
            while (++i < n) {
                if ( compare(item, arr[i]) ) {
                    return false;
                }
            }
            return true;
        });
    }

    function isEqual(a, b){
        return a === b;
    }

    return unique;
});

Version data entries

69 entries across 69 versions & 2 rubygems

Version Path
trusty-festivity-extension-2.3.1 node_modules/bower/node_modules/mout/src/array/unique.js
trusty-festivity-extension-2.3.0 node_modules/bower/node_modules/mout/src/array/unique.js
entangled-0.0.16 spec/dummy/public/node_modules/bower/node_modules/mout/src/array/unique.js
entangled-0.0.15 spec/dummy/public/node_modules/bower/node_modules/mout/src/array/unique.js
entangled-0.0.14 spec/dummy/public/node_modules/bower/node_modules/mout/src/array/unique.js
entangled-0.0.13 spec/dummy/public/node_modules/bower/node_modules/mout/src/array/unique.js
entangled-0.0.12 spec/dummy/public/node_modules/bower/node_modules/mout/src/array/unique.js
entangled-0.0.11 spec/dummy/public/node_modules/bower/node_modules/mout/src/array/unique.js
entangled-0.0.10 spec/dummy/public/node_modules/bower/node_modules/mout/src/array/unique.js