aneka 0.12.0 → 0.13.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.
- package/CHANGES.md +4 -0
- package/index.js +3 -0
- package/package.json +1 -1
- package/src/text-to-array.js +11 -0
package/CHANGES.md
CHANGED
package/index.js
CHANGED
|
@@ -30,6 +30,7 @@ import generateId from './src/generate-id.js'
|
|
|
30
30
|
import fillObject from './src/fill-object.js'
|
|
31
31
|
import parseKvString from './src/parse-kv-string.js'
|
|
32
32
|
import without from './src/without.js'
|
|
33
|
+
import textToArray from './src/text-to-array.js'
|
|
33
34
|
|
|
34
35
|
export {
|
|
35
36
|
arrangeArray,
|
|
@@ -63,6 +64,7 @@ export {
|
|
|
63
64
|
secToHms,
|
|
64
65
|
setImmediate,
|
|
65
66
|
shim,
|
|
67
|
+
textToArray,
|
|
66
68
|
titleize,
|
|
67
69
|
without
|
|
68
70
|
}
|
|
@@ -98,6 +100,7 @@ export default {
|
|
|
98
100
|
round,
|
|
99
101
|
secToHms,
|
|
100
102
|
shim,
|
|
103
|
+
textToArray,
|
|
101
104
|
titleize,
|
|
102
105
|
without
|
|
103
106
|
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import isEmpty from 'lodash-es/isEmpty.js'
|
|
2
|
+
|
|
3
|
+
function textToArray (text) {
|
|
4
|
+
const lines = text.trim().split('\n').map(line => line.trim())
|
|
5
|
+
return lines.filter(c => {
|
|
6
|
+
const line = c.split('#')[0].trim()
|
|
7
|
+
return !isEmpty(line)
|
|
8
|
+
})
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export default textToArray
|