@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.
Files changed (69) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +2 -2
  3. package/deep/get.js +1 -1
  4. package/deep/set.js +1 -1
  5. package/package.json +4 -5
  6. package/src/array/{dedupe.js → dedupe.mjs} +1 -1
  7. package/src/array/{join.js → join.mjs} +3 -3
  8. package/src/array/{mapFn.js → mapFn.mjs} +3 -3
  9. package/src/array/{mapKey.js → mapKey.mjs} +2 -2
  10. package/src/array/{mapPrimitive.js → mapPrimitive.mjs} +2 -2
  11. package/src/array/{sort.js → sort.mjs} +5 -5
  12. package/src/caching/{memoize.js → memoize.mjs} +1 -1
  13. package/src/date/{addUTC.js → addUTC.mjs} +1 -1
  14. package/src/date/{diff.js → diff.mjs} +1 -1
  15. package/src/date/{endOfUTC.js → endOfUTC.mjs} +1 -1
  16. package/src/date/{startOfUTC.js → startOfUTC.mjs} +1 -1
  17. package/src/deep/{define.js → define.mjs} +1 -1
  18. package/src/deep/{freeze.js → freeze.mjs} +1 -1
  19. package/src/deep/{get.js → get.mjs} +7 -3
  20. package/src/deep/{seal.js → seal.mjs} +1 -1
  21. package/src/deep/{set.js → set.mjs} +7 -3
  22. package/src/{equal.js → equal.mjs} +3 -3
  23. package/src/hash/{fnv1A.js → fnv1A.mjs} +4 -4
  24. package/src/{is.js → is.mjs} +21 -21
  25. package/src/number/{toPercentage.js → toPercentage.mjs} +1 -1
  26. package/src/object/{define.js → define.mjs} +1 -1
  27. package/src/object/{isNotEmpty.js → isNotEmpty.mjs} +1 -1
  28. package/src/object/{merge.js → merge.mjs} +1 -1
  29. package/src/object/{pick.js → pick.mjs} +4 -4
  30. package/src/regexp/{sanitize.js → sanitize.mjs} +1 -1
  31. package/src/string/{humanizeBytes.js → humanizeBytes.mjs} +4 -4
  32. package/src/string/{humanizeNumber.js → humanizeNumber.mjs} +5 -5
  33. package/src/string/{isBetween.js → isBetween.mjs} +1 -1
  34. package/src/string/{shorten.js → shorten.mjs} +2 -2
  35. /package/src/array/{is.js → is.mjs} +0 -0
  36. /package/src/array/{isNotEmpty.js → isNotEmpty.mjs} +0 -0
  37. /package/src/array/{shuffle.js → shuffle.mjs} +0 -0
  38. /package/src/boolean/{is.js → is.mjs} +0 -0
  39. /package/src/date/{is.js → is.mjs} +0 -0
  40. /package/src/date/{nowUnix.js → nowUnix.mjs} +0 -0
  41. /package/src/date/{nowUnixMs.js → nowUnixMs.mjs} +0 -0
  42. /package/src/date/{toUTC.js → toUTC.mjs} +0 -0
  43. /package/src/date/{toUnix.js → toUnix.mjs} +0 -0
  44. /package/src/function/{is.js → is.mjs} +0 -0
  45. /package/src/function/{noop.js → noop.mjs} +0 -0
  46. /package/src/function/{noopresolve.js → noopresolve.mjs} +0 -0
  47. /package/src/function/{noopreturn.js → noopreturn.mjs} +0 -0
  48. /package/src/function/{sleep.js → sleep.mjs} +0 -0
  49. /package/src/hash/{guid.js → guid.mjs} +0 -0
  50. /package/src/number/{is.js → is.mjs} +0 -0
  51. /package/src/number/{isAbove.js → isAbove.mjs} +0 -0
  52. /package/src/number/{isAboveOrEqual.js → isAboveOrEqual.mjs} +0 -0
  53. /package/src/number/{isBelow.js → isBelow.mjs} +0 -0
  54. /package/src/number/{isBelowOrEqual.js → isBelowOrEqual.mjs} +0 -0
  55. /package/src/number/{isBetween.js → isBetween.mjs} +0 -0
  56. /package/src/number/{isInteger.js → isInteger.mjs} +0 -0
  57. /package/src/number/{isIntegerAbove.js → isIntegerAbove.mjs} +0 -0
  58. /package/src/number/{isIntegerAboveOrEqual.js → isIntegerAboveOrEqual.mjs} +0 -0
  59. /package/src/number/{isIntegerBelow.js → isIntegerBelow.mjs} +0 -0
  60. /package/src/number/{isIntegerBelowOrEqual.js → isIntegerBelowOrEqual.mjs} +0 -0
  61. /package/src/number/{isIntegerBetween.js → isIntegerBetween.mjs} +0 -0
  62. /package/src/number/{isNumericalNaN.js → isNumericalNaN.mjs} +0 -0
  63. /package/src/number/{randomBetween.js → randomBetween.mjs} +0 -0
  64. /package/src/number/{randomIntBetween.js → randomIntBetween.mjs} +0 -0
  65. /package/src/number/{round.js → round.mjs} +0 -0
  66. /package/src/object/{is.js → is.mjs} +0 -0
  67. /package/src/regexp/{is.js → is.mjs} +0 -0
  68. /package/src/string/{is.js → is.mjs} +0 -0
  69. /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('[', '.').replace(']', '').split('.');
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('[', '.').replace(']', '').split('.');
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.0.0",
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.2",
41
- "@babel/preset-env": "^7.23.2",
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,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- import fnv1A from '../hash/fnv1A.js';
3
+ import fnv1A from '../hash/fnv1A.mjs';
4
4
 
