atma-utils
Advanced tools
Comparing version 0.1.26 to 0.1.27
@@ -310,3 +310,4 @@ var _Array_slice, | ||
arr_contains, | ||
arr_pushMany; | ||
arr_pushMany, | ||
arr_distinct; | ||
(function(){ | ||
@@ -342,2 +343,25 @@ arr_remove = function (array, x) { | ||
; | ||
arr_distinct = function (arr, compareFn) { | ||
var out = []; | ||
var hash = compareFn == null ? obj_create(null) : null; | ||
outer: for (var i = 0; i < arr.length; i++) { | ||
var x = arr[i]; | ||
if (compareFn == null) { | ||
if (hash[x] === 1) { | ||
continue; | ||
} | ||
hash[x] = 1; | ||
} | ||
else { | ||
for (var j = i - 1; j > -1; j--) { | ||
var prev = arr[j]; | ||
if (compareFn(x, prev)) { | ||
continue outer; | ||
} | ||
} | ||
} | ||
out.push(x); | ||
} | ||
return out; | ||
} | ||
@@ -344,0 +368,0 @@ }()); |
@@ -305,2 +305,25 @@ (function(factory){ | ||
; | ||
function arr_distinct(arr, compareFn) { | ||
var out = []; | ||
var hash = compareFn == null ? obj_create(null) : null; | ||
outer: for (var i = 0; i < arr.length; i++) { | ||
var x = arr[i]; | ||
if (compareFn == null) { | ||
if (hash[x] === 1) { | ||
continue; | ||
} | ||
hash[x] = 1; | ||
} | ||
else { | ||
for (var j = i - 1; j > -1; j--) { | ||
var prev = arr[j]; | ||
if (compareFn(x, prev)) { | ||
continue outer; | ||
} | ||
} | ||
} | ||
out.push(x); | ||
} | ||
return out; | ||
} | ||
@@ -307,0 +330,0 @@ }()); |
{ | ||
"name": "atma-utils", | ||
"description": "Helpers", | ||
"version": "0.1.26", | ||
"version": "0.1.27", | ||
"author": "Alexander Kit <alex.kit@atmajs.com>", | ||
@@ -20,3 +20,3 @@ "repository": { | ||
"app-bundler": "0.0.68", | ||
"atma": ">0.9.26", | ||
"atma": "^0.12.2", | ||
"atma-loader-babel": ">0.0.0", | ||
@@ -74,2 +74,8 @@ "atma-loader-ts": "^1.1.11" | ||
"settings": { | ||
"include": { | ||
"amd": true, | ||
"extentionDefault": { | ||
"js": "ts" | ||
} | ||
}, | ||
"atma-loader-ts": { | ||
@@ -84,3 +90,8 @@ "extensions": [ | ||
"sourceMap": false, | ||
"module": "esnext" | ||
"#if (TEST)": { | ||
"module": "amd" | ||
}, | ||
"#if (!TEST)": { | ||
"module": "esnext" | ||
} | ||
} | ||
@@ -87,0 +98,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
156137
5042