@xyo-network/object 2.75.15 → 2.75.17
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/dist/docs.json +48 -48
- package/package.json +5 -5
- package/dist/browser/AnyObject.cjs +0 -19
- package/dist/browser/AnyObject.cjs.map +0 -1
- package/dist/browser/AnyObject.js +0 -1
- package/dist/browser/AnyObject.js.map +0 -1
- package/dist/browser/AsObjectFactory.cjs +0 -52
- package/dist/browser/AsObjectFactory.cjs.map +0 -1
- package/dist/browser/AsObjectFactory.js +0 -31
- package/dist/browser/AsObjectFactory.js.map +0 -1
- package/dist/browser/EmptyObject.cjs +0 -19
- package/dist/browser/EmptyObject.cjs.map +0 -1
- package/dist/browser/EmptyObject.js +0 -1
- package/dist/browser/EmptyObject.js.map +0 -1
- package/dist/browser/IsObjectFactory.cjs +0 -70
- package/dist/browser/IsObjectFactory.cjs.map +0 -1
- package/dist/browser/IsObjectFactory.js +0 -47
- package/dist/browser/IsObjectFactory.js.map +0 -1
- package/dist/browser/ObjectWrapper.cjs +0 -35
- package/dist/browser/ObjectWrapper.cjs.map +0 -1
- package/dist/browser/ObjectWrapper.js +0 -14
- package/dist/browser/ObjectWrapper.js.map +0 -1
- package/dist/browser/StringKeyObject.cjs +0 -19
- package/dist/browser/StringKeyObject.cjs.map +0 -1
- package/dist/browser/StringKeyObject.js +0 -1
- package/dist/browser/StringKeyObject.js.map +0 -1
- package/dist/browser/WithAdditional.cjs +0 -19
- package/dist/browser/WithAdditional.cjs.map +0 -1
- package/dist/browser/WithAdditional.js +0 -1
- package/dist/browser/WithAdditional.js.map +0 -1
- package/dist/browser/asObject.cjs +0 -83
- package/dist/browser/asObject.cjs.map +0 -1
- package/dist/browser/asObject.js +0 -60
- package/dist/browser/asObject.js.map +0 -1
- package/dist/browser/isObject.cjs +0 -52
- package/dist/browser/isObject.cjs.map +0 -1
- package/dist/browser/isObject.js +0 -29
- package/dist/browser/isObject.js.map +0 -1
- package/dist/browser/isType.cjs +0 -45
- package/dist/browser/isType.cjs.map +0 -1
- package/dist/browser/isType.js +0 -24
- package/dist/browser/isType.js.map +0 -1
- package/dist/node/AnyObject.js +0 -19
- package/dist/node/AnyObject.js.map +0 -1
- package/dist/node/AnyObject.mjs +0 -1
- package/dist/node/AnyObject.mjs.map +0 -1
- package/dist/node/AsObjectFactory.js +0 -56
- package/dist/node/AsObjectFactory.js.map +0 -1
- package/dist/node/AsObjectFactory.mjs +0 -31
- package/dist/node/AsObjectFactory.mjs.map +0 -1
- package/dist/node/EmptyObject.js +0 -19
- package/dist/node/EmptyObject.js.map +0 -1
- package/dist/node/EmptyObject.mjs +0 -1
- package/dist/node/EmptyObject.mjs.map +0 -1
- package/dist/node/IsObjectFactory.js +0 -74
- package/dist/node/IsObjectFactory.js.map +0 -1
- package/dist/node/IsObjectFactory.mjs +0 -47
- package/dist/node/IsObjectFactory.mjs.map +0 -1
- package/dist/node/ObjectWrapper.js +0 -39
- package/dist/node/ObjectWrapper.js.map +0 -1
- package/dist/node/ObjectWrapper.mjs +0 -14
- package/dist/node/ObjectWrapper.mjs.map +0 -1
- package/dist/node/StringKeyObject.js +0 -19
- package/dist/node/StringKeyObject.js.map +0 -1
- package/dist/node/StringKeyObject.mjs +0 -1
- package/dist/node/StringKeyObject.mjs.map +0 -1
- package/dist/node/WithAdditional.js +0 -19
- package/dist/node/WithAdditional.js.map +0 -1
- package/dist/node/WithAdditional.mjs +0 -1
- package/dist/node/WithAdditional.mjs.map +0 -1
- package/dist/node/asObject.js +0 -87
- package/dist/node/asObject.js.map +0 -1
- package/dist/node/asObject.mjs +0 -60
- package/dist/node/asObject.mjs.map +0 -1
- package/dist/node/isObject.js +0 -56
- package/dist/node/isObject.js.map +0 -1
- package/dist/node/isObject.mjs +0 -29
- package/dist/node/isObject.mjs.map +0 -1
- package/dist/node/isType.js +0 -49
- package/dist/node/isType.js.map +0 -1
- package/dist/node/isType.mjs +0 -24
- package/dist/node/isType.mjs.map +0 -1
package/dist/node/isObject.mjs
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
// src/isType.ts
|
|
2
|
-
var isType = (value, expectedType) => {
|
|
3
|
-
const typeofValue = typeof value;
|
|
4
|
-
switch (expectedType) {
|
|
5
|
-
case "array":
|
|
6
|
-
return Array.isArray(value);
|
|
7
|
-
case "null":
|
|
8
|
-
return value === null;
|
|
9
|
-
case "undefined":
|
|
10
|
-
return value === void 0;
|
|
11
|
-
case "object": {
|
|
12
|
-
if (value === null) {
|
|
13
|
-
return false;
|
|
14
|
-
}
|
|
15
|
-
return typeofValue === "object" && !Array.isArray(value);
|
|
16
|
-
}
|
|
17
|
-
default:
|
|
18
|
-
return typeofValue === expectedType;
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
// src/isObject.ts
|
|
23
|
-
var isObject = (value) => {
|
|
24
|
-
return isType(value, "object");
|
|
25
|
-
};
|
|
26
|
-
export {
|
|
27
|
-
isObject
|
|
28
|
-
};
|
|
29
|
-
//# sourceMappingURL=isObject.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/isType.ts","../../src/isObject.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n\nexport type FieldType = 'string' | 'number' | 'object' | 'symbol' | 'symbol' | 'undefined' | 'null' | 'array' | 'function'\n\nexport type ObjectTypeShape = Record<string | number | symbol, FieldType>\n\nexport const isType = (value: unknown, expectedType: FieldType) => {\n const typeofValue = typeof value\n switch (expectedType) {\n case 'array':\n return Array.isArray(value)\n case 'null':\n return value === null\n case 'undefined':\n return value === undefined\n case 'object': {\n //nulls resolve to objects, so exclude them\n if (value === null) {\n return false\n }\n //arrays resolve to objects, so exclude them\n return typeofValue === 'object' && !Array.isArray(value)\n }\n default:\n return typeofValue === expectedType\n }\n}\n","import { isType } from './isType'\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const isObject = (value: any): value is Record<string | number | symbol, any> => {\n return isType(value, 'object')\n}\n"],"mappings":";AAMO,IAAM,SAAS,CAAC,OAAgB,iBAA4B;AACjE,QAAM,cAAc,OAAO;AAC3B,UAAQ,cAAc;AAAA,IACpB,KAAK;AACH,aAAO,MAAM,QAAQ,KAAK;AAAA,IAC5B,KAAK;AACH,aAAO,UAAU;AAAA,IACnB,KAAK;AACH,aAAO,UAAU;AAAA,IACnB,KAAK,UAAU;AAEb,UAAI,UAAU,MAAM;AAClB,eAAO;AAAA,MACT;AAEA,aAAO,gBAAgB,YAAY,CAAC,MAAM,QAAQ,KAAK;AAAA,IACzD;AAAA,IACA;AACE,aAAO,gBAAgB;AAAA,EAC3B;AACF;;;ACvBO,IAAM,WAAW,CAAC,UAA+D;AACtF,SAAO,OAAO,OAAO,QAAQ;AAC/B;","names":[]}
|
package/dist/node/isType.js
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/isType.ts
|
|
21
|
-
var isType_exports = {};
|
|
22
|
-
__export(isType_exports, {
|
|
23
|
-
isType: () => isType
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(isType_exports);
|
|
26
|
-
var isType = (value, expectedType) => {
|
|
27
|
-
const typeofValue = typeof value;
|
|
28
|
-
switch (expectedType) {
|
|
29
|
-
case "array":
|
|
30
|
-
return Array.isArray(value);
|
|
31
|
-
case "null":
|
|
32
|
-
return value === null;
|
|
33
|
-
case "undefined":
|
|
34
|
-
return value === void 0;
|
|
35
|
-
case "object": {
|
|
36
|
-
if (value === null) {
|
|
37
|
-
return false;
|
|
38
|
-
}
|
|
39
|
-
return typeofValue === "object" && !Array.isArray(value);
|
|
40
|
-
}
|
|
41
|
-
default:
|
|
42
|
-
return typeofValue === expectedType;
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
46
|
-
0 && (module.exports = {
|
|
47
|
-
isType
|
|
48
|
-
});
|
|
49
|
-
//# sourceMappingURL=isType.js.map
|
package/dist/node/isType.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/isType.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n\nexport type FieldType = 'string' | 'number' | 'object' | 'symbol' | 'symbol' | 'undefined' | 'null' | 'array' | 'function'\n\nexport type ObjectTypeShape = Record<string | number | symbol, FieldType>\n\nexport const isType = (value: unknown, expectedType: FieldType) => {\n const typeofValue = typeof value\n switch (expectedType) {\n case 'array':\n return Array.isArray(value)\n case 'null':\n return value === null\n case 'undefined':\n return value === undefined\n case 'object': {\n //nulls resolve to objects, so exclude them\n if (value === null) {\n return false\n }\n //arrays resolve to objects, so exclude them\n return typeofValue === 'object' && !Array.isArray(value)\n }\n default:\n return typeofValue === expectedType\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAMO,IAAM,SAAS,CAAC,OAAgB,iBAA4B;AACjE,QAAM,cAAc,OAAO;AAC3B,UAAQ,cAAc;AAAA,IACpB,KAAK;AACH,aAAO,MAAM,QAAQ,KAAK;AAAA,IAC5B,KAAK;AACH,aAAO,UAAU;AAAA,IACnB,KAAK;AACH,aAAO,UAAU;AAAA,IACnB,KAAK,UAAU;AAEb,UAAI,UAAU,MAAM;AAClB,eAAO;AAAA,MACT;AAEA,aAAO,gBAAgB,YAAY,CAAC,MAAM,QAAQ,KAAK;AAAA,IACzD;AAAA,IACA;AACE,aAAO,gBAAgB;AAAA,EAC3B;AACF;","names":[]}
|
package/dist/node/isType.mjs
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
// src/isType.ts
|
|
2
|
-
var isType = (value, expectedType) => {
|
|
3
|
-
const typeofValue = typeof value;
|
|
4
|
-
switch (expectedType) {
|
|
5
|
-
case "array":
|
|
6
|
-
return Array.isArray(value);
|
|
7
|
-
case "null":
|
|
8
|
-
return value === null;
|
|
9
|
-
case "undefined":
|
|
10
|
-
return value === void 0;
|
|
11
|
-
case "object": {
|
|
12
|
-
if (value === null) {
|
|
13
|
-
return false;
|
|
14
|
-
}
|
|
15
|
-
return typeofValue === "object" && !Array.isArray(value);
|
|
16
|
-
}
|
|
17
|
-
default:
|
|
18
|
-
return typeofValue === expectedType;
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
export {
|
|
22
|
-
isType
|
|
23
|
-
};
|
|
24
|
-
//# sourceMappingURL=isType.mjs.map
|
package/dist/node/isType.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/isType.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n\nexport type FieldType = 'string' | 'number' | 'object' | 'symbol' | 'symbol' | 'undefined' | 'null' | 'array' | 'function'\n\nexport type ObjectTypeShape = Record<string | number | symbol, FieldType>\n\nexport const isType = (value: unknown, expectedType: FieldType) => {\n const typeofValue = typeof value\n switch (expectedType) {\n case 'array':\n return Array.isArray(value)\n case 'null':\n return value === null\n case 'undefined':\n return value === undefined\n case 'object': {\n //nulls resolve to objects, so exclude them\n if (value === null) {\n return false\n }\n //arrays resolve to objects, so exclude them\n return typeofValue === 'object' && !Array.isArray(value)\n }\n default:\n return typeofValue === expectedType\n }\n}\n"],"mappings":";AAMO,IAAM,SAAS,CAAC,OAAgB,iBAA4B;AACjE,QAAM,cAAc,OAAO;AAC3B,UAAQ,cAAc;AAAA,IACpB,KAAK;AACH,aAAO,MAAM,QAAQ,KAAK;AAAA,IAC5B,KAAK;AACH,aAAO,UAAU;AAAA,IACnB,KAAK;AACH,aAAO,UAAU;AAAA,IACnB,KAAK,UAAU;AAEb,UAAI,UAAU,MAAM;AAClB,eAAO;AAAA,MACT;AAEA,aAAO,gBAAgB,YAAY,CAAC,MAAM,QAAQ,KAAK;AAAA,IACzD;AAAA,IACA;AACE,aAAO,gBAAgB;AAAA,EAC3B;AACF;","names":[]}
|