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.6.3 node_modules/bower/node_modules/mout/src/array/unique.js
trusty-festivity-extension-2.6.2 node_modules/bower/node_modules/mout/src/array/unique.js
trusty-festivity-extension-2.6.1 node_modules/bower/node_modules/mout/src/array/unique.js
trusty-festivity-extension-2.6 node_modules/bower/node_modules/mout/src/array/unique.js
trusty-festivity-extension-2.5.19 node_modules/bower/node_modules/mout/src/array/unique.js
trusty-festivity-extension-2.5.18 node_modules/bower/node_modules/mout/src/array/unique.js
trusty-festivity-extension-2.5.17 node_modules/bower/node_modules/mout/src/array/unique.js
trusty-festivity-extension-2.5.16 node_modules/bower/node_modules/mout/src/array/unique.js
trusty-festivity-extension-2.5.15 node_modules/bower/node_modules/mout/src/array/unique.js
trusty-festivity-extension-2.5.14 node_modules/bower/node_modules/mout/src/array/unique.js
trusty-festivity-extension-2.5.13 node_modules/bower/node_modules/mout/src/array/unique.js
trusty-festivity-extension-2.5.12 node_modules/bower/node_modules/mout/src/array/unique.js
trusty-festivity-extension-2.5.11 node_modules/bower/node_modules/mout/src/array/unique.js
trusty-festivity-extension-2.5.10 node_modules/bower/node_modules/mout/src/array/unique.js
trusty-festivity-extension-2.5.9 node_modules/bower/node_modules/mout/src/array/unique.js
trusty-festivity-extension-2.5.8 node_modules/bower/node_modules/mout/src/array/unique.js
trusty-festivity-extension-2.5.7 node_modules/bower/node_modules/mout/src/array/unique.js
trusty-festivity-extension-2.5.6 node_modules/bower/node_modules/mout/src/array/unique.js
trusty-festivity-extension-2.5.5 node_modules/bower/node_modules/mout/src/array/unique.js
trusty-festivity-extension-2.5.4 node_modules/bower/node_modules/mout/src/array/unique.js