@valkyriestudios/utils 8.0.0 → 8.2.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/CHANGELOG.md +12 -0
- package/README.md +2 -2
- package/deep/get.js +1 -1
- package/deep/set.js +1 -1
- package/package.json +4 -5
- package/src/array/{dedupe.js → dedupe.mjs} +1 -1
- package/src/array/{join.js → join.mjs} +3 -3
- package/src/array/{mapFn.js → mapFn.mjs} +3 -3
- package/src/array/{mapKey.js → mapKey.mjs} +2 -2
- package/src/array/{mapPrimitive.js → mapPrimitive.mjs} +2 -2
- package/src/array/{sort.js → sort.mjs} +5 -5
- package/src/caching/{memoize.js → memoize.mjs} +1 -1
- package/src/date/{addUTC.js → addUTC.mjs} +1 -1
- package/src/date/{diff.js → diff.mjs} +1 -1
- package/src/date/{endOfUTC.js → endOfUTC.mjs} +1 -1
- package/src/date/{startOfUTC.js → startOfUTC.mjs} +1 -1
- package/src/deep/{define.js → define.mjs} +1 -1
- package/src/deep/{freeze.js → freeze.mjs} +1 -1
- package/src/deep/{get.js → get.mjs} +7 -3
- package/src/deep/{seal.js → seal.mjs} +1 -1
- package/src/deep/{set.js → set.mjs} +7 -3
- package/src/{equal.js → equal.mjs} +3 -3
- package/src/hash/{fnv1A.js → fnv1A.mjs} +4 -4
- package/src/{is.js → is.mjs} +21 -21
- package/src/number/{toPercentage.js → toPercentage.mjs} +1 -1
- package/src/object/{define.js → define.mjs} +1 -1
- package/src/object/{isNotEmpty.js → isNotEmpty.mjs} +1 -1
- package/src/object/{merge.js → merge.mjs} +1 -1
- package/src/object/{pick.js → pick.mjs} +4 -4
- package/src/regexp/{sanitize.js → sanitize.mjs} +1 -1
- package/src/string/{humanizeBytes.js → humanizeBytes.mjs} +4 -4
- package/src/string/{humanizeNumber.js → humanizeNumber.mjs} +5 -5
- package/src/string/{isBetween.js → isBetween.mjs} +1 -1
- package/src/string/{shorten.js → shorten.mjs} +2 -2
- /package/src/array/{is.js → is.mjs} +0 -0
- /package/src/array/{isNotEmpty.js → isNotEmpty.mjs} +0 -0
- /package/src/array/{shuffle.js → shuffle.mjs} +0 -0
- /package/src/boolean/{is.js → is.mjs} +0 -0
- /package/src/date/{is.js → is.mjs} +0 -0
- /package/src/date/{nowUnix.js → nowUnix.mjs} +0 -0
- /package/src/date/{nowUnixMs.js → nowUnixMs.mjs} +0 -0
- /package/src/date/{toUTC.js → toUTC.mjs} +0 -0
- /package/src/date/{toUnix.js → toUnix.mjs} +0 -0
- /package/src/function/{is.js → is.mjs} +0 -0
- /package/src/function/{noop.js → noop.mjs} +0 -0
- /package/src/function/{noopresolve.js → noopresolve.mjs} +0 -0
- /package/src/function/{noopreturn.js → noopreturn.mjs} +0 -0
- /package/src/function/{sleep.js → sleep.mjs} +0 -0
- /package/src/hash/{guid.js → guid.mjs} +0 -0
- /package/src/number/{is.js → is.mjs} +0 -0
- /package/src/number/{isAbove.js → isAbove.mjs} +0 -0
- /package/src/number/{isAboveOrEqual.js → isAboveOrEqual.mjs} +0 -0
- /package/src/number/{isBelow.js → isBelow.mjs} +0 -0
- /package/src/number/{isBelowOrEqual.js → isBelowOrEqual.mjs} +0 -0
- /package/src/number/{isBetween.js → isBetween.mjs} +0 -0
- /package/src/number/{isInteger.js → isInteger.mjs} +0 -0
- /package/src/number/{isIntegerAbove.js → isIntegerAbove.mjs} +0 -0
- /package/src/number/{isIntegerAboveOrEqual.js → isIntegerAboveOrEqual.mjs} +0 -0
- /package/src/number/{isIntegerBelow.js → isIntegerBelow.mjs} +0 -0
- /package/src/number/{isIntegerBelowOrEqual.js → isIntegerBelowOrEqual.mjs} +0 -0
- /package/src/number/{isIntegerBetween.js → isIntegerBetween.mjs} +0 -0
- /package/src/number/{isNumericalNaN.js → isNumericalNaN.mjs} +0 -0
- /package/src/number/{randomBetween.js → randomBetween.mjs} +0 -0
- /package/src/number/{randomIntBetween.js → randomIntBetween.mjs} +0 -0
- /package/src/number/{round.js → round.mjs} +0 -0
- /package/src/object/{is.js → is.mjs} +0 -0
- /package/src/regexp/{is.js → is.mjs} +0 -0
- /package/src/string/{is.js → is.mjs} +0 -0
- /package/src/string/{isNotEmpty.js → isNotEmpty.mjs} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,18 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic
|
|
6
6
|
Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [8.2.0] - 2023-11-29
|
|
9
|
+
### Improved
|
|
10
|
+
- Dev Dep: Upgrade @babel/core to 7.23.5
|
|
11
|
+
- Dev Dep: Upgrade @babel/preset-env to 7.23.5
|
|
12
|
+
- deep/get: Allow handling of deep keys containing multiple array denominators
|
|
13
|
+
- deep/set: Allow handling of deep keys containing multiple array denominators
|
|
14
|
+
|
|
15
|
+
## [8.1.0] - 2023-11-29
|
|
16
|
+
### Improved
|
|
17
|
+
- Reverted module type change that caused breakage due to esm vs cjs compatibility
|
|
18
|
+
- Adjusted src files and test files to work with .mjs extension
|
|
19
|
+
|
|
8
20
|
## [8.0.0] - 2023-11-29
|
|
9
21
|
### Added
|
|
10
22
|
- Dev: Dep: c8\@8.0.1
|
package/README.md
CHANGED
|
@@ -305,7 +305,7 @@ Returns the current unix timestamp in seconds
|
|
|
305
305
|
Returns the current unix timestamp in milliseconds
|
|
306
306
|
|
|
307
307
|
- **startOfUTC(val:Date, key:String)**
|
|
308
|
-
Take the incoming date and return a date set to the start of passed key. Possible key options(year,quarter,month,week,week_sun,day,hour,minute,second).
|
|
308
|
+
Take the incoming date and return a date set to the start of passed key. Possible key options(year,quarter,month,week,week_sun,week_mon,week_tue,week_wed,week_thu,week_fri,week_sat,day,hour,minute,second).
|
|
309
309
|
|
|
310
310
|
Note: Does not touch the date object passed
|
|
311
311
|
```js
|
|
@@ -325,7 +325,7 @@ startOfUTC(new Date("2023-05-04T12:04:27.043+02:00"), 'second'); // new Date("20
|
|
|
325
325
|
```
|
|
326
326
|
|
|
327
327
|
- **endOfUTC(val:Date, key:String)**
|
|
328
|
-
Take the incoming date and return a date set to the end of passed key. Possible key options(year,quarter,month,week,week_sun,day,hour,minute,second).
|
|
328
|
+
Take the incoming date and return a date set to the end of passed key. Possible key options(year,quarter,month,week,week_sun,week_mon,week_tue,week_wed,week_thu,week_fri,week_sat,day,hour,minute,second).
|
|
329
329
|
|
|
330
330
|
Note: Does not touch the date object passed
|
|
331
331
|
```js
|
package/deep/get.js
CHANGED
|
@@ -11,7 +11,7 @@ function deepGet(obj, path) {
|
|
|
11
11
|
var get_parent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
|
12
12
|
if (Object.prototype.toString.call(obj) !== _is.PROTO_OBJ && !Array.isArray(obj)) throw new TypeError('Deepget is only supported for objects');
|
|
13
13
|
if (!(0, _isNotEmpty["default"])(path)) throw new TypeError('No path was given');
|
|
14
|
-
var parts = path.replace(
|
|
14
|
+
var parts = path.replace(/\[/g, '.').replace(/(\.){2,}/g, '.').replace(/(^\.|\.$|\])/g, '').split('.');
|
|
15
15
|
if (parts.length === 0 || parts.length === 1 && get_parent) return obj;
|
|
16
16
|
if (get_parent) parts.pop();
|
|
17
17
|
var cursor = obj;
|
package/deep/set.js
CHANGED
|
@@ -12,7 +12,7 @@ function deepSet(obj, path) {
|
|
|
12
12
|
var define = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
|
13
13
|
if (Object.prototype.toString.call(obj) !== _is.PROTO_OBJ && !Array.isArray(obj)) throw new TypeError('Deepset is only supported for objects');
|
|
14
14
|
if (!(0, _isNotEmpty["default"])(path)) throw new TypeError('No path was given');
|
|
15
|
-
var parts = path.replace(
|
|
15
|
+
var parts = path.replace(/\[/g, '.').replace(/(\.){2,}/g, '.').replace(/(^\.|\.$|\])/g, '').split('.');
|
|
16
16
|
for (var i = 0; i < parts.length - 1; i++) {
|
|
17
17
|
if (parts[i] === '') continue;
|
|
18
18
|
if (!obj[parts[i]]) obj[parts[i]] = {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@valkyriestudios/utils",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.2.0",
|
|
4
4
|
"description": "A collection of single-function utilities for common tasks",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": {
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
"email": "contact@valkyriestudios.com",
|
|
9
9
|
"url": "www.valkyriestudios.be"
|
|
10
10
|
},
|
|
11
|
-
"type": "module",
|
|
12
11
|
"keywords": [
|
|
13
12
|
"utility",
|
|
14
13
|
"library",
|
|
@@ -24,7 +23,7 @@
|
|
|
24
23
|
"lint": "npm run lint:src && npm run lint:test",
|
|
25
24
|
"lint:src": "./node_modules/.bin/eslint --ext .js,.mjs ./src",
|
|
26
25
|
"lint:test": "./node_modules/.bin/eslint --ext .js,.mjs ./test",
|
|
27
|
-
"build": "npm run lint && npm run test:coverage && npx babel src --out-dir ./",
|
|
26
|
+
"build": "npm run lint && npm run test:coverage && rm -rf ./dist && mkdir ./dist && npx babel src --out-dir ./dist && sh ./adjust_esm_to_cjs.sh && mv -f ./dist/* ./ && rm -rf ./dist",
|
|
28
27
|
"codecov": "codecov"
|
|
29
28
|
},
|
|
30
29
|
"repository": {
|
|
@@ -37,8 +36,8 @@
|
|
|
37
36
|
"homepage": "https://github.com/ValkyrieStudios/utils#readme",
|
|
38
37
|
"devDependencies": {
|
|
39
38
|
"@babel/cli": "^7.23.4",
|
|
40
|
-
"@babel/core": "^7.23.
|
|
41
|
-
"@babel/preset-env": "^7.23.
|
|
39
|
+
"@babel/core": "^7.23.5",
|
|
40
|
+
"@babel/preset-env": "^7.23.5",
|
|
42
41
|
"@babel/register": "^7.22.15",
|
|
43
42
|
"babel-plugin-transform-minify-booleans": "^6.9.4",
|
|
44
43
|
"babel-plugin-transform-remove-console": "^6.9.4",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
import isNotEmptyString from '../string/isNotEmpty.
|
|
4
|
-
import isNotEmptyObject from '../object/isNotEmpty.
|
|
5
|
-
import round from '../number/round.
|
|
3
|
+
import isNotEmptyString from '../string/isNotEmpty.mjs';
|
|
4
|
+
import isNotEmptyObject from '../object/isNotEmpty.mjs';
|
|
5
|
+
import round from '../number/round.mjs';
|
|
6
6
|
|
|
7
7
|
// Join an array of values while autofiltering any non-string/non-number elements
|
|
8
8
|
//
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
import isFunction from '../function/is.
|
|
4
|
-
import isNotEmptyString from '../string/isNotEmpty.
|
|
5
|
-
import {PROTO_OBJ} from '../object/is.
|
|
3
|
+
import isFunction from '../function/is.mjs';
|
|
4
|
+
import isNotEmptyString from '../string/isNotEmpty.mjs';
|
|
5
|
+
import {PROTO_OBJ} from '../object/is.mjs';
|
|
6
6
|
|
|
7
7
|
export default function mapFn (arr, fn, opts = {}) {
|
|
8
8
|
if (
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
import isNotEmptyString from '../string/isNotEmpty.
|
|
4
|
-
import {PROTO_OBJ} from '../object/is.
|
|
3
|
+
import isNotEmptyString from '../string/isNotEmpty.mjs';
|
|
4
|
+
import {PROTO_OBJ} from '../object/is.mjs';
|
|
5
5
|
|
|
6
6
|
export default function mapKey (arr, key, opts = {}) {
|
|
7
7
|
if (
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
import isNotEmptyString from '../string/isNotEmpty.
|
|
4
|
-
import isNotEmptyObject from '../object/isNotEmpty.
|
|
3
|
+
import isNotEmptyString from '../string/isNotEmpty.mjs';
|
|
4
|
+
import isNotEmptyObject from '../object/isNotEmpty.mjs';
|
|
5
5
|
|
|
6
6
|
export default function mapPrimitive (arr, opts = {}) {
|
|
7
7
|
if (!Array.isArray(arr) || arr.length === 0) return {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
import isBoolean from '../boolean/is.
|
|
4
|
-
import isNotEmptyObject from '../object/isNotEmpty.
|
|
5
|
-
import {PROTO_OBJ} from '../object/is.
|
|
6
|
-
import isNotEmptyString from '../string/isNotEmpty.
|
|
7
|
-
import isFunction from '../function/is.
|
|
3
|
+
import isBoolean from '../boolean/is.mjs';
|
|
4
|
+
import isNotEmptyObject from '../object/isNotEmpty.mjs';
|
|
5
|
+
import {PROTO_OBJ} from '../object/is.mjs';
|
|
6
|
+
import isNotEmptyString from '../string/isNotEmpty.mjs';
|
|
7
|
+
import isFunction from '../function/is.mjs';
|
|
8
8
|
|
|
9
9
|
function partition (arr, start_ix, end_ix) {
|
|
10
10
|
const pivot_val = arr[Math.floor((start_ix + end_ix) / 2)].t;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
import isNotEmptyString from '../string/isNotEmpty.
|
|
3
|
+
import isNotEmptyString from '../string/isNotEmpty.mjs';
|
|
4
4
|
|
|
5
5
|
// Take note: this is the end of week key for weeks starting on key,
|
|
6
6
|
// eg: end of week for week_mon is sunday as the week starts on monday and ends on sunday
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
import isNotEmptyString from '../string/isNotEmpty.
|
|
4
|
-
import {PROTO_OBJ} from '../object/is.
|
|
3
|
+
import isNotEmptyString from '../string/isNotEmpty.mjs';
|
|
4
|
+
import {PROTO_OBJ} from '../object/is.mjs';
|
|
5
5
|
|
|
6
6
|
// Get a value from a path in a json-like structure
|
|
7
7
|
export default function deepGet (obj, path, get_parent = false) {
|
|
@@ -14,7 +14,11 @@ export default function deepGet (obj, path, get_parent = false) {
|
|
|
14
14
|
if (!isNotEmptyString(path)) throw new TypeError('No path was given');
|
|
15
15
|
|
|
16
16
|
// Cleanup paths : a.b[2].c --> ['a', 'b', '2', 'c'] (faster processing)
|
|
17
|
-
const parts = path
|
|
17
|
+
const parts = path
|
|
18
|
+
.replace(/\[/g, '.')
|
|
19
|
+
.replace(/(\.){2,}/g, '.')
|
|
20
|
+
.replace(/(^\.|\.$|\])/g, '')
|
|
21
|
+
.split('.');
|
|
18
22
|
|
|
19
23
|
// Return obj if no parts were passed or if only 1 part and get_parent is true
|
|
20
24
|
if (parts.length === 0 || (parts.length === 1 && get_parent)) return obj;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
import isNotEmptyString from '../string/isNotEmpty.
|
|
4
|
-
import {PROTO_OBJ} from '../object/is.
|
|
3
|
+
import isNotEmptyString from '../string/isNotEmpty.mjs';
|
|
4
|
+
import {PROTO_OBJ} from '../object/is.mjs';
|
|
5
5
|
|
|
6
6
|
// Set a value for a path in a json-like structure
|
|
7
7
|
export default function deepSet (obj, path, value = null, define = false) {
|
|
@@ -14,7 +14,11 @@ export default function deepSet (obj, path, value = null, define = false) {
|
|
|
14
14
|
if (!isNotEmptyString(path)) throw new TypeError('No path was given');
|
|
15
15
|
|
|
16
16
|
// Cleanup paths : a.b[2].c --> ['a', 'b', '2', 'c'] (faster processing)
|
|
17
|
-
const parts = path
|
|
17
|
+
const parts = path
|
|
18
|
+
.replace(/\[/g, '.')
|
|
19
|
+
.replace(/(\.){2,}/g, '.')
|
|
20
|
+
.replace(/(^\.|\.$|\])/g, '')
|
|
21
|
+
.split('.');
|
|
18
22
|
|
|
19
23
|
// Build any unknown paths and set cursor
|
|
20
24
|
for (let i = 0; i < parts.length - 1; i++) {
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
/* eslint-disable no-use-before-define */
|
|
4
4
|
|
|
5
|
-
import isNumericalNaN from './number/isNumericalNaN.
|
|
6
|
-
import {PROTO_RGX} from './regexp/is.
|
|
7
|
-
import {PROTO_OBJ} from './object/is.
|
|
5
|
+
import isNumericalNaN from './number/isNumericalNaN.mjs';
|
|
6
|
+
import {PROTO_RGX} from './regexp/is.mjs';
|
|
7
|
+
import {PROTO_OBJ} from './object/is.mjs';
|
|
8
8
|
|
|
9
9
|
function isArrayEqual (a, b) {
|
|
10
10
|
if (a.length !== b.length) return false;
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
/* eslint-disable no-bitwise */
|
|
4
4
|
|
|
5
|
-
import isString from '../string/is.
|
|
6
|
-
import isNumericalNaN from '../number/isNumericalNaN.
|
|
7
|
-
import {PROTO_RGX} from '../regexp/is.
|
|
8
|
-
import {PROTO_OBJ} from '../object/is.
|
|
5
|
+
import isString from '../string/is.mjs';
|
|
6
|
+
import isNumericalNaN from '../number/isNumericalNaN.mjs';
|
|
7
|
+
import {PROTO_RGX} from '../regexp/is.mjs';
|
|
8
|
+
import {PROTO_OBJ} from '../object/is.mjs';
|
|
9
9
|
|
|
10
10
|
// https://tools.ietf.org/html/draft-eastlake-fnv-03
|
|
11
11
|
|
package/src/{is.js → is.mjs}
RENAMED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
import equal from './equal.
|
|
4
|
-
import isNotEmptyArray from './array/isNotEmpty.
|
|
5
|
-
import isBoolean from './boolean/is.
|
|
6
|
-
import isDate from './date/is.
|
|
7
|
-
import isFunction from './function/is.
|
|
8
|
-
import isNumberBetween from './number/isBetween.
|
|
9
|
-
import isNumberBelow from './number/isBelow.
|
|
10
|
-
import isNumberBelowOrEqual from './number/isBelowOrEqual.
|
|
11
|
-
import isNumberAbove from './number/isAbove.
|
|
12
|
-
import isNumberAboveOrEqual from './number/isAboveOrEqual.
|
|
13
|
-
import isIntegerBetween from './number/isIntegerBetween.
|
|
14
|
-
import isIntegerBelow from './number/isIntegerBelow.
|
|
15
|
-
import isIntegerBelowOrEqual from './number/isIntegerBelowOrEqual.
|
|
16
|
-
import isIntegerAbove from './number/isIntegerAbove.
|
|
17
|
-
import isIntegerAboveOrEqual from './number/isIntegerAboveOrEqual.
|
|
18
|
-
import isRegExp from './regexp/is.
|
|
19
|
-
import isObject from './object/is.
|
|
20
|
-
import isNotEmptyObject from './object/isNotEmpty.
|
|
21
|
-
import isString from './string/is.
|
|
22
|
-
import isStringBetween from './string/isBetween.
|
|
23
|
-
import isNotEmptyString from './string/isNotEmpty.
|
|
3
|
+
import equal from './equal.mjs';
|
|
4
|
+
import isNotEmptyArray from './array/isNotEmpty.mjs';
|
|
5
|
+
import isBoolean from './boolean/is.mjs';
|
|
6
|
+
import isDate from './date/is.mjs';
|
|
7
|
+
import isFunction from './function/is.mjs';
|
|
8
|
+
import isNumberBetween from './number/isBetween.mjs';
|
|
9
|
+
import isNumberBelow from './number/isBelow.mjs';
|
|
10
|
+
import isNumberBelowOrEqual from './number/isBelowOrEqual.mjs';
|
|
11
|
+
import isNumberAbove from './number/isAbove.mjs';
|
|
12
|
+
import isNumberAboveOrEqual from './number/isAboveOrEqual.mjs';
|
|
13
|
+
import isIntegerBetween from './number/isIntegerBetween.mjs';
|
|
14
|
+
import isIntegerBelow from './number/isIntegerBelow.mjs';
|
|
15
|
+
import isIntegerBelowOrEqual from './number/isIntegerBelowOrEqual.mjs';
|
|
16
|
+
import isIntegerAbove from './number/isIntegerAbove.mjs';
|
|
17
|
+
import isIntegerAboveOrEqual from './number/isIntegerAboveOrEqual.mjs';
|
|
18
|
+
import isRegExp from './regexp/is.mjs';
|
|
19
|
+
import isObject from './object/is.mjs';
|
|
20
|
+
import isNotEmptyObject from './object/isNotEmpty.mjs';
|
|
21
|
+
import isString from './string/is.mjs';
|
|
22
|
+
import isStringBetween from './string/isBetween.mjs';
|
|
23
|
+
import isNotEmptyString from './string/isNotEmpty.mjs';
|
|
24
24
|
|
|
25
25
|
const Is = Object.freeze(Object.defineProperties(Object.create(null), {
|
|
26
26
|
// Array -----------------------------------------------------------------------------------------------
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
import deepGet from '../deep/get.
|
|
4
|
-
import deepSet from '../deep/set.
|
|
5
|
-
import isNotEmptyString from '../string/isNotEmpty.
|
|
6
|
-
import {PROTO_OBJ} from './is.
|
|
3
|
+
import deepGet from '../deep/get.mjs';
|
|
4
|
+
import deepSet from '../deep/set.mjs';
|
|
5
|
+
import isNotEmptyString from '../string/isNotEmpty.mjs';
|
|
6
|
+
import {PROTO_OBJ} from './is.mjs';
|
|
7
7
|
|
|
8
8
|
export default function pick (obj, keys) {
|
|
9
9
|
if (
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
import isNotEmptyString from '../string/isNotEmpty.
|
|
3
|
+
import isNotEmptyString from '../string/isNotEmpty.mjs';
|
|
4
4
|
|
|
5
5
|
// Escapes a value to be used inside of a regular expression (eg: new RegExp(...))
|
|
6
6
|
// For more info: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#Escaping
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
import isString from '../string/is.
|
|
4
|
-
import isNotEmptyString from '../string/isNotEmpty.
|
|
5
|
-
import {PROTO_OBJ} from '../object/is.
|
|
6
|
-
import humanizeNumber from './humanizeNumber.
|
|
3
|
+
import isString from '../string/is.mjs';
|
|
4
|
+
import isNotEmptyString from '../string/isNotEmpty.mjs';
|
|
5
|
+
import {PROTO_OBJ} from '../object/is.mjs';
|
|
6
|
+
import humanizeNumber from './humanizeNumber.mjs';
|
|
7
7
|
|
|
8
8
|
// Humanize a numerical byte value into a readable file size
|
|
9
9
|
//
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
import isBoolean from '../boolean/is.
|
|
4
|
-
import isString from '../string/is.
|
|
5
|
-
import isNotEmptyString from '../string/isNotEmpty.
|
|
6
|
-
import round from '../number/round.
|
|
7
|
-
import {PROTO_OBJ} from '../object/is.
|
|
3
|
+
import isBoolean from '../boolean/is.mjs';
|
|
4
|
+
import isString from '../string/is.mjs';
|
|
5
|
+
import isNotEmptyString from '../string/isNotEmpty.mjs';
|
|
6
|
+
import round from '../number/round.mjs';
|
|
7
|
+
import {PROTO_OBJ} from '../object/is.mjs';
|
|
8
8
|
|
|
9
9
|
// Humanize a numerical value into a unit base
|
|
10
10
|
//
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
import isString from './is.
|
|
4
|
-
import isNumberAbove from '../number/isAbove.
|
|
3
|
+
import isString from './is.mjs';
|
|
4
|
+
import isNumberAbove from '../number/isAbove.mjs';
|
|
5
5
|
|
|
6
6
|
// Shorten a string and add a postfix if it goes over a specific length, will autotrim value
|
|
7
7
|
//
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|