@appolo/utils
Advanced tools
Comparing version 8.0.29 to 8.0.30
@@ -61,2 +61,8 @@ "use strict"; | ||
} | ||
sum() { | ||
return arrays_1.Arrays.sum(this._value); | ||
} | ||
sumBy(criteria) { | ||
return arrays_1.Arrays.sumBy(this._value, criteria); | ||
} | ||
difference(arr2) { | ||
@@ -123,5 +129,8 @@ this._value = arrays_1.Arrays.difference(this._value, arr2); | ||
} | ||
random(arr) { | ||
random() { | ||
return arrays_1.Arrays.random(this._value); | ||
} | ||
randomItems(count = 1) { | ||
return arrays_1.Arrays.randomItems(this._value, count); | ||
} | ||
value() { | ||
@@ -128,0 +137,0 @@ return this._value; |
@@ -75,2 +75,10 @@ import {Arrays} from "./arrays"; | ||
public sum(): number { | ||
return Arrays.sum(this._value); | ||
} | ||
public sumBy<S = K>(criteria: (value: S, i?: number) => any): number { | ||
return Arrays.sumBy(this._value, criteria); | ||
} | ||
public difference<S = K>(arr2: S[]): this { | ||
@@ -161,6 +169,10 @@ this._value = Arrays.difference(this._value, arr2); | ||
public random<S = K>(arr: S[]): S { | ||
public random<S = K>(): S { | ||
return Arrays.random(this._value); | ||
} | ||
public randomItems<S = K>(count: number = 1): S[] { | ||
return Arrays.randomItems(this._value, count); | ||
} | ||
public value<S = K>(): S[] { | ||
@@ -167,0 +179,0 @@ return this._value as S[] |
@@ -20,3 +20,3 @@ { | ||
"main": "./index.js", | ||
"version": "8.0.29", | ||
"version": "8.0.30", | ||
"license": "MIT", | ||
@@ -23,0 +23,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
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
224532
4082