Build
This commit is contained in:
parent
9792a1863c
commit
8c7d71467f
16
dist/formulario.esm.js
vendored
16
dist/formulario.esm.js
vendored
@ -66,6 +66,15 @@ var TYPE;
|
|||||||
TYPE["UNDEFINED"] = "UNDEFINED";
|
TYPE["UNDEFINED"] = "UNDEFINED";
|
||||||
TYPE["NULL"] = "NULL";
|
TYPE["NULL"] = "NULL";
|
||||||
})(TYPE || (TYPE = {}));
|
})(TYPE || (TYPE = {}));
|
||||||
|
const constructorOf = (value) => {
|
||||||
|
return Object.getPrototypeOf(value).constructor;
|
||||||
|
};
|
||||||
|
function isRecord(value) {
|
||||||
|
return constructorOf(value) === Object && Object.keys(Object.getPrototypeOf(value)).length === 0;
|
||||||
|
}
|
||||||
|
function isRecordLike(value) {
|
||||||
|
return typeof value === 'object' && value !== null && (isRecord(value) || Array.isArray(value));
|
||||||
|
}
|
||||||
function typeOf(value) {
|
function typeOf(value) {
|
||||||
switch (typeof value) {
|
switch (typeof value) {
|
||||||
case 'bigint':
|
case 'bigint':
|
||||||
@ -92,16 +101,13 @@ function typeOf(value) {
|
|||||||
if (Array.isArray(value)) {
|
if (Array.isArray(value)) {
|
||||||
return TYPE.ARRAY;
|
return TYPE.ARRAY;
|
||||||
}
|
}
|
||||||
if (value.constructor.name === 'Object') {
|
if (isRecord(value)) {
|
||||||
return TYPE.RECORD;
|
return TYPE.RECORD;
|
||||||
}
|
}
|
||||||
return 'InstanceOf<' + value.constructor.name + '>';
|
return 'InstanceOf<' + constructorOf(value).name + '>';
|
||||||
}
|
}
|
||||||
throw new Error();
|
throw new Error();
|
||||||
}
|
}
|
||||||
function isRecordLike(value) {
|
|
||||||
return typeof value === 'object' && value !== null && ['Array', 'Object'].includes(value.constructor.name);
|
|
||||||
}
|
|
||||||
function isScalar(value) {
|
function isScalar(value) {
|
||||||
switch (typeof value) {
|
switch (typeof value) {
|
||||||
case 'bigint':
|
case 'bigint':
|
||||||
|
6
dist/formulario.min.js
vendored
6
dist/formulario.min.js
vendored
File diff suppressed because one or more lines are too long
16
dist/formulario.umd.js
vendored
16
dist/formulario.umd.js
vendored
@ -71,6 +71,15 @@
|
|||||||
TYPE["UNDEFINED"] = "UNDEFINED";
|
TYPE["UNDEFINED"] = "UNDEFINED";
|
||||||
TYPE["NULL"] = "NULL";
|
TYPE["NULL"] = "NULL";
|
||||||
})(TYPE || (TYPE = {}));
|
})(TYPE || (TYPE = {}));
|
||||||
|
const constructorOf = (value) => {
|
||||||
|
return Object.getPrototypeOf(value).constructor;
|
||||||
|
};
|
||||||
|
function isRecord(value) {
|
||||||
|
return constructorOf(value) === Object && Object.keys(Object.getPrototypeOf(value)).length === 0;
|
||||||
|
}
|
||||||
|
function isRecordLike(value) {
|
||||||
|
return typeof value === 'object' && value !== null && (isRecord(value) || Array.isArray(value));
|
||||||
|
}
|
||||||
function typeOf(value) {
|
function typeOf(value) {
|
||||||
switch (typeof value) {
|
switch (typeof value) {
|
||||||
case 'bigint':
|
case 'bigint':
|
||||||
@ -97,16 +106,13 @@
|
|||||||
if (Array.isArray(value)) {
|
if (Array.isArray(value)) {
|
||||||
return TYPE.ARRAY;
|
return TYPE.ARRAY;
|
||||||
}
|
}
|
||||||
if (value.constructor.name === 'Object') {
|
if (isRecord(value)) {
|
||||||
return TYPE.RECORD;
|
return TYPE.RECORD;
|
||||||
}
|
}
|
||||||
return 'InstanceOf<' + value.constructor.name + '>';
|
return 'InstanceOf<' + constructorOf(value).name + '>';
|
||||||
}
|
}
|
||||||
throw new Error();
|
throw new Error();
|
||||||
}
|
}
|
||||||
function isRecordLike(value) {
|
|
||||||
return typeof value === 'object' && value !== null && ['Array', 'Object'].includes(value.constructor.name);
|
|
||||||
}
|
|
||||||
function isScalar(value) {
|
function isScalar(value) {
|
||||||
switch (typeof value) {
|
switch (typeof value) {
|
||||||
case 'bigint':
|
case 'bigint':
|
||||||
|
Loading…
Reference in New Issue
Block a user