@sysbedlam/array-utils 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/array-utils.js +13 -0
  2. package/package.json +19 -0
package/array-utils.js ADDED
@@ -0,0 +1,13 @@
1
+ function sum(arr) {
2
+ return arr.reduce((a, b) => a + b, 0);
3
+ }
4
+
5
+ function max(arr) {
6
+ return Math.max(...arr);
7
+ }
8
+
9
+ function unique(arr) {
10
+ return [...new Set(arr)];
11
+ }
12
+
13
+ module.exports = { sum, max, unique };
package/package.json ADDED
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "@sysbedlam/array-utils",
3
+ "version": "1.0.0",
4
+ "description": "",
5
+ "main": "array-utils.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/sysbedlam/sf-npm2.git"
12
+ },
13
+ "author": "egor",
14
+ "license": "ISC",
15
+ "bugs": {
16
+ "url": "https://github.com/sysbedlam/sf-npm2/issues"
17
+ },
18
+ "homepage": "https://github.com/sysbedlam/sf-npm2#readme"
19
+ }