@gesslar/toolkit 5.0.1 → 5.1.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/README.md CHANGED
@@ -47,7 +47,6 @@ Includes all browser functionality plus Node.js-specific modules for file I/O, l
47
47
  | Valid | Validation and assertion methods |
48
48
  | Watcher | File and directory change watcher with debounce protection |
49
49
 
50
-
51
50
  ## Installation
52
51
 
53
52
  ```shell
@@ -151,7 +150,7 @@ Sincerely, Senator Yabba of the Dabba (Doo)
151
150
 
152
151
  ## License
153
152
 
154
- `@gesslar/toolkit` is released into the public domain under the [0BSD](LICENSE.txt).
153
+ `@gesslar/toolkit` is released under the [0BSD](LICENSE.txt).
155
154
 
156
155
  This package includes or depends on third-party components under their own
157
156
  licenses:
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "name": "gesslar",
6
6
  "url": "https://gesslar.dev"
7
7
  },
8
- "version": "5.0.1",
8
+ "version": "5.1.0",
9
9
  "license": "0BSD",
10
10
  "homepage": "https://github.com/gesslar/toolkit#readme",
11
11
  "repository": {
@@ -83,7 +83,7 @@
83
83
  "yaml": "^2.8.3"
84
84
  },
85
85
  "devDependencies": {
86
- "@gesslar/uglier": "^2.4.0",
86
+ "@gesslar/uglier": "^2.4.1",
87
87
  "@rollup/plugin-node-resolve": "^16.0.3",
88
88
  "eslint": "^10.2.0",
89
89
  "happy-dom": "^20.8.9",
@@ -193,7 +193,7 @@ export default class TypeSpec {
193
193
  // Handle non-array values
194
194
  if(!isArray && !allowedArray) {
195
195
  if(valueType === allowedType)
196
- return allowEmpty || !empty
196
+ return Data.isBaseType(value, allowedType) && (allowEmpty || !empty)
197
197
 
198
198
  if(valueType === "Null" || valueType === "Undefined")
199
199
  return false
@@ -9,21 +9,36 @@ import Sass from "./Sass.js"
9
9
  import Data from "./Data.js"
10
10
  import Collection from "./Collection.js"
11
11
 
12
+ /**
13
+ * Options for type validation methods.
14
+ *
15
+ * @typedef {object} TypeValidationOptions
16
+ * @property {boolean} [allowEmpty=true] - Whether empty values are allowed
17
+ */
18
+
12
19
  /**
13
20
  * Validation utility class providing type checking and assertion methods.
14
21
  */
15
22
  export default class Valid {
23
+ /** @type {typeof Sass} */
24
+ static _Sass = Sass
25
+
16
26
  /**
17
27
  * Validates a value against a type. Uses Data.isType.
18
28
  *
19
29
  * @param {unknown} value - The value to validate
20
30
  * @param {string} type - The expected type in the form of "object", "object[]", "object|object[]"
21
- * @param {object} [options] - Additional options for validation.
31
+ * @param {TypeValidationOptions} [options] - Additional options for validation.
22
32
  */
23
33
  static type(value, type, options) {
24
- Valid.assert(
34
+ const expected = [type]
35
+
36
+ if(options?.allowEmpty !== true)
37
+ expected.push("[no empty values]")
38
+
39
+ this.assert(
25
40
  Data.isType(value, type, options),
26
- `Invalid type. Expected ${type}, got ${Data.typeOf(value)}`
41
+ `Invalid type. Expected ${expected.join(" ")}, got ${Data.typeOf(value)}`
27
42
  )
28
43
  }
29
44
 
@@ -37,23 +52,20 @@ export default class Valid {
37
52
  * met (optional)
38
53
  */
39
54
  static assert(condition, message, arg = null) {
40
- if(!Data.isType(condition, "boolean")) {
41
- throw Sass.new(`Condition must be a boolean, got ${condition}`)
42
- }
55
+ if(!Data.isType(condition, "boolean"))
56
+ throw this._Sass.new(`Condition must be a boolean, got ${condition}`)
43
57
 
44
- if(!Data.isType(message, "string")) {
45
- throw Sass.new(`Message must be a string, got ${message}`)
46
- }
58
+ if(!Data.isType(message, "string"))
59
+ throw this._Sass.new(`Message must be a string, got ${message}`)
47
60
 
48
- if(!(arg === null || arg === undefined || typeof arg === "number")) {
49
- throw Sass.new(`Arg must be a number, got ${arg}`)
50
- }
61
+ if(!(arg === null || arg === undefined || typeof arg === "number"))
62
+ throw this._Sass.new(`Arg must be a number, got ${arg}`)
51
63
 
52
64
  if(!condition)
53
- throw Sass.new(`${message}${arg ? `: ${arg}` : ""}`)
65
+ throw this._Sass.new(`${message}${arg ? `: ${arg}` : ""}`)
54
66
  }
55
67
 
56
- static #restrictedProto = ["__proto__", "constructor", "prototype"]
68
+ static #restrictedProto = Object.freeze(["__proto__", "constructor", "prototype"])
57
69
 
58
70
  /**
59
71
  * Protects against prototype pollution by checking keys for dangerous property names.
@@ -63,11 +75,11 @@ export default class Valid {
63
75
  * @throws {Sass} If any key matches restricted prototype properties (__proto__, constructor, prototype)
64
76
  */
65
77
  static prototypePollutionProtection(keys) {
66
- Valid.type(keys, "String[]")
78
+ this.type(keys, "String[]")
67
79
 
68
- const oopsIDidItAgain = Collection.intersection(this.#restrictedProto, keys)
80
+ const oopsIDidItAgain = Collection.intersection(Valid.#restrictedProto, keys)
69
81
 
70
- Valid.assert(
82
+ this.assert(
71
83
  oopsIDidItAgain.length === 0,
72
84
  `We don't pee in your pool, don't pollute ours with your ${String(oopsIDidItAgain)}`
73
85
  )
@@ -1,4 +1,4 @@
1
- import Valid from "../../browser/lib/Valid.js"
1
+ import Valid from "./Valid.js"
2
2
  import Data from "./Data.js"
3
3
  import Sass from "./Sass.js"
4
4
 
@@ -2,85 +2,17 @@
2
2
  * @file Valid.js
3
3
  *
4
4
  * Node-flavoured validation utilities that throw the Node Sass error type.
5
- * Mirrors the browser Valid API so browser and Node callers behave the same.
5
+ * Extends the browser Valid, swapping in the Node Sass for richer reporting.
6
6
  */
7
7
 
8
+ import BrowserValid from "../../browser/lib/Valid.js"
8
9
  import Sass from "./Sass.js"
9
- import Data from "../../browser/lib/Data.js"
10
- import Collection from "../../browser/lib/Collection.js"
11
-
12
- /**
13
- * Options for type validation methods.
14
- *
15
- * @typedef {object} TypeValidationOptions
16
- * @property {boolean} [allowEmpty=true] - Whether empty values are allowed
17
- */
18
10
 
19
11
  /**
20
12
  * Validation utility class providing type checking and assertion methods.
13
+ * Inherits all behaviour from browser Valid; only the Sass class differs.
21
14
  */
22
- export default class Valid {
23
- static #restrictedProto = ["__proto__", "constructor", "prototype"]
24
-
25
- /**
26
- * Validates a value against a type. Uses Data.isType.
27
- *
28
- * @param {unknown} value - The value to validate
29
- * @param {string} type - The expected type in the form of "object", "object[]", "object|object[]"
30
- * @param {TypeValidationOptions} [options] - Additional options for validation.
31
- */
32
- static type(value, type, options) {
33
- const expected = [type]
34
-
35
- if(options?.allowEmpty !== true)
36
- expected.push("[no empty values]")
37
-
38
- Valid.assert(
39
- Data.isType(value, type, options),
40
- `Invalid type. Expected ${expected.join(" ")}, got ${Data.typeOf(value)}`
41
- )
42
- }
43
-
44
- /**
45
- * Asserts a condition
46
- *
47
- * @param {boolean} condition - The condition to assert
48
- * @param {string} message - The message to display if the condition is not
49
- * met
50
- * @param {number} [arg] - The argument to display if the condition is not
51
- * met (optional)
52
- */
53
- static assert(condition, message, arg = null) {
54
- if(!Data.isType(condition, "boolean"))
55
- throw Sass.new(`Condition must be a boolean, got ${condition}`)
56
-
57
- if(!Data.isType(message, "string"))
58
- throw Sass.new(`Message must be a string, got ${message}`)
59
-
60
- if(!(arg === null || arg === undefined || typeof arg === "number"))
61
- throw Sass.new(`Arg must be a number, got ${arg}`)
62
-
63
- if(!condition)
64
- throw Sass.new(`${message}${arg ? `: ${arg}` : ""}`)
65
- }
66
-
67
- /**
68
- * Protects against prototype pollution by checking keys for dangerous
69
- * property names.
70
- *
71
- * Throws if any restricted prototype properties are found in the keys array.
72
- *
73
- * @param {Array<string>} keys - Array of property keys to validate
74
- * @throws {Sass} If any key matches restricted prototype properties (__proto__, constructor, prototype)
75
- */
76
- static prototypePollutionProtection(keys) {
77
- Valid.type(keys, "String[]")
78
-
79
- const oopsIDidItAgain = Collection.intersection(this.#restrictedProto, keys)
80
-
81
- Valid.assert(
82
- oopsIDidItAgain.length === 0,
83
- `We don't pee in your pool, don't pollute ours with your ${String(oopsIDidItAgain)}`
84
- )
85
- }
15
+ export default class Valid extends BrowserValid {
16
+ /** @type {typeof Sass} */
17
+ static _Sass = Sass
86
18
  }
@@ -1,15 +1,23 @@
1
+ /**
2
+ * Options for type validation methods.
3
+ *
4
+ * @typedef {object} TypeValidationOptions
5
+ * @property {boolean} [allowEmpty=true] - Whether empty values are allowed
6
+ */
1
7
  /**
2
8
  * Validation utility class providing type checking and assertion methods.
3
9
  */
4
10
  export default class Valid {
11
+ /** @type {typeof Sass} */
12
+ static _Sass: typeof Sass;
5
13
  /**
6
14
  * Validates a value against a type. Uses Data.isType.
7
15
  *
8
16
  * @param {unknown} value - The value to validate
9
17
  * @param {string} type - The expected type in the form of "object", "object[]", "object|object[]"
10
- * @param {object} [options] - Additional options for validation.
18
+ * @param {TypeValidationOptions} [options] - Additional options for validation.
11
19
  */
12
- static type(value: unknown, type: string, options?: object): void;
20
+ static type(value: unknown, type: string, options?: TypeValidationOptions): void;
13
21
  /**
14
22
  * Asserts a condition
15
23
  *
@@ -20,7 +28,7 @@ export default class Valid {
20
28
  * met (optional)
21
29
  */
22
30
  static assert(condition: boolean, message: string, arg?: number): void;
23
- static #restrictedProto: string[];
31
+ static #restrictedProto: readonly string[];
24
32
  /**
25
33
  * Protects against prototype pollution by checking keys for dangerous property names.
26
34
  * Throws if any restricted prototype properties are found in the keys array.
@@ -30,4 +38,14 @@ export default class Valid {
30
38
  */
31
39
  static prototypePollutionProtection(keys: Array<string>): void;
32
40
  }
41
+ /**
42
+ * Options for type validation methods.
43
+ */
44
+ export type TypeValidationOptions = {
45
+ /**
46
+ * - Whether empty values are allowed
47
+ */
48
+ allowEmpty?: boolean;
49
+ };
50
+ import Sass from "./Sass.js";
33
51
  //# sourceMappingURL=Valid.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Valid.d.ts","sourceRoot":"","sources":["../../../src/browser/lib/Valid.js"],"names":[],"mappings":"AAWA;;GAEG;AACH;IACE;;;;;;OAMG;IACH,mBAJW,OAAO,QACP,MAAM,YACN,MAAM,QAOhB;IAED;;;;;;;;OAQG;IACH,yBANW,OAAO,WACP,MAAM,QAEN,MAAM,QAkBhB;IAED,kCAAmE;IAEnE;;;;;;OAMG;IACH,0CAHW,KAAK,CAAC,MAAM,CAAC,QAYvB;CACF"}
1
+ {"version":3,"file":"Valid.d.ts","sourceRoot":"","sources":["../../../src/browser/lib/Valid.js"],"names":[],"mappings":"AAWA;;;;;GAKG;AAEH;;GAEG;AACH;IACE,0BAA0B;IAC1B,cADW,OAAO,IAAI,CACH;IAEnB;;;;;;OAMG;IACH,mBAJW,OAAO,QACP,MAAM,YACN,qBAAqB,QAY/B;IAED;;;;;;;;OAQG;IACH,yBANW,OAAO,WACP,MAAM,QAEN,MAAM,QAehB;IAED,2CAAkF;IAElF;;;;;;OAMG;IACH,0CAHW,KAAK,CAAC,MAAM,CAAC,QAYvB;CACF;;;;;;;;iBAvEa,OAAO;;iBARJ,WAAW"}
@@ -1,50 +1,11 @@
1
- /**
2
- * Options for type validation methods.
3
- *
4
- * @typedef {object} TypeValidationOptions
5
- * @property {boolean} [allowEmpty=true] - Whether empty values are allowed
6
- */
7
1
  /**
8
2
  * Validation utility class providing type checking and assertion methods.
3
+ * Inherits all behaviour from browser Valid; only the Sass class differs.
9
4
  */
10
- export default class Valid {
11
- static #restrictedProto: string[];
12
- /**
13
- * Validates a value against a type. Uses Data.isType.
14
- *
15
- * @param {unknown} value - The value to validate
16
- * @param {string} type - The expected type in the form of "object", "object[]", "object|object[]"
17
- * @param {TypeValidationOptions} [options] - Additional options for validation.
18
- */
19
- static type(value: unknown, type: string, options?: TypeValidationOptions): void;
20
- /**
21
- * Asserts a condition
22
- *
23
- * @param {boolean} condition - The condition to assert
24
- * @param {string} message - The message to display if the condition is not
25
- * met
26
- * @param {number} [arg] - The argument to display if the condition is not
27
- * met (optional)
28
- */
29
- static assert(condition: boolean, message: string, arg?: number): void;
30
- /**
31
- * Protects against prototype pollution by checking keys for dangerous
32
- * property names.
33
- *
34
- * Throws if any restricted prototype properties are found in the keys array.
35
- *
36
- * @param {Array<string>} keys - Array of property keys to validate
37
- * @throws {Sass} If any key matches restricted prototype properties (__proto__, constructor, prototype)
38
- */
39
- static prototypePollutionProtection(keys: Array<string>): void;
5
+ export default class Valid extends BrowserValid {
6
+ /** @type {typeof Sass} */
7
+ static _Sass: typeof Sass;
40
8
  }
41
- /**
42
- * Options for type validation methods.
43
- */
44
- export type TypeValidationOptions = {
45
- /**
46
- * - Whether empty values are allowed
47
- */
48
- allowEmpty?: boolean;
49
- };
9
+ import BrowserValid from "../../browser/lib/Valid.js";
10
+ import Sass from "./Sass.js";
50
11
  //# sourceMappingURL=Valid.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Valid.d.ts","sourceRoot":"","sources":["../../../src/node/lib/Valid.js"],"names":[],"mappings":"AAWA;;;;;GAKG;AAEH;;GAEG;AACH;IACE,kCAAmE;IAEnE;;;;;;OAMG;IACH,mBAJW,OAAO,QACP,MAAM,YACN,qBAAqB,QAY/B;IAED;;;;;;;;OAQG;IACH,yBANW,OAAO,WACP,MAAM,QAEN,MAAM,QAehB;IAED;;;;;;;;OAQG;IACH,0CAHW,KAAK,CAAC,MAAM,CAAC,QAYvB;CACF;;;;;;;;iBAtEa,OAAO"}
1
+ {"version":3,"file":"Valid.d.ts","sourceRoot":"","sources":["../../../src/node/lib/Valid.js"],"names":[],"mappings":"AAUA;;;GAGG;AACH;IACE,0BAA0B;IAC1B,cADW,OAAO,IAAI,CACH;CACpB;yBAVwB,4BAA4B;iBACpC,WAAW"}
@@ -1,4 +1,4 @@
1
- // @gesslar/toolkit v5.0.1 - ES module bundle
1
+ // @gesslar/toolkit v5.1.0 - ES module bundle
2
2
  /**
3
3
  * @file Tantrum.js
4
4
  *
@@ -317,21 +317,36 @@ class Sass extends Error {
317
317
  */
318
318
 
319
319
 
320
+ /**
321
+ * Options for type validation methods.
322
+ *
323
+ * @typedef {object} TypeValidationOptions
324
+ * @property {boolean} [allowEmpty=true] - Whether empty values are allowed
325
+ */
326
+
320
327
  /**
321
328
  * Validation utility class providing type checking and assertion methods.
322
329
  */
323
330
  class Valid {
331
+ /** @type {typeof Sass} */
332
+ static _Sass = Sass
333
+
324
334
  /**
325
335
  * Validates a value against a type. Uses Data.isType.
326
336
  *
327
337
  * @param {unknown} value - The value to validate
328
338
  * @param {string} type - The expected type in the form of "object", "object[]", "object|object[]"
329
- * @param {object} [options] - Additional options for validation.
339
+ * @param {TypeValidationOptions} [options] - Additional options for validation.
330
340
  */
331
341
  static type(value, type, options) {
332
- Valid.assert(
342
+ const expected = [type];
343
+
344
+ if(options?.allowEmpty !== true)
345
+ expected.push("[no empty values]");
346
+
347
+ this.assert(
333
348
  Data.isType(value, type, options),
334
- `Invalid type. Expected ${type}, got ${Data.typeOf(value)}`
349
+ `Invalid type. Expected ${expected.join(" ")}, got ${Data.typeOf(value)}`
335
350
  );
336
351
  }
337
352
 
@@ -345,23 +360,20 @@ class Valid {
345
360
  * met (optional)
346
361
  */
347
362
  static assert(condition, message, arg = null) {
348
- if(!Data.isType(condition, "boolean")) {
349
- throw Sass.new(`Condition must be a boolean, got ${condition}`)
350
- }
363
+ if(!Data.isType(condition, "boolean"))
364
+ throw this._Sass.new(`Condition must be a boolean, got ${condition}`)
351
365
 
352
- if(!Data.isType(message, "string")) {
353
- throw Sass.new(`Message must be a string, got ${message}`)
354
- }
366
+ if(!Data.isType(message, "string"))
367
+ throw this._Sass.new(`Message must be a string, got ${message}`)
355
368
 
356
- if(!(arg === null || arg === undefined || typeof arg === "number")) {
357
- throw Sass.new(`Arg must be a number, got ${arg}`)
358
- }
369
+ if(!(arg === null || arg === undefined || typeof arg === "number"))
370
+ throw this._Sass.new(`Arg must be a number, got ${arg}`)
359
371
 
360
372
  if(!condition)
361
- throw Sass.new(`${message}${arg ? `: ${arg}` : ""}`)
373
+ throw this._Sass.new(`${message}${arg ? `: ${arg}` : ""}`)
362
374
  }
363
375
 
364
- static #restrictedProto = ["__proto__", "constructor", "prototype"]
376
+ static #restrictedProto = Object.freeze(["__proto__", "constructor", "prototype"])
365
377
 
366
378
  /**
367
379
  * Protects against prototype pollution by checking keys for dangerous property names.
@@ -371,11 +383,11 @@ class Valid {
371
383
  * @throws {Sass} If any key matches restricted prototype properties (__proto__, constructor, prototype)
372
384
  */
373
385
  static prototypePollutionProtection(keys) {
374
- Valid.type(keys, "String[]");
386
+ this.type(keys, "String[]");
375
387
 
376
- const oopsIDidItAgain = Collection.intersection(this.#restrictedProto, keys);
388
+ const oopsIDidItAgain = Collection.intersection(Valid.#restrictedProto, keys);
377
389
 
378
- Valid.assert(
390
+ this.assert(
379
391
  oopsIDidItAgain.length === 0,
380
392
  `We don't pee in your pool, don't pollute ours with your ${String(oopsIDidItAgain)}`
381
393
  );
@@ -761,7 +773,7 @@ class TypeSpec {
761
773
  // Handle non-array values
762
774
  if(!isArray && !allowedArray) {
763
775
  if(valueType === allowedType)
764
- return allowEmpty || !empty
776
+ return Data.isBaseType(value, allowedType) && (allowEmpty || !empty)
765
777
 
766
778
  if(valueType === "Null" || valueType === "Undefined")
767
779
  return false
@@ -1,4 +1,4 @@
1
- // @gesslar/toolkit v5.0.1 - UMD bundle
1
+ // @gesslar/toolkit v5.1.0 - UMD bundle
2
2
  (function (global, factory) {
3
3
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
4
4
  typeof define === 'function' && define.amd ? define(['exports'], factory) :
@@ -323,21 +323,36 @@
323
323
  */
324
324
 
325
325
 
326
+ /**
327
+ * Options for type validation methods.
328
+ *
329
+ * @typedef {object} TypeValidationOptions
330
+ * @property {boolean} [allowEmpty=true] - Whether empty values are allowed
331
+ */
332
+
326
333
  /**
327
334
  * Validation utility class providing type checking and assertion methods.
328
335
  */
329
336
  class Valid {
337
+ /** @type {typeof Sass} */
338
+ static _Sass = Sass
339
+
330
340
  /**
331
341
  * Validates a value against a type. Uses Data.isType.
332
342
  *
333
343
  * @param {unknown} value - The value to validate
334
344
  * @param {string} type - The expected type in the form of "object", "object[]", "object|object[]"
335
- * @param {object} [options] - Additional options for validation.
345
+ * @param {TypeValidationOptions} [options] - Additional options for validation.
336
346
  */
337
347
  static type(value, type, options) {
338
- Valid.assert(
348
+ const expected = [type];
349
+
350
+ if(options?.allowEmpty !== true)
351
+ expected.push("[no empty values]");
352
+
353
+ this.assert(
339
354
  Data.isType(value, type, options),
340
- `Invalid type. Expected ${type}, got ${Data.typeOf(value)}`
355
+ `Invalid type. Expected ${expected.join(" ")}, got ${Data.typeOf(value)}`
341
356
  );
342
357
  }
343
358
 
@@ -351,23 +366,20 @@
351
366
  * met (optional)
352
367
  */
353
368
  static assert(condition, message, arg = null) {
354
- if(!Data.isType(condition, "boolean")) {
355
- throw Sass.new(`Condition must be a boolean, got ${condition}`)
356
- }
369
+ if(!Data.isType(condition, "boolean"))
370
+ throw this._Sass.new(`Condition must be a boolean, got ${condition}`)
357
371
 
358
- if(!Data.isType(message, "string")) {
359
- throw Sass.new(`Message must be a string, got ${message}`)
360
- }
372
+ if(!Data.isType(message, "string"))
373
+ throw this._Sass.new(`Message must be a string, got ${message}`)
361
374
 
362
- if(!(arg === null || arg === undefined || typeof arg === "number")) {
363
- throw Sass.new(`Arg must be a number, got ${arg}`)
364
- }
375
+ if(!(arg === null || arg === undefined || typeof arg === "number"))
376
+ throw this._Sass.new(`Arg must be a number, got ${arg}`)
365
377
 
366
378
  if(!condition)
367
- throw Sass.new(`${message}${arg ? `: ${arg}` : ""}`)
379
+ throw this._Sass.new(`${message}${arg ? `: ${arg}` : ""}`)
368
380
  }
369
381
 
370
- static #restrictedProto = ["__proto__", "constructor", "prototype"]
382
+ static #restrictedProto = Object.freeze(["__proto__", "constructor", "prototype"])
371
383
 
372
384
  /**
373
385
  * Protects against prototype pollution by checking keys for dangerous property names.
@@ -377,11 +389,11 @@
377
389
  * @throws {Sass} If any key matches restricted prototype properties (__proto__, constructor, prototype)
378
390
  */
379
391
  static prototypePollutionProtection(keys) {
380
- Valid.type(keys, "String[]");
392
+ this.type(keys, "String[]");
381
393
 
382
- const oopsIDidItAgain = Collection.intersection(this.#restrictedProto, keys);
394
+ const oopsIDidItAgain = Collection.intersection(Valid.#restrictedProto, keys);
383
395
 
384
- Valid.assert(
396
+ this.assert(
385
397
  oopsIDidItAgain.length === 0,
386
398
  `We don't pee in your pool, don't pollute ours with your ${String(oopsIDidItAgain)}`
387
399
  );
@@ -767,7 +779,7 @@
767
779
  // Handle non-array values
768
780
  if(!isArray && !allowedArray) {
769
781
  if(valueType === allowedType)
770
- return allowEmpty || !empty
782
+ return Data.isBaseType(value, allowedType) && (allowEmpty || !empty)
771
783
 
772
784
  if(valueType === "Null" || valueType === "Undefined")
773
785
  return false