@kizmann/pico-js 2.0.3 → 2.0.5

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/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@kizmann/pico-js",
3
- "version": "2.0.3",
3
+ "version": "2.0.5",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "private": false,
7
7
  "author": "Eduard Kizmann <kizmann@protonmail.ch>",
8
8
  "repository": "https://github.com/vankizmann/pico-js",
9
9
  "main": "./src/index.esm.js",
10
+ "unpkg": "./dist/pico-js.browser.js",
10
11
  "jsnext:main": "./src/index.esm.js",
11
12
  "typings": "./types/index.esm.d.ts",
12
13
  "imports": {
@@ -42,6 +43,7 @@
42
43
  "lodash": "^4.17.23",
43
44
  "mini-css-extract-plugin": "^2.0.0",
44
45
  "mitata": "^1.0.34",
46
+ "moment": "^2.30.1",
45
47
  "postcss": "^8.4.31",
46
48
  "postcss-inline-svg": "^5.0.0",
47
49
  "postcss-loader": "^5.0.0",
@@ -1,4 +1,4 @@
1
- import { Arr, Hash, Mix, Obj, Dom } from "../index.esm.js";
1
+ import { Arr, Hash, Mix, Obj, Dom, Run } from "../index.esm.js";
2
2
  import { PicoDom } from "../utils/Dom.js";
3
3
 
4
4
  /**
@@ -6,7 +6,7 @@ import { PicoDom } from "../utils/Dom.js";
6
6
  */
7
7
  export class PicoDomEventStatic
8
8
  {
9
- static events = [];
9
+ static $events = [];
10
10
  }
11
11
 
12
12
  /**
@@ -35,7 +35,7 @@ export class PicoDomEventInstance
35
35
  options = { id: options };
36
36
  }
37
37
 
38
- Dom.events = Arr.append(Dom.events, {
38
+ Dom.$events = Arr.append(Dom.$events, {
39
39
  el, event, cb, selector, pause, options
40
40
  });
41
41
 
@@ -61,7 +61,7 @@ export class PicoDomEventInstance
61
61
  options = { id: options };
62
62
  }
63
63
 
64
- let indexes = Arr.filterIndex(Dom.events, {
64
+ let indexes = Arr.filterIndex(Dom.$events, {
65
65
  el, event, selector, options
66
66
  });
67
67
 
@@ -74,10 +74,10 @@ export class PicoDomEventInstance
74
74
  };
75
75
 
76
76
  Arr.each(indexes.reverse(), (index) => {
77
- el.removeEventListener(...args(Dom.events[index]));
77
+ el.removeEventListener(...args(Dom.$events[index]));
78
78
  });
79
79
 
80
- Arr.splices(Dom.events, indexes);
80
+ Arr.splices(Dom.$events, indexes);
81
81
 
82
82
  return this;
83
83
  }
@@ -142,6 +142,27 @@ export class PicoDomEventInstance
142
142
  return this;
143
143
  }
144
144
 
145
+ /**
146
+ * Stop listening to event with specific options
147
+ *
148
+ * @example Dom.find("div").optoff({ id: "my-id" })
149
+ *
150
+ * @param {any} [options] Listener options
151
+ * @returns {PicoDom} Current instance
152
+ */
153
+ optoff(options = {})
154
+ {
155
+ Run.idle(() => {
156
+ Arr.filterRemove(Dom.$events, { options });
157
+ });
158
+
159
+ this.each((el) => {
160
+ el && el.removeAllListeners();
161
+ });
162
+
163
+ return this;
164
+ }
165
+
145
166
  /**
146
167
  * Listen to event once
147
168
  *
@@ -1,4 +1,4 @@
1
- import { Run, Mix, Obj, Dom } from "../index.esm.js";
1
+ import { Run, Mix, Obj, Dom, Hash } from "../index.esm.js";
2
2
  import { PicoDom } from "../utils/Dom.js";
3
3
 
4
4
  /**
@@ -60,18 +60,18 @@ export class PicoDomGlobalStatic
60
60
  */
61
61
  static ready(cb, delay = 0, limit = 6000)
62
62
  {
63
+ let [id, el, event] = [
64
+ Hash.make(), Dom.find(document), 'DOMContentLoaded'
65
+ ];
66
+
63
67
  let fn = () => {
64
- Run.delay(cb, delay);
68
+ (Run.delay(cb, delay), el.off(event, null, { id }));
65
69
  };
66
70
 
67
- let [el, event] = [
68
- Dom.find(document), 'DOMContentLoaded'
69
- ];
70
-
71
71
  let ready = Dom.isDomReady;
72
72
 
73
73
  if ( ! ready() ) {
74
- return (el.on(event, fn), this);
74
+ return (el.on(event, fn, { id }), this);
75
75
  }
76
76
 
77
77
  Run.wait(() => {
package/src/index.esm.js CHANGED
@@ -1,13 +1,33 @@
1
- import { default as PicoRunner } from "./utils/Runner.js";
2
- import { default as PicoString } from "./utils/String.js";
3
- import { default as PicoNumber } from "./utils/Number.js";
4
- import { default as PicoArray } from "./utils/Array.js";
5
- import { default as PicoObject } from "./utils/Object.js";
6
- import { default as PicoMixed } from "./utils/Mixed.js";
7
- import { default as PicoHash } from "./utils/Hash.js";
8
- import { default as PicoEvent } from "./utils/Event.js";
9
- import { default as PicoLocale } from "./utils/Locale.js";
10
- import { default as PicoCookie } from "./utils/Cookie.js";
1
+ import { PicoRunner, default as Run } from "./utils/Runner.js";
2
+ import { PicoString, default as Str } from "./utils/String.js";
3
+ import { PicoNumber, default as Num } from "./utils/Number.js";
4
+ import { PicoArray, default as Arr } from "./utils/Array.js";
5
+ import { PicoObject, default as Obj } from "./utils/Object.js";
6
+ import { PicoMixed, default as Mix } from "./utils/Mixed.js";
7
+ import { PicoHash, default as Hash } from "./utils/Hash.js";
8
+ import { PicoEvent, default as Event } from "./utils/Event.js";
9
+ import { PicoLocale, default as Locale } from "./utils/Locale.js";
10
+ import { PicoCookie, default as Cookie } from "./utils/Cookie.js";
11
+
12
+ /**
13
+ * @type {typeof PicoDom}
14
+ */
15
+ const Dom = DomBuilder();
16
+
17
+ /**
18
+ * @type {typeof PicoNow}
19
+ */
20
+ const Now = NowBuilder();
21
+
22
+ /**
23
+ * @type {typeof PicoFormat}
24
+ */
25
+ const For = ForBuilder();
26
+
27
+ export {
28
+ Dom, Now, For, Run, Str, Num, Arr, Obj, Mix, Hash, Event, Locale, Cookie
29
+ }
30
+
11
31
  import { PicoDom, default as DomBuilder } from "./utils/Dom.js";
12
32
  import { PicoNow, default as NowBuilder } from "./utils/Now.js";
13
33
  import { PicoFormat, default as ForBuilder } from "./utils/Format.js";
@@ -31,72 +51,6 @@ export {
31
51
  Route, Element
32
52
  }
33
53
 
34
- /**
35
- * @type {typeof PicoDom}
36
- */
37
- export const Dom = DomBuilder();
38
-
39
- /**
40
- * @type {typeof PicoNow}
41
- */
42
- export const Now = NowBuilder();
43
-
44
- /**
45
- * @type {typeof PicoFormat}
46
- */
47
- export const For = ForBuilder();
48
-
49
- /**
50
- * @type {typeof PicoRunner}
51
- */
52
- export const Run = PicoRunner;
53
-
54
- /**
55
- * @type {typeof PicoString}
56
- */
57
- export const Str = PicoString;
58
-
59
- /**
60
- * @type {typeof PicoNumber}
61
- */
62
- export const Num = PicoNumber;
63
-
64
- /**
65
- * @type {typeof PicoArray}
66
- */
67
- export const Arr = PicoArray;
68
-
69
- /**
70
- * @type {typeof PicoObject}
71
- */
72
- export const Obj = PicoObject;
73
-
74
- /**
75
- * @type {typeof PicoMixed}
76
- */
77
- export const Mix = PicoMixed;
78
-
79
- /**
80
- * @type {typeof PicoHash}
81
- */
82
- export const Hash = PicoHash;
83
-
84
- /**
85
- * @type {typeof PicoEvent}
86
- */
87
- export const Event = PicoEvent;
88
-
89
- /**
90
- * @type {typeof PicoLocale}
91
- */
92
- export const Locale = PicoLocale;
93
-
94
- /**
95
- * @type {typeof PicoCookie}
96
- */
97
- export const Cookie = PicoCookie;
98
-
99
-
100
54
  /**
101
55
  * @type {typeof PicoMixed}
102
56
  */
@@ -112,5 +66,5 @@ export const Any = new Proxy({}, {
112
66
  */
113
67
  export const UUID = function () {
114
68
  console.warn('UUID() is deprecated, use Hash.make() instead.');
115
- return PicoHash.make();
69
+ return Hash.make();
116
70
  };
@@ -396,7 +396,7 @@ export class PicoNowDefaultInstance
396
396
  /**
397
397
  * @see PicoNow.add
398
398
  */
399
- PicoNowGridInstance.prototype.addSecond = function (value) {
399
+ PicoNowDefaultInstance.prototype.addSecond = function (value) {
400
400
  console.warn('Now.addSecond() is deprecated, use Now.add(value, \'second\') instead.');
401
401
  return this.add(value, 'second');
402
402
  }
@@ -404,7 +404,7 @@ PicoNowGridInstance.prototype.addSecond = function (value) {
404
404
  /**
405
405
  * @see PicoNow.sub
406
406
  */
407
- PicoNowGridInstance.prototype.subSecond = function (value) {
407
+ PicoNowDefaultInstance.prototype.subSecond = function (value) {
408
408
  console.warn('Now.subSecond() is deprecated, use Now.sub(value, \'second\') instead.');
409
409
  return this.sub(value, 'second');
410
410
  }
@@ -412,7 +412,7 @@ PicoNowGridInstance.prototype.subSecond = function (value) {
412
412
  /**
413
413
  * @see PicoNow.add
414
414
  */
415
- PicoNowGridInstance.prototype.addMinute = function (value) {
415
+ PicoNowDefaultInstance.prototype.addMinute = function (value) {
416
416
  console.warn('Now.addMinute() is deprecated, use Now.add(value, \'minute\') instead.');
417
417
  return this.add(value, 'minute');
418
418
  }
@@ -420,7 +420,7 @@ PicoNowGridInstance.prototype.addMinute = function (value) {
420
420
  /**
421
421
  * @see PicoNow.sub
422
422
  */
423
- PicoNowGridInstance.prototype.subMinute = function (value) {
423
+ PicoNowDefaultInstance.prototype.subMinute = function (value) {
424
424
  console.warn('Now.subMinute() is deprecated, use Now.sub(value, \'minute\') instead.');
425
425
  return this.sub(value, 'minute');
426
426
  }
@@ -428,7 +428,7 @@ PicoNowGridInstance.prototype.subMinute = function (value) {
428
428
  /**
429
429
  * @see PicoNow.add
430
430
  */
431
- PicoNowGridInstance.prototype.addHour = function (value) {
431
+ PicoNowDefaultInstance.prototype.addHour = function (value) {
432
432
  console.warn('Now.addHour() is deprecated, use Now.add(value, \'hour\') instead.');
433
433
  return this.add(value, 'hour');
434
434
  }
@@ -436,7 +436,7 @@ PicoNowGridInstance.prototype.addHour = function (value) {
436
436
  /**
437
437
  * @see PicoNow.sub
438
438
  */
439
- PicoNowGridInstance.prototype.subHour = function (value) {
439
+ PicoNowDefaultInstance.prototype.subHour = function (value) {
440
440
  console.warn('Now.subHour() is deprecated, use Now.sub(value, \'hour\') instead.');
441
441
  return this.sub(value, 'hour');
442
442
  }
@@ -444,7 +444,7 @@ PicoNowGridInstance.prototype.subHour = function (value) {
444
444
  /**
445
445
  * @see PicoNow.add
446
446
  */
447
- PicoNowGridInstance.prototype.addDates = function (value) {
447
+ PicoNowDefaultInstance.prototype.addDates = function (value) {
448
448
  console.warn('Now.addDates() is deprecated, use Now.add(value, \'date\') instead.');
449
449
  return this.add(value, 'date');
450
450
  }
@@ -452,7 +452,7 @@ PicoNowGridInstance.prototype.addDates = function (value) {
452
452
  /**
453
453
  * @see PicoNow.sub
454
454
  */
455
- PicoNowGridInstance.prototype.subDates = function (value) {
455
+ PicoNowDefaultInstance.prototype.subDates = function (value) {
456
456
  console.warn('Now.subDates() is deprecated, use Now.sub(value, \'date\') instead.');
457
457
  return this.sub(value, 'date');
458
458
  }
@@ -460,7 +460,7 @@ PicoNowGridInstance.prototype.subDates = function (value) {
460
460
  /**
461
461
  * @see PicoNow.add
462
462
  */
463
- PicoNowGridInstance.prototype.addMonths = function (value) {
463
+ PicoNowDefaultInstance.prototype.addMonths = function (value) {
464
464
  console.warn('Now.addMonths() is deprecated, use Now.add(value, \'month\') instead.');
465
465
  return this.add(value, 'month');
466
466
  }
@@ -468,7 +468,7 @@ PicoNowGridInstance.prototype.addMonths = function (value) {
468
468
  /**
469
469
  * @see PicoNow.sub
470
470
  */
471
- PicoNowGridInstance.prototype.subMonths = function (value) {
471
+ PicoNowDefaultInstance.prototype.subMonths = function (value) {
472
472
  console.warn('Now.subMonths() is deprecated, use Now.sub(value, \'month\') instead.');
473
473
  return this.sub(value, 'month');
474
474
  }
@@ -476,7 +476,7 @@ PicoNowGridInstance.prototype.subMonths = function (value) {
476
476
  /**
477
477
  * @see PicoNow.add
478
478
  */
479
- PicoNowGridInstance.prototype.addYears = function (value) {
479
+ PicoNowDefaultInstance.prototype.addYears = function (value) {
480
480
  console.warn('Now.addYears() is deprecated, use Now.add(value, \'year\') instead.');
481
481
  return this.add(value, 'year');
482
482
  }
@@ -484,7 +484,7 @@ PicoNowGridInstance.prototype.addYears = function (value) {
484
484
  /**
485
485
  * @see PicoNow.sub
486
486
  */
487
- PicoNowGridInstance.prototype.subYears = function (value) {
487
+ PicoNowDefaultInstance.prototype.subYears = function (value) {
488
488
  console.warn('Now.subYears() is deprecated, use Now.sub(value, \'year\') instead.');
489
489
  return this.sub(value, 'year');
490
490
  }
@@ -492,7 +492,7 @@ PicoNowGridInstance.prototype.subYears = function (value) {
492
492
  /**
493
493
  * @see PicoNow.add
494
494
  */
495
- PicoNowGridInstance.prototype.addDecades = function (value) {
495
+ PicoNowDefaultInstance.prototype.addDecades = function (value) {
496
496
  console.warn('Now.addDecades() is deprecated, use Now.grid(10 * value, \'year\') instead.');
497
497
  return this.add(10 * value, 'year');
498
498
  }
@@ -500,7 +500,7 @@ PicoNowGridInstance.prototype.addDecades = function (value) {
500
500
  /**
501
501
  * @see PicoNow.sub
502
502
  */
503
- PicoNowGridInstance.prototype.subDecades = function (value) {
503
+ PicoNowDefaultInstance.prototype.subDecades = function (value) {
504
504
  console.warn('Now.subDecades() is deprecated, use Now.grid(10 * value, \'year\') instead.');
505
505
  return this.sub(10 * value, 'year');
506
506
  }
@@ -508,7 +508,7 @@ PicoNowGridInstance.prototype.subDecades = function (value) {
508
508
  /**
509
509
  * @see PicoNow.day
510
510
  */
511
- PicoNowGridInstance.prototype.humanDay = function () {
511
+ PicoNowDefaultInstance.prototype.humanDay = function () {
512
512
  console.warn('Now.humanDay() is deprecated, use Now.day() instead.');
513
513
  return this.day();
514
514
  }
@@ -516,7 +516,7 @@ PicoNowGridInstance.prototype.humanDay = function () {
516
516
  /**
517
517
  * @see PicoNow.month
518
518
  */
519
- PicoNowGridInstance.prototype.humanMonth = function () {
519
+ PicoNowDefaultInstance.prototype.humanMonth = function () {
520
520
  console.warn('Now.humanMonth() is deprecated, use Now.month() instead.');
521
521
  return this.month();
522
522
  }
@@ -231,25 +231,38 @@ export class PicoArray
231
231
  */
232
232
  static each(value, cb, retval = null)
233
233
  {
234
- let [isArr, keys] = [
235
- Mix.isArr(value), Mix.keys(value)
236
- ];
234
+ if ( Mix.isObj(value) ) {
235
+ return this.eachObj(value, cb, retval);
236
+ }
237
237
 
238
- let fn = (key) => {
239
- return isArr ? parseInt(key) : key;
240
- };
238
+ if ( value == null ) {
239
+ value = [];
240
+ }
241
+
242
+ let result = new Array(value.length);
243
+
244
+ for (let i = 0; i < value.length; i++) {
245
+ result[i] = cb(value[i], i);
246
+ }
241
247
 
242
- let result = new Array(keys.length);
248
+ return retval != null ? retval : result;
249
+ }
243
250
 
244
- for (let i = 0; i < keys.length; i++) {
245
- result[i] = cb(value[keys[i]], fn(keys[i]));
251
+ static eachObj(value, cb, retval = null)
252
+ {
253
+ if ( Mix.isArr(value) ) {
254
+ return this.each(value, cb, retval);
246
255
  }
247
256
 
248
- if ( retval != null ) {
249
- return retval;
257
+ if ( value == null ) {
258
+ value = {};
250
259
  }
251
260
 
252
- return result;
261
+ let result = Mix.keys(value).map((key) => {
262
+ return cb(value[key], key);
263
+ });
264
+
265
+ return retval != null ? retval : result;
253
266
  }
254
267
 
255
268
  /**
@@ -295,15 +308,30 @@ export class PicoArray
295
308
  return value;
296
309
  }
297
310
 
298
- return this.map(value, (item) => {
311
+ if ( Mix.isObj(value) ) {
312
+ return this.recursiveObj(value, key, cb, cascade);
313
+ }
314
+
315
+ return this.each(value, (item) => {
299
316
  return (this.recursive(item[key], key, cb, [
300
317
  ...cascade, value
301
- ]), cb(item, cascade));
318
+ ]), cb(item, this.clone(cascade)));
302
319
  });
303
320
 
304
321
  // [{childs: [{ childs: [] } ] }, { childs: [] } ] }]
305
322
  }
306
323
 
324
+ static recursiveObj(value, key, cb, cascade = [])
325
+ {
326
+ if ( value == null ) {
327
+ return value;
328
+ }
329
+
330
+ return this.recursive(value[key], key, cb, [
331
+ ...cascade, value
332
+ ]), cb(item, this.clone(cascade))
333
+ }
334
+
307
335
  /**
308
336
  * Get matching indexes by filter
309
337
  *
@@ -315,6 +343,10 @@ export class PicoArray
315
343
  */
316
344
  static filterIndex(value, filter = null)
317
345
  {
346
+ if ( value == null ) {
347
+ return [];
348
+ }
349
+
318
350
  if ( filter == null ) {
319
351
  filter = (val) => !Mix.isEmpty(val);
320
352
  }
@@ -333,6 +365,21 @@ export class PicoArray
333
365
  });
334
366
  }
335
367
 
368
+ static filterRemove(value, filter = null)
369
+ {
370
+ if ( value == null ) {
371
+ return value;
372
+ }
373
+
374
+ let indexes = this.filterIndex(value, filter);
375
+
376
+ if ( indexes.length === 0 ) {
377
+ return value;
378
+ }
379
+
380
+ return this.splices(value, indexes);
381
+ }
382
+
336
383
  /**
337
384
  * Filter values by filter
338
385
  *
@@ -344,6 +391,10 @@ export class PicoArray
344
391
  */
345
392
  static filter(value, filter = null)
346
393
  {
394
+ if ( value == null ) {
395
+ return [];
396
+ }
397
+
347
398
  if ( filter == null ) {
348
399
  filter = (val) => !Mix.isEmpty(val);
349
400
  }
@@ -374,6 +425,10 @@ export class PicoArray
374
425
  */
375
426
  static findIndex(value, filter = null, fallback = - 1)
376
427
  {
428
+ if ( value == null ) {
429
+ return fallback;
430
+ }
431
+
377
432
  if ( filter == null ) {
378
433
  filter = (val) => !Mix.isEmpty(val);
379
434
  }
@@ -930,57 +985,57 @@ export class PicoArray
930
985
  /**
931
986
  * @see PicoArray.unset
932
987
  */
933
- PicoArray.removeIndex = (...args) => {
988
+ PicoArray.removeIndex = function (...args) {
934
989
  console.warn('Arr.removeIndex() is deprecated, use Arr.unset() instead.');
935
- return Arr.unset(...args);
990
+ return this.unset(...args);
936
991
  };
937
992
 
938
993
  /**
939
994
  * @see PicoArray.sortPrim
940
995
  */
941
- PicoArray.sortString = (...args) => {
996
+ PicoArray.sortString = function (...args) {
942
997
  console.warn('Arr.sortString() is deprecated, use Arr.sortPrim() instead.');
943
- return Arr.sortPrim(...args);
998
+ return this.sortPrim(...args);
944
999
  };
945
1000
 
946
1001
  /**
947
1002
  * @see PicoArray.append
948
1003
  */
949
- PicoArray.push = (...args) => {
1004
+ PicoArray.push = function (...args) {
950
1005
  console.warn('Arr.push() is deprecated, use Arr.append() instead.');
951
- return Arr.append(...args);
1006
+ return this.append(...args);
952
1007
  };
953
1008
 
954
1009
  /**
955
1010
  * @see PicoArray.merge
956
1011
  */
957
- PicoArray.concat = (...args) => {
1012
+ PicoArray.concat = function (...args) {
958
1013
  console.warn('Arr.concat() is deprecated, use Arr.merge() instead.');
959
- return Arr.merge(...args);
1014
+ return this.merge(...args);
960
1015
  };
961
1016
 
962
1017
  /**
963
1018
  * @see PicoArray.matches
964
1019
  */
965
- PicoArray.equal = (...args) => {
1020
+ PicoArray.equal = function (...args) {
966
1021
  console.warn('Arr.equal() is deprecated, use Arr.matches() instead.');
967
- return Arr.matches(...args);
1022
+ return this.matches(...args);
968
1023
  };
969
1024
 
970
1025
  /**
971
1026
  * @see PicoArray.diff
972
1027
  */
973
- PicoArray.diffrence = (...args) => {
1028
+ PicoArray.diffrence = function (...args) {
974
1029
  console.warn('Arr.diffrence() is deprecated, use Arr.diff() instead.');
975
- return Arr.diff(...args);
1030
+ return this.diff(...args);
976
1031
  };
977
1032
 
978
1033
  /**
979
1034
  * @see PicoArray.isect
980
1035
  */
981
- PicoArray.intersect = (...args) => {
1036
+ PicoArray.intersect = function (...args) {
982
1037
  console.warn('Arr.intersect() is deprecated, use Arr.isect() instead.');
983
- return Arr.isect(...args);
1038
+ return this.isect(...args);
984
1039
  };
985
1040
 
986
1041
  export default PicoArray;
@@ -134,7 +134,7 @@ export class PicoCookie
134
134
  this.$cookie[key] = value;
135
135
  }
136
136
 
137
- let plain = key + '=' + value.replaceAll(...[
137
+ let plain = key + '=' + Mix.str(value).replaceAll(...[
138
138
  ';', '{:}'
139
139
  ]);
140
140
 
package/src/utils/Hash.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Str, Hash } from "../index.esm.js";
1
+ import { Str } from "../index.esm.js";
2
2
 
3
3
  /**
4
4
  * @var {Array<string>} RADIX_NUMBER Radix from 0 to 9
@@ -96,7 +96,7 @@ export class PicoHash
96
96
  let hash = '';
97
97
 
98
98
  for ( let i = 0; i < length; i ++ ) {
99
- hash += Hash.radix(radix);
99
+ hash += this.radix(radix);
100
100
  }
101
101
 
102
102
  for ( const k of Object.keys(map) ) {
@@ -121,9 +121,9 @@ export class PicoHash
121
121
  // Use only selected chars from the radix store
122
122
  for ( let i = 0; i < 31; i ++ ) {
123
123
  if ( i === 15 ) {
124
- hash += Hash.radix(RADIX_UP19.length, RADIX_UP19);
124
+ hash += this.radix(RADIX_UP19.length, RADIX_UP19);
125
125
  } else {
126
- hash += Hash.radix(RADIX_UUID.length, RADIX_UUID);
126
+ hash += this.radix(RADIX_UUID.length, RADIX_UUID);
127
127
  }
128
128
  }
129
129
 
@@ -153,7 +153,7 @@ export class PicoHash
153
153
  let hash = '';
154
154
 
155
155
  for ( let i = 0; i < length; i ++ ) {
156
- hash += Hash.radix(radix.length, radix);
156
+ hash += this.radix(radix.length, radix);
157
157
  }
158
158
 
159
159
  return hash;
@@ -1,4 +1,4 @@
1
- import { Arr, go, Mix, Run, Now, Locale, Str, Obj } from "../index.esm.js";
1
+ import { go, Arr, Mix, Run, Now, Locale, Str, Obj } from "../index.esm.js";
2
2
 
3
3
  export const MIX_REGEX = {
4
4
  'iso': /^\d{4}-\d{2}-\d{2}[T\s]\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/,
@@ -279,7 +279,7 @@ export class PicoMixed
279
279
  return false;
280
280
  }
281
281
 
282
- return Object.getPrototypeOf(value) === Object.prototype;
282
+ return typeof value === 'object' && value.constructor === Object;
283
283
  }
284
284
 
285
285
  /**
@@ -302,7 +302,7 @@ export class PicoMixed
302
302
  return false;
303
303
  }
304
304
 
305
- return Object.getPrototypeOf(value) === Array.prototype;
305
+ return typeof value === 'object' && value.constructor === Array;
306
306
  }
307
307
 
308
308
  /**