angular-slickgrid 4.2.1 → 4.2.2
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/LICENSE +20 -20
- package/app/modules/angular-slickgrid/components/angular-slickgrid.component.d.ts +2 -2
- package/app/modules/angular-slickgrid/extensions/slickRowDetailView.d.ts +0 -2
- package/docs/assets/lib/multiple-select/README.md +17 -17
- package/esm2020/app/modules/angular-slickgrid/components/angular-slickgrid.component.mjs +14 -14
- package/esm2020/app/modules/angular-slickgrid/constants.mjs +1 -1
- package/esm2020/app/modules/angular-slickgrid/extensions/index.mjs +1 -1
- package/esm2020/app/modules/angular-slickgrid/extensions/slickRowDetailView.mjs +2 -4
- package/esm2020/app/modules/angular-slickgrid/global-grid-options.mjs +1 -1
- package/esm2020/app/modules/angular-slickgrid/index.mjs +1 -1
- package/esm2020/app/modules/angular-slickgrid/models/angularComponentOutput.interface.mjs +1 -1
- package/esm2020/app/modules/angular-slickgrid/models/angularGridInstance.interface.mjs +1 -1
- package/esm2020/app/modules/angular-slickgrid/models/externalTestingDependencies.interface.mjs +1 -1
- package/esm2020/app/modules/angular-slickgrid/models/gridOption.interface.mjs +1 -1
- package/esm2020/app/modules/angular-slickgrid/models/index.mjs +1 -1
- package/esm2020/app/modules/angular-slickgrid/models/rowDetailView.interface.mjs +1 -1
- package/esm2020/app/modules/angular-slickgrid/models/slickGrid.interface.mjs +1 -1
- package/esm2020/app/modules/angular-slickgrid/modules/angular-slickgrid.module.mjs +7 -10
- package/esm2020/app/modules/angular-slickgrid/services/angularUtil.service.mjs +4 -4
- package/esm2020/app/modules/angular-slickgrid/services/bsDropdown.service.mjs +4 -4
- package/esm2020/app/modules/angular-slickgrid/services/container.service.mjs +4 -4
- package/esm2020/app/modules/angular-slickgrid/services/index.mjs +1 -1
- package/esm2020/app/modules/angular-slickgrid/services/translater.service.mjs +4 -4
- package/esm2020/app/modules/angular-slickgrid/services/utilities.mjs +1 -1
- package/esm2020/app/modules/angular-slickgrid/slickgrid-config.mjs +1 -1
- package/esm2020/public_api.mjs +1 -1
- package/fesm2015/angular-slickgrid.mjs +32 -37
- package/fesm2015/angular-slickgrid.mjs.map +1 -1
- package/fesm2020/angular-slickgrid.mjs +32 -37
- package/fesm2020/angular-slickgrid.mjs.map +1 -1
- package/i18n/en.json +89 -89
- package/i18n/fr.json +90 -90
- package/{angular-slickgrid.d.ts → index.d.ts} +0 -0
- package/package.json +11 -11
- package/test/cypress/node_modules/@cypress/request/README.md +1038 -0
- package/test/cypress/node_modules/@cypress/xvfb/README.md +48 -0
- package/test/cypress/node_modules/@cypress/xvfb/node_modules/debug/README.md +437 -0
- package/test/cypress/node_modules/@types/node/README.md +16 -0
- package/test/cypress/node_modules/@types/sinonjs__fake-timers/README.md +16 -0
- package/test/cypress/node_modules/@types/sizzle/README.md +16 -0
- package/test/cypress/node_modules/@types/yauzl/README.md +16 -0
- package/test/cypress/node_modules/@types/yauzl/node_modules/@types/node/README.md +16 -0
- package/test/cypress/node_modules/aggregate-error/README.md +61 -0
- package/test/cypress/node_modules/ansi-colors/README.md +315 -0
- package/test/cypress/node_modules/ansi-escapes/README.md +245 -0
- package/test/cypress/node_modules/ansi-regex/README.md +78 -0
- package/test/cypress/node_modules/ansi-styles/README.md +152 -0
- package/test/cypress/node_modules/arch/README.md +71 -0
- package/test/cypress/node_modules/asn1/README.md +50 -0
- package/test/cypress/node_modules/assert-plus/README.md +162 -0
- package/test/cypress/node_modules/astral-regex/README.md +46 -0
- package/test/cypress/node_modules/async/README.md +60 -0
- package/test/cypress/node_modules/asynckit/README.md +233 -0
- package/test/cypress/node_modules/at-least-node/README.md +25 -0
- package/test/cypress/node_modules/aws-sign2/README.md +4 -0
- package/test/cypress/node_modules/aws4/README.md +183 -0
- package/test/cypress/node_modules/balanced-match/README.md +91 -0
- package/test/cypress/node_modules/base64-js/README.md +34 -0
- package/test/cypress/node_modules/bcrypt-pbkdf/README.md +45 -0
- package/test/cypress/node_modules/blob-util/README.md +623 -0
- package/test/cypress/node_modules/bluebird/README.md +57 -0
- package/test/cypress/node_modules/brace-expansion/README.md +129 -0
- package/test/cypress/node_modules/buffer/README.md +410 -0
- package/test/cypress/node_modules/buffer-crc32/README.md +47 -0
- package/test/cypress/node_modules/cachedir/README.md +27 -0
- package/test/cypress/node_modules/caseless/README.md +45 -0
- package/test/cypress/node_modules/chalk/README.md +293 -0
- package/test/cypress/node_modules/chalk/node_modules/supports-color/README.md +76 -0
- package/test/cypress/node_modules/check-more-types/README.md +952 -0
- package/test/cypress/node_modules/ci-info/README.md +114 -0
- package/test/cypress/node_modules/clean-stack/README.md +76 -0
- package/test/cypress/node_modules/cli-cursor/README.md +55 -0
- package/test/cypress/node_modules/cli-table3/README.md +218 -0
- package/test/cypress/node_modules/cli-truncate/README.md +139 -0
- package/test/cypress/node_modules/color-convert/README.md +68 -0
- package/test/cypress/node_modules/color-name/README.md +11 -0
- package/test/cypress/node_modules/colorette/README.md +102 -0
- package/test/cypress/node_modules/colors/README.md +221 -0
- package/test/cypress/node_modules/combined-stream/README.md +138 -0
- package/test/cypress/node_modules/commander/README.md +737 -0
- package/test/cypress/node_modules/common-tags/README.md +687 -0
- package/test/cypress/node_modules/core-util-is/README.md +3 -0
- package/test/cypress/node_modules/cross-spawn/README.md +96 -0
- package/test/cypress/node_modules/cypress/README.md +25 -0
- package/test/cypress/node_modules/cypress/mount-utils/README.md +14 -0
- package/test/cypress/node_modules/cypress/react/README.md +414 -0
- package/test/cypress/node_modules/cypress/vue/README.md +678 -0
- package/test/cypress/node_modules/cypress/vue2/README.md +693 -0
- package/test/cypress/node_modules/dashdash/README.md +574 -0
- package/test/cypress/node_modules/dayjs/README.md +128 -0
- package/test/cypress/node_modules/debug/README.md +455 -0
- package/test/cypress/node_modules/delayed-stream/README.md +141 -0
- package/test/cypress/node_modules/ecc-jsbn/README.md +8 -0
- package/test/cypress/node_modules/emoji-regex/README.md +73 -0
- package/test/cypress/node_modules/end-of-stream/README.md +54 -0
- package/test/cypress/node_modules/enquirer/README.md +1752 -0
- package/test/cypress/node_modules/escape-string-regexp/README.md +27 -0
- package/test/cypress/node_modules/eventemitter2/README.md +809 -0
- package/test/cypress/node_modules/execa/README.md +656 -0
- package/test/cypress/node_modules/executable/README.md +64 -0
- package/test/cypress/node_modules/extend/README.md +81 -0
- package/test/cypress/node_modules/extract-zip/README.md +57 -0
- package/test/cypress/node_modules/extract-zip/node_modules/debug/README.md +455 -0
- package/test/cypress/node_modules/extsprintf/README.md +46 -0
- package/test/cypress/node_modules/fd-slicer/README.md +199 -0
- package/test/cypress/node_modules/figures/README.md +139 -0
- package/test/cypress/node_modules/forever-agent/README.md +4 -0
- package/test/cypress/node_modules/form-data/README.md +234 -0
- package/test/cypress/node_modules/fs-extra/README.md +264 -0
- package/test/cypress/node_modules/fs.realpath/README.md +33 -0
- package/test/cypress/node_modules/get-stream/README.md +124 -0
- package/test/cypress/node_modules/getos/README.md +79 -0
- package/test/cypress/node_modules/getpass/README.md +32 -0
- package/test/cypress/node_modules/glob/README.md +375 -0
- package/test/cypress/node_modules/global-dirs/README.md +72 -0
- package/test/cypress/node_modules/graceful-fs/README.md +133 -0
- package/test/cypress/node_modules/has-flag/README.md +89 -0
- package/test/cypress/node_modules/http-signature/README.md +80 -0
- package/test/cypress/node_modules/human-signals/README.md +155 -0
- package/test/cypress/node_modules/ieee754/README.md +51 -0
- package/test/cypress/node_modules/indent-string/README.md +70 -0
- package/test/cypress/node_modules/inflight/README.md +37 -0
- package/test/cypress/node_modules/inherits/README.md +42 -0
- package/test/cypress/node_modules/ini/README.md +102 -0
- package/test/cypress/node_modules/is-ci/README.md +50 -0
- package/test/cypress/node_modules/is-fullwidth-code-point/README.md +39 -0
- package/test/cypress/node_modules/is-installed-globally/README.md +31 -0
- package/test/cypress/node_modules/is-path-inside/README.md +63 -0
- package/test/cypress/node_modules/is-stream/README.md +57 -0
- package/test/cypress/node_modules/is-typedarray/README.md +16 -0
- package/test/cypress/node_modules/isexe/README.md +51 -0
- package/test/cypress/node_modules/isstream/README.md +66 -0
- package/test/cypress/node_modules/jsbn/README.md +175 -0
- package/test/cypress/node_modules/json-schema/README.md +3 -0
- package/test/cypress/node_modules/json-stringify-safe/README.md +52 -0
- package/test/cypress/node_modules/jsonfile/README.md +205 -0
- package/test/cypress/node_modules/jsonfile/node_modules/universalify/README.md +76 -0
- package/test/cypress/node_modules/jsprim/README.md +287 -0
- package/test/cypress/node_modules/lazy-ass/README.md +269 -0
- package/test/cypress/node_modules/listr2/README.md +17 -0
- package/test/cypress/node_modules/lodash/README.md +39 -0
- package/test/cypress/node_modules/lodash.once/README.md +18 -0
- package/test/cypress/node_modules/log-symbols/README.md +51 -0
- package/test/cypress/node_modules/log-update/README.md +97 -0
- package/test/cypress/node_modules/log-update/node_modules/slice-ansi/README.md +66 -0
- package/test/cypress/node_modules/log-update/node_modules/wrap-ansi/README.md +97 -0
- package/test/cypress/node_modules/lru-cache/README.md +166 -0
- package/test/cypress/node_modules/merge-stream/README.md +78 -0
- package/test/cypress/node_modules/mime-db/README.md +102 -0
- package/test/cypress/node_modules/mime-types/README.md +123 -0
- package/test/cypress/node_modules/mimic-fn/README.md +69 -0
- package/test/cypress/node_modules/minimatch/README.md +209 -0
- package/test/cypress/node_modules/ms/README.md +60 -0
- package/test/cypress/node_modules/npm-run-path/README.md +115 -0
- package/test/cypress/node_modules/once/README.md +79 -0
- package/test/cypress/node_modules/onetime/README.md +94 -0
- package/test/cypress/node_modules/ospath/README.md +53 -0
- package/test/cypress/node_modules/p-map/README.md +89 -0
- package/test/cypress/node_modules/path-is-absolute/README.md +59 -0
- package/test/cypress/node_modules/path-key/README.md +61 -0
- package/test/cypress/node_modules/pend/README.md +41 -0
- package/test/cypress/node_modules/performance-now/README.md +30 -0
- package/test/cypress/node_modules/pify/README.md +119 -0
- package/test/cypress/node_modules/pretty-bytes/README.md +131 -0
- package/test/cypress/node_modules/proxy-from-env/README.md +131 -0
- package/test/cypress/node_modules/psl/README.md +215 -0
- package/test/cypress/node_modules/pump/README.md +65 -0
- package/test/cypress/node_modules/punycode/README.md +122 -0
- package/test/cypress/node_modules/qs/README.md +475 -0
- package/test/cypress/node_modules/request-progress/README.md +78 -0
- package/test/cypress/node_modules/restore-cursor/README.md +26 -0
- package/test/cypress/node_modules/rimraf/README.md +101 -0
- package/test/cypress/node_modules/rxjs/README.md +147 -0
- package/test/cypress/node_modules/rxjs/_esm2015/README.md +147 -0
- package/test/cypress/node_modules/rxjs/_esm5/README.md +147 -0
- package/test/cypress/node_modules/rxjs/src/README.md +147 -0
- package/test/cypress/node_modules/safe-buffer/README.md +584 -0
- package/test/cypress/node_modules/safer-buffer/README.md +156 -0
- package/test/cypress/node_modules/semver/README.md +566 -0
- package/test/cypress/node_modules/shebang-command/README.md +34 -0
- package/test/cypress/node_modules/shebang-regex/README.md +33 -0
- package/test/cypress/node_modules/signal-exit/README.md +39 -0
- package/test/cypress/node_modules/slice-ansi/README.md +72 -0
- package/test/cypress/node_modules/sshpk/README.md +804 -0
- package/test/cypress/node_modules/string-width/README.md +50 -0
- package/test/cypress/node_modules/strip-ansi/README.md +46 -0
- package/test/cypress/node_modules/strip-final-newline/README.md +30 -0
- package/test/cypress/node_modules/supports-color/README.md +77 -0
- package/test/cypress/node_modules/throttleit/README.md +32 -0
- package/test/cypress/node_modules/tmp/README.md +365 -0
- package/test/cypress/node_modules/tough-cookie/README.md +527 -0
- package/test/cypress/node_modules/tslib/README.md +142 -0
- package/test/cypress/node_modules/tunnel-agent/README.md +4 -0
- package/test/cypress/node_modules/tweetnacl/README.md +459 -0
- package/test/cypress/node_modules/type-fest/README.md +760 -0
- package/test/cypress/node_modules/universalify/README.md +76 -0
- package/test/cypress/node_modules/untildify/README.md +30 -0
- package/test/cypress/node_modules/uuid/README.md +505 -0
- package/test/cypress/node_modules/verror/README.md +528 -0
- package/test/cypress/node_modules/verror/node_modules/extsprintf/README.md +46 -0
- package/test/cypress/node_modules/which/README.md +54 -0
- package/test/cypress/node_modules/wrap-ansi/README.md +91 -0
- package/test/cypress/node_modules/wrappy/README.md +36 -0
- package/test/cypress/node_modules/yallist/README.md +204 -0
- package/test/cypress/node_modules/yauzl/README.md +658 -0
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# universalify
|
|
2
|
+
|
|
3
|
+
[](https://travis-ci.org/RyanZim/universalify)
|
|
4
|
+

|
|
5
|
+

|
|
6
|
+

|
|
7
|
+
|
|
8
|
+
Make a callback- or promise-based function support both promises and callbacks.
|
|
9
|
+
|
|
10
|
+
Uses the native promise implementation.
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install universalify
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## API
|
|
19
|
+
|
|
20
|
+
### `universalify.fromCallback(fn)`
|
|
21
|
+
|
|
22
|
+
Takes a callback-based function to universalify, and returns the universalified function.
|
|
23
|
+
|
|
24
|
+
Function must take a callback as the last parameter that will be called with the signature `(error, result)`. `universalify` does not support calling the callback with three or more arguments, and does not ensure that the callback is only called once.
|
|
25
|
+
|
|
26
|
+
```js
|
|
27
|
+
function callbackFn (n, cb) {
|
|
28
|
+
setTimeout(() => cb(null, n), 15)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const fn = universalify.fromCallback(callbackFn)
|
|
32
|
+
|
|
33
|
+
// Works with Promises:
|
|
34
|
+
fn('Hello World!')
|
|
35
|
+
.then(result => console.log(result)) // -> Hello World!
|
|
36
|
+
.catch(error => console.error(error))
|
|
37
|
+
|
|
38
|
+
// Works with Callbacks:
|
|
39
|
+
fn('Hi!', (error, result) => {
|
|
40
|
+
if (error) return console.error(error)
|
|
41
|
+
console.log(result)
|
|
42
|
+
// -> Hi!
|
|
43
|
+
})
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### `universalify.fromPromise(fn)`
|
|
47
|
+
|
|
48
|
+
Takes a promise-based function to universalify, and returns the universalified function.
|
|
49
|
+
|
|
50
|
+
Function must return a valid JS promise. `universalify` does not ensure that a valid promise is returned.
|
|
51
|
+
|
|
52
|
+
```js
|
|
53
|
+
function promiseFn (n) {
|
|
54
|
+
return new Promise(resolve => {
|
|
55
|
+
setTimeout(() => resolve(n), 15)
|
|
56
|
+
})
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const fn = universalify.fromPromise(promiseFn)
|
|
60
|
+
|
|
61
|
+
// Works with Promises:
|
|
62
|
+
fn('Hello World!')
|
|
63
|
+
.then(result => console.log(result)) // -> Hello World!
|
|
64
|
+
.catch(error => console.error(error))
|
|
65
|
+
|
|
66
|
+
// Works with Callbacks:
|
|
67
|
+
fn('Hi!', (error, result) => {
|
|
68
|
+
if (error) return console.error(error)
|
|
69
|
+
console.log(result)
|
|
70
|
+
// -> Hi!
|
|
71
|
+
})
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## License
|
|
75
|
+
|
|
76
|
+
MIT
|
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
# jsprim: utilities for primitive JavaScript types
|
|
2
|
+
|
|
3
|
+
This module provides miscellaneous facilities for working with strings,
|
|
4
|
+
numbers, dates, and objects and arrays of these basic types.
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
### deepCopy(obj)
|
|
8
|
+
|
|
9
|
+
Creates a deep copy of a primitive type, object, or array of primitive types.
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### deepEqual(obj1, obj2)
|
|
13
|
+
|
|
14
|
+
Returns whether two objects are equal.
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### isEmpty(obj)
|
|
18
|
+
|
|
19
|
+
Returns true if the given object has no properties and false otherwise. This
|
|
20
|
+
is O(1) (unlike `Object.keys(obj).length === 0`, which is O(N)).
|
|
21
|
+
|
|
22
|
+
### hasKey(obj, key)
|
|
23
|
+
|
|
24
|
+
Returns true if the given object has an enumerable, non-inherited property
|
|
25
|
+
called `key`. [For information on enumerability and ownership of properties, see
|
|
26
|
+
the MDN
|
|
27
|
+
documentation.](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Enumerability_and_ownership_of_properties)
|
|
28
|
+
|
|
29
|
+
### forEachKey(obj, callback)
|
|
30
|
+
|
|
31
|
+
Like Array.forEach, but iterates enumerable, owned properties of an object
|
|
32
|
+
rather than elements of an array. Equivalent to:
|
|
33
|
+
|
|
34
|
+
for (var key in obj) {
|
|
35
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
36
|
+
callback(key, obj[key]);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
### flattenObject(obj, depth)
|
|
42
|
+
|
|
43
|
+
Flattens an object up to a given level of nesting, returning an array of arrays
|
|
44
|
+
of length "depth + 1", where the first "depth" elements correspond to flattened
|
|
45
|
+
columns and the last element contains the remaining object . For example:
|
|
46
|
+
|
|
47
|
+
flattenObject({
|
|
48
|
+
'I': {
|
|
49
|
+
'A': {
|
|
50
|
+
'i': {
|
|
51
|
+
'datum1': [ 1, 2 ],
|
|
52
|
+
'datum2': [ 3, 4 ]
|
|
53
|
+
},
|
|
54
|
+
'ii': {
|
|
55
|
+
'datum1': [ 3, 4 ]
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
'B': {
|
|
59
|
+
'i': {
|
|
60
|
+
'datum1': [ 5, 6 ]
|
|
61
|
+
},
|
|
62
|
+
'ii': {
|
|
63
|
+
'datum1': [ 7, 8 ],
|
|
64
|
+
'datum2': [ 3, 4 ],
|
|
65
|
+
},
|
|
66
|
+
'iii': {
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
'II': {
|
|
71
|
+
'A': {
|
|
72
|
+
'i': {
|
|
73
|
+
'datum1': [ 1, 2 ],
|
|
74
|
+
'datum2': [ 3, 4 ]
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}, 3)
|
|
79
|
+
|
|
80
|
+
becomes:
|
|
81
|
+
|
|
82
|
+
[
|
|
83
|
+
[ 'I', 'A', 'i', { 'datum1': [ 1, 2 ], 'datum2': [ 3, 4 ] } ],
|
|
84
|
+
[ 'I', 'A', 'ii', { 'datum1': [ 3, 4 ] } ],
|
|
85
|
+
[ 'I', 'B', 'i', { 'datum1': [ 5, 6 ] } ],
|
|
86
|
+
[ 'I', 'B', 'ii', { 'datum1': [ 7, 8 ], 'datum2': [ 3, 4 ] } ],
|
|
87
|
+
[ 'I', 'B', 'iii', {} ],
|
|
88
|
+
[ 'II', 'A', 'i', { 'datum1': [ 1, 2 ], 'datum2': [ 3, 4 ] } ]
|
|
89
|
+
]
|
|
90
|
+
|
|
91
|
+
This function is strict: "depth" must be a non-negative integer and "obj" must
|
|
92
|
+
be a non-null object with at least "depth" levels of nesting under all keys.
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
### flattenIter(obj, depth, func)
|
|
96
|
+
|
|
97
|
+
This is similar to `flattenObject` except that instead of returning an array,
|
|
98
|
+
this function invokes `func(entry)` for each `entry` in the array that
|
|
99
|
+
`flattenObject` would return. `flattenIter(obj, depth, func)` is logically
|
|
100
|
+
equivalent to `flattenObject(obj, depth).forEach(func)`. Importantly, this
|
|
101
|
+
version never constructs the full array. Its memory usage is O(depth) rather
|
|
102
|
+
than O(n) (where `n` is the number of flattened elements).
|
|
103
|
+
|
|
104
|
+
There's another difference between `flattenObject` and `flattenIter` that's
|
|
105
|
+
related to the special case where `depth === 0`. In this case, `flattenObject`
|
|
106
|
+
omits the array wrapping `obj` (which is regrettable).
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
### pluck(obj, key)
|
|
110
|
+
|
|
111
|
+
Fetch nested property "key" from object "obj", traversing objects as needed.
|
|
112
|
+
For example, `pluck(obj, "foo.bar.baz")` is roughly equivalent to
|
|
113
|
+
`obj.foo.bar.baz`, except that:
|
|
114
|
+
|
|
115
|
+
1. If traversal fails, the resulting value is undefined, and no error is
|
|
116
|
+
thrown. For example, `pluck({}, "foo.bar")` is just undefined.
|
|
117
|
+
2. If "obj" has property "key" directly (without traversing), the
|
|
118
|
+
corresponding property is returned. For example,
|
|
119
|
+
`pluck({ 'foo.bar': 1 }, 'foo.bar')` is 1, not undefined. This is also
|
|
120
|
+
true recursively, so `pluck({ 'a': { 'foo.bar': 1 } }, 'a.foo.bar')` is
|
|
121
|
+
also 1, not undefined.
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
### randElt(array)
|
|
125
|
+
|
|
126
|
+
Returns an element from "array" selected uniformly at random. If "array" is
|
|
127
|
+
empty, throws an Error.
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
### startsWith(str, prefix)
|
|
131
|
+
|
|
132
|
+
Returns true if the given string starts with the given prefix and false
|
|
133
|
+
otherwise.
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
### endsWith(str, suffix)
|
|
137
|
+
|
|
138
|
+
Returns true if the given string ends with the given suffix and false
|
|
139
|
+
otherwise.
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
### parseInteger(str, options)
|
|
143
|
+
|
|
144
|
+
Parses the contents of `str` (a string) as an integer. On success, the integer
|
|
145
|
+
value is returned (as a number). On failure, an error is **returned** describing
|
|
146
|
+
why parsing failed.
|
|
147
|
+
|
|
148
|
+
By default, leading and trailing whitespace characters are not allowed, nor are
|
|
149
|
+
trailing characters that are not part of the numeric representation. This
|
|
150
|
+
behaviour can be toggled by using the options below. The empty string (`''`) is
|
|
151
|
+
not considered valid input. If the return value cannot be precisely represented
|
|
152
|
+
as a number (i.e., is smaller than `Number.MIN_SAFE_INTEGER` or larger than
|
|
153
|
+
`Number.MAX_SAFE_INTEGER`), an error is returned. Additionally, the string
|
|
154
|
+
`'-0'` will be parsed as the integer `0`, instead of as the IEEE floating point
|
|
155
|
+
value `-0`.
|
|
156
|
+
|
|
157
|
+
This function accepts both upper and lowercase characters for digits, similar to
|
|
158
|
+
`parseInt()`, `Number()`, and [strtol(3C)](https://illumos.org/man/3C/strtol).
|
|
159
|
+
|
|
160
|
+
The following may be specified in `options`:
|
|
161
|
+
|
|
162
|
+
Option | Type | Default | Meaning
|
|
163
|
+
------------------ | ------- | ------- | ---------------------------
|
|
164
|
+
base | number | 10 | numeric base (radix) to use, in the range 2 to 36
|
|
165
|
+
allowSign | boolean | true | whether to interpret any leading `+` (positive) and `-` (negative) characters
|
|
166
|
+
allowImprecise | boolean | false | whether to accept values that may have lost precision (past `MAX_SAFE_INTEGER` or below `MIN_SAFE_INTEGER`)
|
|
167
|
+
allowPrefix | boolean | false | whether to interpret the prefixes `0b` (base 2), `0o` (base 8), `0t` (base 10), or `0x` (base 16)
|
|
168
|
+
allowTrailing | boolean | false | whether to ignore trailing characters
|
|
169
|
+
trimWhitespace | boolean | false | whether to trim any leading or trailing whitespace/line terminators
|
|
170
|
+
leadingZeroIsOctal | boolean | false | whether a leading zero indicates octal
|
|
171
|
+
|
|
172
|
+
Note that if `base` is unspecified, and `allowPrefix` or `leadingZeroIsOctal`
|
|
173
|
+
are, then the leading characters can change the default base from 10. If `base`
|
|
174
|
+
is explicitly specified and `allowPrefix` is true, then the prefix will only be
|
|
175
|
+
accepted if it matches the specified base. `base` and `leadingZeroIsOctal`
|
|
176
|
+
cannot be used together.
|
|
177
|
+
|
|
178
|
+
**Context:** It's tricky to parse integers with JavaScript's built-in facilities
|
|
179
|
+
for several reasons:
|
|
180
|
+
|
|
181
|
+
- `parseInt()` and `Number()` by default allow the base to be specified in the
|
|
182
|
+
input string by a prefix (e.g., `0x` for hex).
|
|
183
|
+
- `parseInt()` allows trailing nonnumeric characters.
|
|
184
|
+
- `Number(str)` returns 0 when `str` is the empty string (`''`).
|
|
185
|
+
- Both functions return incorrect values when the input string represents a
|
|
186
|
+
valid integer outside the range of integers that can be represented precisely.
|
|
187
|
+
Specifically, `parseInt('9007199254740993')` returns 9007199254740992.
|
|
188
|
+
- Both functions always accept `-` and `+` signs before the digit.
|
|
189
|
+
- Some older JavaScript engines always interpret a leading 0 as indicating
|
|
190
|
+
octal, which can be surprising when parsing input from users who expect a
|
|
191
|
+
leading zero to be insignificant.
|
|
192
|
+
|
|
193
|
+
While each of these may be desirable in some contexts, there are also times when
|
|
194
|
+
none of them are wanted. `parseInteger()` grants greater control over what
|
|
195
|
+
input's permissible.
|
|
196
|
+
|
|
197
|
+
### iso8601(date)
|
|
198
|
+
|
|
199
|
+
Converts a Date object to an ISO8601 date string of the form
|
|
200
|
+
"YYYY-MM-DDTHH:MM:SS.sssZ". This format is not customizable.
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
### parseDateTime(str)
|
|
204
|
+
|
|
205
|
+
Parses a date expressed as a string, as either a number of milliseconds since
|
|
206
|
+
the epoch or any string format that Date accepts, giving preference to the
|
|
207
|
+
former where these two sets overlap (e.g., strings containing small numbers).
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
### hrtimeDiff(timeA, timeB)
|
|
211
|
+
|
|
212
|
+
Given two hrtime readings (as from Node's `process.hrtime()`), where timeA is
|
|
213
|
+
later than timeB, compute the difference and return that as an hrtime. It is
|
|
214
|
+
illegal to invoke this for a pair of times where timeB is newer than timeA.
|
|
215
|
+
|
|
216
|
+
### hrtimeAdd(timeA, timeB)
|
|
217
|
+
|
|
218
|
+
Add two hrtime intervals (as from Node's `process.hrtime()`), returning a new
|
|
219
|
+
hrtime interval array. This function does not modify either input argument.
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
### hrtimeAccum(timeA, timeB)
|
|
223
|
+
|
|
224
|
+
Add two hrtime intervals (as from Node's `process.hrtime()`), storing the
|
|
225
|
+
result in `timeA`. This function overwrites (and returns) the first argument
|
|
226
|
+
passed in.
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
### hrtimeNanosec(timeA), hrtimeMicrosec(timeA), hrtimeMillisec(timeA)
|
|
230
|
+
|
|
231
|
+
This suite of functions converts a hrtime interval (as from Node's
|
|
232
|
+
`process.hrtime()`) into a scalar number of nanoseconds, microseconds or
|
|
233
|
+
milliseconds. Results are truncated, as with `Math.floor()`.
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
### validateJsonObject(schema, object)
|
|
237
|
+
|
|
238
|
+
Uses JSON validation (via JSV) to validate the given object against the given
|
|
239
|
+
schema. On success, returns null. On failure, *returns* (does not throw) a
|
|
240
|
+
useful Error object.
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
### extraProperties(object, allowed)
|
|
244
|
+
|
|
245
|
+
Check an object for unexpected properties. Accepts the object to check, and an
|
|
246
|
+
array of allowed property name strings. If extra properties are detected, an
|
|
247
|
+
array of extra property names is returned. If no properties other than those
|
|
248
|
+
in the allowed list are present on the object, the returned array will be of
|
|
249
|
+
zero length.
|
|
250
|
+
|
|
251
|
+
### mergeObjects(provided, overrides, defaults)
|
|
252
|
+
|
|
253
|
+
Merge properties from objects "provided", "overrides", and "defaults". The
|
|
254
|
+
intended use case is for functions that accept named arguments in an "args"
|
|
255
|
+
object, but want to provide some default values and override other values. In
|
|
256
|
+
that case, "provided" is what the caller specified, "overrides" are what the
|
|
257
|
+
function wants to override, and "defaults" contains default values.
|
|
258
|
+
|
|
259
|
+
The function starts with the values in "defaults", overrides them with the
|
|
260
|
+
values in "provided", and then overrides those with the values in "overrides".
|
|
261
|
+
For convenience, any of these objects may be falsey, in which case they will be
|
|
262
|
+
ignored. The input objects are never modified, but properties in the returned
|
|
263
|
+
object are not deep-copied.
|
|
264
|
+
|
|
265
|
+
For example:
|
|
266
|
+
|
|
267
|
+
mergeObjects(undefined, { 'objectMode': true }, { 'highWaterMark': 0 })
|
|
268
|
+
|
|
269
|
+
returns:
|
|
270
|
+
|
|
271
|
+
{ 'objectMode': true, 'highWaterMark': 0 }
|
|
272
|
+
|
|
273
|
+
For another example:
|
|
274
|
+
|
|
275
|
+
mergeObjects(
|
|
276
|
+
{ 'highWaterMark': 16, 'objectMode': 7 }, /* from caller */
|
|
277
|
+
{ 'objectMode': true }, /* overrides */
|
|
278
|
+
{ 'highWaterMark': 0 }); /* default */
|
|
279
|
+
|
|
280
|
+
returns:
|
|
281
|
+
|
|
282
|
+
{ 'objectMode': true, 'highWaterMark': 16 }
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
# Contributing
|
|
286
|
+
|
|
287
|
+
See separate [contribution guidelines](CONTRIBUTING.md).
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
# lazy-ass
|
|
2
|
+
|
|
3
|
+
> Lazy assertions without performance penalty
|
|
4
|
+
|
|
5
|
+
[![NPM][lazy-ass-icon] ][lazy-ass-url]
|
|
6
|
+
|
|
7
|
+
[![Build status][lazy-ass-ci-image] ][lazy-ass-ci-url]
|
|
8
|
+
[](https://github.com/bahmutov/manpm)
|
|
9
|
+
[![dependencies][lazy-ass-dependencies-image] ][lazy-ass-dependencies-url]
|
|
10
|
+
[![devdependencies][lazy-ass-devdependencies-image] ][lazy-ass-devdependencies-url]
|
|
11
|
+
|
|
12
|
+
[![semantic-release][semantic-image] ][semantic-url]
|
|
13
|
+
[![Coverage Status][lazy-ass-coverage-image]][lazy-ass-coverage-url]
|
|
14
|
+
[![Codacy][lazy-ass-codacy-image]][lazy-ass-codacy-url]
|
|
15
|
+
[![Code Climate][lazy-ass-code-climate-image]][lazy-ass-code-climate-url]
|
|
16
|
+
|
|
17
|
+
[Demo](http://glebbahmutov.com/lazy-ass/)
|
|
18
|
+
|
|
19
|
+
Is the current code breaking dependencies if released?
|
|
20
|
+
[![Dont-break][circle-ci-image] ][circle-ci-url] - checks using
|
|
21
|
+
[dont-break](https://github.com/bahmutov/dont-break)
|
|
22
|
+
[circle-ci-image]: https://circleci.com/gh/bahmutov/lazy-ass.svg?style=svg
|
|
23
|
+
[circle-ci-url]: https://circleci.com/gh/bahmutov/lazy-ass
|
|
24
|
+
|
|
25
|
+
## Example
|
|
26
|
+
|
|
27
|
+
Regular assertions evaluate all arguments and concatenate message
|
|
28
|
+
EVERY time, even if the condition is true.
|
|
29
|
+
|
|
30
|
+
```js
|
|
31
|
+
console.assert(typeof foo === 'object',
|
|
32
|
+
'expected ' + JSON.stringify(foo, null, 2) + ' to be an object');
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Lazy assertion function evaluates its arguments and forms
|
|
36
|
+
a message ONLY IF the condition is false
|
|
37
|
+
|
|
38
|
+
```js
|
|
39
|
+
lazyAss(typeof foo === 'object', 'expected', foo, 'to be an object');
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Concatenates strings, stringifies objects, calls functions - only if
|
|
43
|
+
condition is false.
|
|
44
|
+
|
|
45
|
+
```js
|
|
46
|
+
function environment() {
|
|
47
|
+
// returns string
|
|
48
|
+
}
|
|
49
|
+
var user = {} // an object
|
|
50
|
+
lazyAsync(condition, 'something went wrong for', user, 'in', environment);
|
|
51
|
+
// throws an error with message equivalent of
|
|
52
|
+
// 'something went wrong for ' + JSON.stringify(user) + ' in ' + environment()
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Why?
|
|
56
|
+
|
|
57
|
+
* Passing an object reference to a function is about
|
|
58
|
+
[2000-3000 times faster](http://jsperf.com/object-json-stringify)
|
|
59
|
+
than serializing an object and passing it as a string.
|
|
60
|
+
* Concatenating 2 strings before passing to a function is about
|
|
61
|
+
[30% slower](http://jsperf.com/string-concat-vs-pass-string-reference)
|
|
62
|
+
than passing 2 separate strings.
|
|
63
|
+
|
|
64
|
+
## Install
|
|
65
|
+
|
|
66
|
+
Node: `npm install lazy-ass --save` then `var la = require('lazy-ass');`.
|
|
67
|
+
You can attach the methods to the global object using
|
|
68
|
+
`require('lazy-ass').globalRegister();`.
|
|
69
|
+
|
|
70
|
+
Browser: `bower install lazy-ass --save`, include `index.js`,
|
|
71
|
+
attaches functions `lazyAss` and `la` to `window` object.
|
|
72
|
+
|
|
73
|
+
## Notes
|
|
74
|
+
|
|
75
|
+
You can pass as many arguments to *lazyAss* after the condition. The condition
|
|
76
|
+
will be evaluated every time (this is required for any assertion). The rest of arguments
|
|
77
|
+
will be concatenated according to rules
|
|
78
|
+
|
|
79
|
+
* string will be left unchanged.
|
|
80
|
+
* function will be called and its output will be concatenated.
|
|
81
|
+
* any array or object will be JSON stringified.
|
|
82
|
+
|
|
83
|
+
There will be single space between the individual parts.
|
|
84
|
+
|
|
85
|
+
## Lazy async assertions
|
|
86
|
+
|
|
87
|
+
Sometimes you do not want to throw an error synchronously, breaking the entire
|
|
88
|
+
execution stack. Instead you can throw an error asynchronously using `lazyAssync`,
|
|
89
|
+
which internally implements logic like this:
|
|
90
|
+
|
|
91
|
+
```js
|
|
92
|
+
if (!condition) {
|
|
93
|
+
setTimeout(function () {
|
|
94
|
+
throw new Error('Conditions is false!');
|
|
95
|
+
}, 0);
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
This allows the execution to continue, while your global error handler (like
|
|
100
|
+
my favorite [Sentry](http://glebbahmutov.com/blog/know-unknown-unknowns-with-sentry/))
|
|
101
|
+
can still forward the error with all specified information to your server.
|
|
102
|
+
|
|
103
|
+
```js
|
|
104
|
+
lazyAss.async(false, 'foo');
|
|
105
|
+
console.log('after assync');
|
|
106
|
+
// output
|
|
107
|
+
after assync
|
|
108
|
+
Uncaught Error: foo
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
In this case, there is no meaningful error stack, so use good message
|
|
112
|
+
arguments - there is no performance penalty!
|
|
113
|
+
|
|
114
|
+
## Rethrowing errors
|
|
115
|
+
|
|
116
|
+
If the condition itself is an instance of Error, it is simply rethrown (synchronously or
|
|
117
|
+
asynchronously).
|
|
118
|
+
|
|
119
|
+
```js
|
|
120
|
+
lazyAss(new Error('foo'));
|
|
121
|
+
// Uncaught Error: foo
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Useful to make sure errors in the promise chains are
|
|
125
|
+
[not silently ignored](https://glebbahmutov.com/blog/why-promises-need-to-be-done/).
|
|
126
|
+
|
|
127
|
+
For example, a rejected promise below this will be ignored.
|
|
128
|
+
|
|
129
|
+
```js
|
|
130
|
+
var p = new Promise(function (resolve, reject) {
|
|
131
|
+
reject(new Error('foo'));
|
|
132
|
+
});
|
|
133
|
+
p.then(...);
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
We can catch it and rethrow it *synchronously*, but it will be ignored too (same way,
|
|
137
|
+
only one step further)
|
|
138
|
+
|
|
139
|
+
```js
|
|
140
|
+
var p = new Promise(function (resolve, reject) {
|
|
141
|
+
reject(new Error('foo'));
|
|
142
|
+
});
|
|
143
|
+
p.then(..., lazyAss);
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
But we can actually trigger global error if we rethrow the error *asynchronously*
|
|
147
|
+
|
|
148
|
+
```js
|
|
149
|
+
var p = new Promise(function (resolve, reject) {
|
|
150
|
+
reject(new Error('foo'));
|
|
151
|
+
});
|
|
152
|
+
p.then(..., lazyAssync);
|
|
153
|
+
// Uncaught Error: foo
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
## Predicate function as a condition
|
|
157
|
+
|
|
158
|
+
Typically, JavaScript evaluates the condition expression first, then calls *lazyAss*.
|
|
159
|
+
This means the function itself sees only the true / false result, and not the expression
|
|
160
|
+
itself. This makes makes the error messages cryptic
|
|
161
|
+
|
|
162
|
+
lazyAss(2 + 2 === 5);
|
|
163
|
+
// Error
|
|
164
|
+
|
|
165
|
+
We usually get around this by giving at least one additional message argument to
|
|
166
|
+
explain the condition tested
|
|
167
|
+
|
|
168
|
+
lazyAss(2 + 2 === 5, 'addition')
|
|
169
|
+
// Error: addition
|
|
170
|
+
|
|
171
|
+
*lazyAss* has a better solution: if you give a function that evaluates the condition
|
|
172
|
+
expression, if the function returns false, the error message will include the source
|
|
173
|
+
of the function, making the extra arguments unnecessary
|
|
174
|
+
|
|
175
|
+
lazyAss(function () { return 2 + 2 === 5; });
|
|
176
|
+
// Error: function () { return 2 + 2 === 5; }
|
|
177
|
+
|
|
178
|
+
The condition function has access to any variables in the scope, making it extremely
|
|
179
|
+
powerful
|
|
180
|
+
|
|
181
|
+
var foo = 2, bar = 2;
|
|
182
|
+
lazyAss(function () { return foo + bar === 5; });
|
|
183
|
+
// Error: function () { return foo + bar === 5; }
|
|
184
|
+
|
|
185
|
+
In practical terms, I recommend using separate predicates function and
|
|
186
|
+
passing relevant values to the *lazyAss* function. Remember, there is no performance
|
|
187
|
+
penalty!
|
|
188
|
+
|
|
189
|
+
var foo = 2, bar = 2;
|
|
190
|
+
function isValidPair() {
|
|
191
|
+
return foo + bar === 5;
|
|
192
|
+
}
|
|
193
|
+
lazyAss(isValidPair, 'foo', foo, 'bar', bar);
|
|
194
|
+
// Error: function isValidPair() {
|
|
195
|
+
// return foo + bar === 5;
|
|
196
|
+
// } foo 2 bar 2
|
|
197
|
+
|
|
198
|
+
## Testing
|
|
199
|
+
|
|
200
|
+
This library is fully tested under Node and inside browser environment (CasperJs).
|
|
201
|
+
I described how one can test asynchronous assertion throwing in your own projects
|
|
202
|
+
using Jasmine in [a blog post](http://glebbahmutov.com/blog/testing-async-lazy-assertion/).
|
|
203
|
+
|
|
204
|
+
## TypeScript
|
|
205
|
+
|
|
206
|
+
If you use this function from a TypeScript project, we provide ambient type
|
|
207
|
+
definition file. Because this is CommonJS library, use it like this
|
|
208
|
+
|
|
209
|
+
```ts
|
|
210
|
+
import la = require('lazy-ass')
|
|
211
|
+
// la should have type signature
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
### Small print
|
|
215
|
+
|
|
216
|
+
Author: Gleb Bahmutov © 2014
|
|
217
|
+
|
|
218
|
+
* [@bahmutov](https://twitter.com/bahmutov)
|
|
219
|
+
* [glebbahmutov.com](http://glebbahmutov.com)
|
|
220
|
+
* [blog](http://glebbahmutov.com/blog)
|
|
221
|
+
|
|
222
|
+
License: MIT - do anything with the code, but don't blame me if it does not work.
|
|
223
|
+
|
|
224
|
+
Spread the word: tweet, star on github, etc.
|
|
225
|
+
|
|
226
|
+
Support: if you find any problems with this module, email / tweet /
|
|
227
|
+
[open issue](https://github.com/bahmutov/lazy-ass/issues) on Github
|
|
228
|
+
|
|
229
|
+
## MIT License
|
|
230
|
+
|
|
231
|
+
Copyright (c) 2014 Gleb Bahmutov
|
|
232
|
+
|
|
233
|
+
Permission is hereby granted, free of charge, to any person
|
|
234
|
+
obtaining a copy of this software and associated documentation
|
|
235
|
+
files (the "Software"), to deal in the Software without
|
|
236
|
+
restriction, including without limitation the rights to use,
|
|
237
|
+
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
238
|
+
copies of the Software, and to permit persons to whom the
|
|
239
|
+
Software is furnished to do so, subject to the following
|
|
240
|
+
conditions:
|
|
241
|
+
|
|
242
|
+
The above copyright notice and this permission notice shall be
|
|
243
|
+
included in all copies or substantial portions of the Software.
|
|
244
|
+
|
|
245
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
246
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
247
|
+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
248
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
249
|
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
250
|
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
251
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
252
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
|
253
|
+
|
|
254
|
+
[lazy-ass-icon]: https://nodei.co/npm/lazy-ass.svg?downloads=true
|
|
255
|
+
[lazy-ass-url]: https://npmjs.org/package/lazy-ass
|
|
256
|
+
[lazy-ass-ci-image]: https://travis-ci.org/bahmutov/lazy-ass.svg?branch=master
|
|
257
|
+
[lazy-ass-ci-url]: https://travis-ci.org/bahmutov/lazy-ass
|
|
258
|
+
[lazy-ass-coverage-image]: https://coveralls.io/repos/bahmutov/lazy-ass/badge.svg
|
|
259
|
+
[lazy-ass-coverage-url]: https://coveralls.io/r/bahmutov/lazy-ass
|
|
260
|
+
[lazy-ass-code-climate-image]: https://codeclimate.com/github/bahmutov/lazy-ass/badges/gpa.svg
|
|
261
|
+
[lazy-ass-code-climate-url]: https://codeclimate.com/github/bahmutov/lazy-ass
|
|
262
|
+
[lazy-ass-codacy-image]: https://www.codacy.com/project/badge/b60a0810c9af4fe4b2ae685932dbbdb8
|
|
263
|
+
[lazy-ass-codacy-url]: https://www.codacy.com/public/bahmutov/lazy-ass.git
|
|
264
|
+
[lazy-ass-dependencies-image]: https://david-dm.org/bahmutov/lazy-ass.svg
|
|
265
|
+
[lazy-ass-dependencies-url]: https://david-dm.org/bahmutov/lazy-ass
|
|
266
|
+
[lazy-ass-devdependencies-image]: https://david-dm.org/bahmutov/lazy-ass/dev-status.svg
|
|
267
|
+
[lazy-ass-devdependencies-url]: https://david-dm.org/bahmutov/lazy-ass#info=devDependencies
|
|
268
|
+
[semantic-image]: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg
|
|
269
|
+
[semantic-url]: https://github.com/semantic-release/semantic-release
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# listr2
|
|
2
|
+
|
|
3
|
+
[](https://drone.kilic.dev/cenk1cenk2/listr2) [](https://npmjs.org/package/listr2) [](https://npmjs.org/package/listr2) [](https://codecov.io/gh/cenk1cenk2/listr2) [](https://npmjs.org/package/listr2) [](https://github.com/semantic-release/semantic-release)
|
|
4
|
+
|
|
5
|
+
**Create beautiful CLI interfaces via easy and logical to implement task lists that feel alive and interactive.**
|
|
6
|
+
|
|
7
|
+

|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Documentation
|
|
12
|
+
|
|
13
|
+
**[Read the documentation...](https://listr2.kilic.dev)**
|
|
14
|
+
|
|
15
|
+
# API Endpoints
|
|
16
|
+
|
|
17
|
+
**All the endpoints can be found [here](./docs/README.md).**
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# lodash v4.17.21
|
|
2
|
+
|
|
3
|
+
The [Lodash](https://lodash.com/) library exported as [Node.js](https://nodejs.org/) modules.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Using npm:
|
|
8
|
+
```shell
|
|
9
|
+
$ npm i -g npm
|
|
10
|
+
$ npm i --save lodash
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
In Node.js:
|
|
14
|
+
```js
|
|
15
|
+
// Load the full build.
|
|
16
|
+
var _ = require('lodash');
|
|
17
|
+
// Load the core build.
|
|
18
|
+
var _ = require('lodash/core');
|
|
19
|
+
// Load the FP build for immutable auto-curried iteratee-first data-last methods.
|
|
20
|
+
var fp = require('lodash/fp');
|
|
21
|
+
|
|
22
|
+
// Load method categories.
|
|
23
|
+
var array = require('lodash/array');
|
|
24
|
+
var object = require('lodash/fp/object');
|
|
25
|
+
|
|
26
|
+
// Cherry-pick methods for smaller browserify/rollup/webpack bundles.
|
|
27
|
+
var at = require('lodash/at');
|
|
28
|
+
var curryN = require('lodash/fp/curryN');
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
See the [package source](https://github.com/lodash/lodash/tree/4.17.21-npm) for more details.
|
|
32
|
+
|
|
33
|
+
**Note:**<br>
|
|
34
|
+
Install [n_](https://www.npmjs.com/package/n_) for Lodash use in the Node.js < 6 REPL.
|
|
35
|
+
|
|
36
|
+
## Support
|
|
37
|
+
|
|
38
|
+
Tested in Chrome 74-75, Firefox 66-67, IE 11, Edge 18, Safari 11-12, & Node.js 8-12.<br>
|
|
39
|
+
Automated [browser](https://saucelabs.com/u/lodash) & [CI](https://travis-ci.org/lodash/lodash/) test runs are available.
|