lolite.compact 1.1.9 → 1.1.13

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/README.md +0 -59
  2. package/package.json +6 -1
package/README.md CHANGED
@@ -8,63 +8,4 @@ const result = compact([1, 0, false, "hello"])
8
8
  const undef = compact("Not an array")
9
9
  // undef: undefined
10
10
  ```
11
-
12
- ### flatten(array)
13
- Flattens arrays. Returns undefined for non-arrays.
14
-
15
- ```javascript
16
- const lolite = require("lolite.compact")
17
- const flat = lolite.flatten([1, [2, [3]]])
18
- // flat: [1, 2, 3]
19
- const undef = lolite.flatten("Not an array")
20
- // undef: undefined
21
- ```
22
-
23
- ### first(array)
24
- alias: head(array)
25
-
26
- Get the first element of an array. Returns undefined for non-arrays.
27
- ```javascript
28
- const lolite = require("lolite.compact")
29
- const testArray = [0, 1, 2]
30
- console.log(lolite.first(testArray)) // 0
31
- console.log(lolite.head(testArray)) // 0
32
- ```
33
-
34
- ### last(array)
35
-
36
- Get the last element of an array. Returns undefined for non-arrays.
37
- ```javascript
38
- const lolite = require("lolite.compact")
39
- const testArray = [0, 1, 2]
40
- console.log(lolite.last(testArray)) // 2
41
- ```
42
-
43
- ### initial(array)
44
- Returns all but the last element of an array. Returns undefined for non-arrays.
45
- ```js
46
- const lolite = require("lolite.compact")
47
- const result = lolite.initial([1, 2, 3])
48
- // result: [1, 2]
49
-
50
- const single = lolite.initial([1])
51
- // result: []
52
-
53
- const undef = lolite.initial("Not an array")
54
- // result: undefined
55
- ```
56
-
57
- ### tail(array)
58
- Returns all but the first element of an array. Returns undefined for non-arrays.
59
- ```js
60
- const lolite = require("lolite.compact")
61
- const result = lolite.tail([1, 2, 3])
62
- // result: [2, 3]
63
-
64
- const single = lolite.tail([1])
65
- // result: []
66
-
67
- const undef = lolite.tail(null)
68
- // result: undefined
69
- ```
70
11
 
package/package.json CHANGED
@@ -1,8 +1,13 @@
1
1
  {
2
2
  "name": "lolite.compact",
3
- "version": "1.1.9",
3
+ "version": "1.1.13",
4
4
  "main": "src/lib/compact.js",
5
5
  "license": "EGPSL10X-1.0",
6
+ "author": "10x'ly Made Software Ventures AB",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/enterprise-npm-ai/lolite.git"
10
+ },
6
11
  "dependencies": {
7
12
  "lodash.toarray": "^4.4.0",
8
13
  "array.prototype.filter": "^1.0.4",