Comparing version 1.0.0-pre-98 to 1.0.0-pre-99
@@ -13,3 +13,3 @@ import { DryvArrayValidator } from './DryvArrayValidator'; | ||
} | ||
if (value instanceof Object) { | ||
if (value instanceof Object && !isSpecialType(value)) { | ||
return new DryvObjectValidator(value, session, parent, options, field); | ||
@@ -22,2 +22,40 @@ } | ||
} | ||
function isSpecialType(value) { | ||
return value === null || value === undefined | ||
? false | ||
: specialTypes.some((type) => value instanceof type); | ||
} | ||
const specialTypes = [ | ||
File, | ||
Blob, | ||
ArrayBuffer, | ||
DataView, | ||
Uint8Array, | ||
Uint16Array, | ||
Uint32Array, | ||
Int8Array, | ||
Int16Array, | ||
Int32Array, | ||
Float32Array, | ||
Float64Array, | ||
BigUint64Array, | ||
BigInt64Array, | ||
HTMLElement, | ||
SVGElement, | ||
Document, | ||
Window, | ||
WebAssembly.Module, | ||
WebAssembly.Instance, | ||
WebAssembly.Memory, | ||
WebAssembly.Table, | ||
Promise, | ||
Error, | ||
TypeError, | ||
RangeError, | ||
ReferenceError, | ||
SyntaxError, | ||
URIError, | ||
EvalError, | ||
Symbol | ||
]; | ||
//# sourceMappingURL=createValidator.js.map |
@@ -165,5 +165,5 @@ export class DryvValidator { | ||
toJSON() { | ||
return Object.assign(Object.assign({}, this), { value: this.value, path: this.path, text: this.text, hasError: this.hasError, hasWarning: this.hasWarning, isSuccess: this.isSuccess, uniquePath: this.uniquePath, _parent: undefined, _path: undefined, _rootModel: undefined, _rootValidator: undefined, _reactive: undefined, _initialValue: undefined, _ignoreChildChanges: undefined, _isReverting: undefined, _items: undefined, _uniquePath: undefined, rootValidator: undefined, rootModel: undefined, parent: undefined, model: undefined, proxy: undefined, session: undefined, options: undefined, transparentProxy: undefined }); | ||
return Object.assign(Object.assign({}, this), { value: this.value, path: this.path, text: this.text, hasError: this.hasError, hasWarning: this.hasWarning, isSuccess: this.isSuccess, uniquePath: this.uniquePath, __dryvValidator: undefined, _parent: undefined, _path: undefined, _rootModel: undefined, _rootValidator: undefined, _reactive: undefined, _initialValue: undefined, _ignoreChildChanges: undefined, _isReverting: undefined, _items: undefined, _uniquePath: undefined, rootValidator: undefined, rootModel: undefined, parent: undefined, model: undefined, proxy: undefined, session: undefined, options: undefined, transparentProxy: undefined }); | ||
} | ||
} | ||
//# sourceMappingURL=DryvValidator.js.map |
{ | ||
"name": "dryvjs", | ||
"version": "1.0.0-pre-98", | ||
"version": "1.0.0-pre-99", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "types": "dist/index.d.ts", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
90212
1362