5
5
  export default function dedupe (val) {
6
6
  if (!Array.isArray(val) || val.length === 0) return [];
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- import isNotEmptyString from '../string/isNotEmpty.js';
4
- import isNotEmptyObject from '../object/isNotEmpty.js';
5
- import round from '../number/round.js';
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.js';
4
- import isNotEmptyString from '../string/isNotEmpty.js';
5
- import {PROTO_OBJ} from '../object/is.js';
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.js';
4
- import {PROTO_OBJ} from '../object/is.js';
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.js';
4
- import isNotEmptyObject from '../object/isNotEmpty.js';
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.js';
4
- import isNotEmptyObject from '../object/isNotEmpty.js';
5
- import {PROTO_OBJ} from '../object/is.js';
6
- import isNotEmptyString from '../string/isNotEmpty.js';
7
- import isFunction from '../function/is.js';
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 isFunction from '../function/is.js';
3
+ import isFunction from '../function/is.mjs';
4
4
 
5
5
  export default function memoize (fn, resolver = false) {
6
6
  const has_resolver = isFunction(resolver);
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- import isNotEmptyString from '../string/isNotEmpty.js';
3
+ import isNotEmptyString from '../string/isNotEmpty.mjs';
4
4
 
5
5
  export default function addUTC (val, amount, key) {
6
6
  if (
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- import isNotEmptyString from '../string/isNotEmpty.js';
3
+ import isNotEmptyString from '../string/isNotEmpty.mjs';
4
4
 
5
5
  const SECOND_IN_MILLISECONDS = 1000;
6
6
  const MINUTE_IN_MILLISECONDS = SECOND_IN_MILLISECONDS * 60;
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- import isNotEmptyString from '../string/isNotEmpty.js';
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,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- import isNotEmptyString from '../string/isNotEmpty.js';
3
+ import isNotEmptyString from '../string/isNotEmpty.mjs';
4
4
 
5
5
  const WEEK_START = {
6
6
  week : 1, // Original lib cases only contained week and historical was monday
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- import deepSet from './set.js';
3
+ import deepSet from './set.mjs';
4
4
 
5
5
  export default function deepDefine (obj, path, value = null) {
6
6
  return deepSet(obj, path, value, true);
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- import {PROTO_OBJ} from '../object/is.js';
3
+ import {PROTO_OBJ} from '../object/is.mjs';
4
4
 
5
5
  function deep (obj) {
6
6
  for (const key of Object.keys(obj)) {
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- import isNotEmptyString from '../string/isNotEmpty.js';
4
- import {PROTO_OBJ} from '../object/is.js';
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.replace('[', '.').replace(']', '').split('.');
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,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- import {PROTO_OBJ} from '../object/is.js';
3
+ import {PROTO_OBJ} from '../object/is.mjs';
4
4
 
5
5
  function deep (obj) {
6
6
  for (const key of Object.keys(obj)) {
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- import isNotEmptyString from '../string/isNotEmpty.js';
4
- import {PROTO_OBJ} from '../object/is.js';
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.replace('[', '.').replace(']', '').split('.');
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.js';
6
- import {PROTO_RGX} from './regexp/is.js';
7
- import {PROTO_OBJ} from './object/is.js';
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.js';
6
- import isNumericalNaN from '../number/isNumericalNaN.js';
7
- import {PROTO_RGX} from '../regexp/is.js';
8
- import {PROTO_OBJ} from '../object/is.js';
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
 
@@ -1,26 +1,26 @@
1
1
  'use strict';
2
2
 
3
- import equal from './equal.js';
4
- import isNotEmptyArray from './array/isNotEmpty.js';
5
- import isBoolean from './boolean/is.js';
6
- import isDate from './date/is.js';
7
- import isFunction from './function/is.js';
8
- import isNumberBetween from './number/isBetween.js';
9
- import isNumberBelow from './number/isBelow.js';
10
- import isNumberBelowOrEqual from './number/isBelowOrEqual.js';
11
- import isNumberAbove from './number/isAbove.js';
12
- import isNumberAboveOrEqual from './number/isAboveOrEqual.js';
13
- import isIntegerBetween from './number/isIntegerBetween.js';
14
- import isIntegerBelow from './number/isIntegerBelow.js';
15
- import isIntegerBelowOrEqual from './number/isIntegerBelowOrEqual.js';
16
- import isIntegerAbove from './number/isIntegerAbove.js';
17
- import isIntegerAboveOrEqual from './number/isIntegerAboveOrEqual.js';
18
- import isRegExp from './regexp/is.js';
19
- import isObject from './object/is.js';
20
- import isNotEmptyObject from './object/isNotEmpty.js';
21
- import isString from './string/is.js';
22
- import isStringBetween from './string/isBetween.js';
23
- import isNotEmptyString from './string/isNotEmpty.js';
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,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- import round from './round.js';
3
+ import round from './round.mjs';
4
4
 
5
5
  // Convert a float value to a percentage
6
6
  export default function toPercentage (val, precision = 0, min = 0, max = 1) {
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- import {PROTO_OBJ} from './is.js';
3
+ import {PROTO_OBJ} from './is.mjs';
4
4
 
5
5
  export default function define (props, obj = {}) {
6
6
  if (
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- import {PROTO_OBJ} from './is.js';
3
+ import {PROTO_OBJ} from './is.mjs';
4
4
 
5
5
  export default function isNotEmptyObject (val) {
6
6
  return Object.prototype.toString.call(val) === PROTO_OBJ && Object.keys(val).length > 0;
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- import {PROTO_OBJ} from './is.js';
3
+ import {PROTO_OBJ} from './is.mjs';
4
4
 
5
5
  const merge = (target, source = {}) => {
6
6
  if (
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- import deepGet from '../deep/get.js';
4
- import deepSet from '../deep/set.js';
5
- import isNotEmptyString from '../string/isNotEmpty.js';
6
- import {PROTO_OBJ} from './is.js';
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.js';
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.js';
4
- import isNotEmptyString from '../string/isNotEmpty.js';
5
- import {PROTO_OBJ} from '../object/is.js';
6
- import humanizeNumber from './humanizeNumber.js';
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.js';
4
- import isString from '../string/is.js';
5
- import isNotEmptyString from '../string/isNotEmpty.js';
6
- import round from '../number/round.js';
7
- import {PROTO_OBJ} from '../object/is.js';
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,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- import isString from './is.js';
3
+ import isString from './is.mjs';
4
4
 
5
5
  // Check if a string is between a range in length
6
6
  export default function isStringBetween (val, min, max, trimmed = true) {
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- import isString from './is.js';
4
- import isNumberAbove from '../number/isAbove.js';
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