type-tls 3.11.0 → 3.14.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/dist/async.d.ts +6 -0
- package/dist/base.d.ts +20 -1
- package/dist/index.iife.js +1 -0
- package/dist/index.js +130 -0
- package/dist/index.umd.cjs +1 -0
- package/dist/member.d.ts +1 -1
- package/package.json +9 -8
- package/dist/type-tls.iife.js +0 -1
- package/dist/type-tls.js +0 -153
- package/dist/type-tls.umd.cjs +0 -1
package/dist/async.d.ts
CHANGED
package/dist/base.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* @packageDocumentation
|
|
7
7
|
*/
|
|
8
|
-
import { AnyFunction } from "./function";
|
|
8
|
+
import type { AnyFunction } from "./function";
|
|
9
9
|
/**
|
|
10
10
|
* 判断目标是否是对象类型
|
|
11
11
|
*
|
|
@@ -18,6 +18,25 @@ import { AnyFunction } from "./function";
|
|
|
18
18
|
* @param target : any 目标对象
|
|
19
19
|
*/
|
|
20
20
|
export declare function isObject(target: any): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* 判断目标是否是简单对象(纯粹的数据对象)
|
|
23
|
+
*
|
|
24
|
+
* @remarks
|
|
25
|
+
* 简单对象是指通过 `{}` 或 `new Object()` 创建的对象,或者是通过 `Object.create(null)` 创建的没有原型的对象。
|
|
26
|
+
* 简而言之,它不是任何自定义类(Class)的实例,仅作为存储数据的容器。
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* isPlainObject({}) // true
|
|
31
|
+
* isPlainObject(Object.create(null)) // true
|
|
32
|
+
* isPlainObject(new MyClass()) // false
|
|
33
|
+
* isPlainObject([]) // false
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* @param target - 目标对象
|
|
37
|
+
* @returns 如果是简单对象则返回 true,否则返回 false
|
|
38
|
+
*/
|
|
39
|
+
export declare function isPlainObject(target: any): boolean;
|
|
21
40
|
/**
|
|
22
41
|
* typeof 的返回类型
|
|
23
42
|
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var TypeTls=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){var t=typeof e;return e&&(t===`object`||t===`function`)}function n(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t==null||t===Object.prototype}function r(e){var t=e;return e!=null&&(t=e.constructor,t??=typeof e),t}function i(e){switch(e){case void 0:return`undefined`;case null:return`null`}let t=typeof e;switch(t){case`function`:return e.name;case`string`:return e;default:return t}}function a(e){return globalThis[e]}function o(e){return i(r(e))}function s(e){return e==null||t(e)?r(e):typeof e}function c(e){return i(s(e))}function l(e){var t=typeof e;return e==null||t!==`object`&&t!==`function`}function u(e){let t=e&&e.length;return Number.isInteger(e.length)&&t>=0}function d(e){return e&&typeof e[Symbol.iterator]==`function`}function f(e){return e&&typeof e.next==`function`}function p(e){return e==null?!0:typeof e==`string`?e===``||e.trim()===``:!1}function m(e){return e==null?!0:typeof e==`object`?u(e)?e.length===0:e instanceof Map||e instanceof Set?e.size===0:Reflect.ownKeys(e).length===0:!1}function h(e){return typeof e==`object`?m(e):p(e)}var g=/^[A-Za-z_$]+[\w$]*$/;function _(e){return g.test(e)}var v=/(^\s*(async\s+)?\s*(\b[A-Za-z_$]+[\w$]*\b)\s*=>)|(^\s*(async\s+)?\s*\(\s*(\b[A-Za-z_$]+[\w$]*\b)?\s*(,\s*(\b[A-Za-z_$]+[\w$]*\b)\s*)*\)\s*=>)/;function y(e){let t=e.toString();return v.test(t)}var b=globalThis.AsyncFunction??async function(){}.constructor;function x(e){return e instanceof b}var S=globalThis.GeneratorFunction??function*(){}.constructor;function C(e){return e instanceof S}var w=globalThis.AsyncGeneratorFunction??async function*(){}.constructor;function T(e){return e instanceof w}var E=/(^\s*(async\s+)?function\s*(\s|\*)\s*)[A-Za-z_$]+[\w$]*(\s*\()/;function D(e){if(e.name){let t=e.toString();return!E.test(t)}return!0}function O(e){return Array.isArray(e)?e:e==null?[]:[e]}function k(e){for(let[t,n]of Object.entries(e))e[t]=Array.isArray(n)?n:n==null?[]:[n];return e}function A(){return function(e){return e}}function j(e,t){return e instanceof Promise?e.then(e=>t(e,!1,void 0),e=>t(void 0,!0,e)):t(e,!1,void 0)}var M=function(e){return e.equal=`equal`,e.intersect=`intersect`,e.intersectEqual=`intersectEqual`,e}({});return(function(e){function t(e){let t;switch(e){case M.equal:t=((e,t)=>e===t);case M.intersect:t=((e,t)=>e&t);default:t=((e,t)=>(e&t)===e)}return t}e.getEqualFun=t})(M||={}),Object.defineProperty(e,`BitFlagEqualTestType`,{enumerable:!0,get:function(){return M}}),e.formatAsArray=O,e.formatMemberAsArray=k,e.getExactTypeNameOf=c,e.getExactTypeOf=s,e.getNameOfType=i,e.getTypeByName=a,e.getTypeNameOf=o,e.getTypeOf=r,e.isAnonymousFunction=D,e.isArrayLike=u,e.isArrowFunction=y,e.isAsyncFunction=x,e.isAsyncGeneratorFunction=T,e.isBaseType=l,e.isEmptyObject=m,e.isEmptyValue=h,e.isEmptyValue_Base=p,e.isGeneratorFunction=C,e.isIdentifier=_,e.isIterable=d,e.isIterator=f,e.isObject=t,e.isPlainObject=n,e.patchType=A,e.waitAsyncable=j,e})({});
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
//#region src/base.ts
|
|
2
|
+
function e(e) {
|
|
3
|
+
var t = typeof e;
|
|
4
|
+
return e && (t === "object" || t === "function");
|
|
5
|
+
}
|
|
6
|
+
function t(e) {
|
|
7
|
+
if (typeof e != "object" || !e) return !1;
|
|
8
|
+
let t = Object.getPrototypeOf(e);
|
|
9
|
+
return t == null || t === Object.prototype;
|
|
10
|
+
}
|
|
11
|
+
function n(e) {
|
|
12
|
+
var t = e;
|
|
13
|
+
return e != null && (t = e.constructor, t ??= typeof e), t;
|
|
14
|
+
}
|
|
15
|
+
function r(e) {
|
|
16
|
+
switch (e) {
|
|
17
|
+
case void 0: return "undefined";
|
|
18
|
+
case null: return "null";
|
|
19
|
+
}
|
|
20
|
+
let t = typeof e;
|
|
21
|
+
switch (t) {
|
|
22
|
+
case "function": return e.name;
|
|
23
|
+
case "string": return e;
|
|
24
|
+
default: return t;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function i(e) {
|
|
28
|
+
return globalThis[e];
|
|
29
|
+
}
|
|
30
|
+
function a(e) {
|
|
31
|
+
return r(n(e));
|
|
32
|
+
}
|
|
33
|
+
function o(t) {
|
|
34
|
+
return t == null || e(t) ? n(t) : typeof t;
|
|
35
|
+
}
|
|
36
|
+
function s(e) {
|
|
37
|
+
return r(o(e));
|
|
38
|
+
}
|
|
39
|
+
function c(e) {
|
|
40
|
+
var t = typeof e;
|
|
41
|
+
return e == null || t !== "object" && t !== "function";
|
|
42
|
+
}
|
|
43
|
+
function l(e) {
|
|
44
|
+
let t = e && e.length;
|
|
45
|
+
return Number.isInteger(e.length) && t >= 0;
|
|
46
|
+
}
|
|
47
|
+
function u(e) {
|
|
48
|
+
return e && typeof e[Symbol.iterator] == "function";
|
|
49
|
+
}
|
|
50
|
+
function d(e) {
|
|
51
|
+
return e && typeof e.next == "function";
|
|
52
|
+
}
|
|
53
|
+
function f(e) {
|
|
54
|
+
return e == null ? !0 : typeof e == "string" ? e === "" || e.trim() === "" : !1;
|
|
55
|
+
}
|
|
56
|
+
function p(e) {
|
|
57
|
+
return e == null ? !0 : typeof e == "object" ? l(e) ? e.length === 0 : e instanceof Map || e instanceof Set ? e.size === 0 : Reflect.ownKeys(e).length === 0 : !1;
|
|
58
|
+
}
|
|
59
|
+
function m(e) {
|
|
60
|
+
return typeof e == "object" ? p(e) : f(e);
|
|
61
|
+
}
|
|
62
|
+
//#endregion
|
|
63
|
+
//#region src/function.ts
|
|
64
|
+
var h = /^[A-Za-z_$]+[\w$]*$/;
|
|
65
|
+
function g(e) {
|
|
66
|
+
return h.test(e);
|
|
67
|
+
}
|
|
68
|
+
var _ = /(^\s*(async\s+)?\s*(\b[A-Za-z_$]+[\w$]*\b)\s*=>)|(^\s*(async\s+)?\s*\(\s*(\b[A-Za-z_$]+[\w$]*\b)?\s*(,\s*(\b[A-Za-z_$]+[\w$]*\b)\s*)*\)\s*=>)/;
|
|
69
|
+
function v(e) {
|
|
70
|
+
let t = e.toString();
|
|
71
|
+
return _.test(t);
|
|
72
|
+
}
|
|
73
|
+
var y = globalThis.AsyncFunction ?? async function() {}.constructor;
|
|
74
|
+
function b(e) {
|
|
75
|
+
return e instanceof y;
|
|
76
|
+
}
|
|
77
|
+
var x = globalThis.GeneratorFunction ?? function* () {}.constructor;
|
|
78
|
+
function S(e) {
|
|
79
|
+
return e instanceof x;
|
|
80
|
+
}
|
|
81
|
+
var C = globalThis.AsyncGeneratorFunction ?? async function* () {}.constructor;
|
|
82
|
+
function w(e) {
|
|
83
|
+
return e instanceof C;
|
|
84
|
+
}
|
|
85
|
+
var T = /(^\s*(async\s+)?function\s*(\s|\*)\s*)[A-Za-z_$]+[\w$]*(\s*\()/;
|
|
86
|
+
function E(e) {
|
|
87
|
+
if (e.name) {
|
|
88
|
+
let t = e.toString();
|
|
89
|
+
return !T.test(t);
|
|
90
|
+
}
|
|
91
|
+
return !0;
|
|
92
|
+
}
|
|
93
|
+
//#endregion
|
|
94
|
+
//#region src/member.ts
|
|
95
|
+
function D(e) {
|
|
96
|
+
return Array.isArray(e) ? e : e == null ? [] : [e];
|
|
97
|
+
}
|
|
98
|
+
function O(e) {
|
|
99
|
+
for (let [t, n] of Object.entries(e)) e[t] = Array.isArray(n) ? n : n == null ? [] : [n];
|
|
100
|
+
return e;
|
|
101
|
+
}
|
|
102
|
+
function k() {
|
|
103
|
+
return function(e) {
|
|
104
|
+
return e;
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
//#endregion
|
|
108
|
+
//#region src/async.ts
|
|
109
|
+
function A(e, t) {
|
|
110
|
+
return e instanceof Promise ? e.then((e) => t(e, !1, void 0), (e) => t(void 0, !0, e)) : t(e, !1, void 0);
|
|
111
|
+
}
|
|
112
|
+
//#endregion
|
|
113
|
+
//#region src/other.ts
|
|
114
|
+
var j = /* @__PURE__ */ function(e) {
|
|
115
|
+
return e.equal = "equal", e.intersect = "intersect", e.intersectEqual = "intersectEqual", e;
|
|
116
|
+
}({});
|
|
117
|
+
(function(e) {
|
|
118
|
+
function t(e) {
|
|
119
|
+
let t;
|
|
120
|
+
switch (e) {
|
|
121
|
+
case j.equal: t = ((e, t) => e === t);
|
|
122
|
+
case j.intersect: t = ((e, t) => e & t);
|
|
123
|
+
default: t = ((e, t) => (e & t) === e);
|
|
124
|
+
}
|
|
125
|
+
return t;
|
|
126
|
+
}
|
|
127
|
+
e.getEqualFun = t;
|
|
128
|
+
})(j ||= {});
|
|
129
|
+
//#endregion
|
|
130
|
+
export { j as BitFlagEqualTestType, D as formatAsArray, O as formatMemberAsArray, s as getExactTypeNameOf, o as getExactTypeOf, r as getNameOfType, i as getTypeByName, a as getTypeNameOf, n as getTypeOf, E as isAnonymousFunction, l as isArrayLike, v as isArrowFunction, b as isAsyncFunction, w as isAsyncGeneratorFunction, c as isBaseType, p as isEmptyObject, m as isEmptyValue, f as isEmptyValue_Base, S as isGeneratorFunction, g as isIdentifier, u as isIterable, d as isIterator, e as isObject, t as isPlainObject, k as patchType, A as waitAsyncable };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports):typeof define==`function`&&define.amd?define([`exports`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.TypeTls={}))})(this,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){var t=typeof e;return e&&(t===`object`||t===`function`)}function n(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t==null||t===Object.prototype}function r(e){var t=e;return e!=null&&(t=e.constructor,t??=typeof e),t}function i(e){switch(e){case void 0:return`undefined`;case null:return`null`}let t=typeof e;switch(t){case`function`:return e.name;case`string`:return e;default:return t}}function a(e){return globalThis[e]}function o(e){return i(r(e))}function s(e){return e==null||t(e)?r(e):typeof e}function c(e){return i(s(e))}function l(e){var t=typeof e;return e==null||t!==`object`&&t!==`function`}function u(e){let t=e&&e.length;return Number.isInteger(e.length)&&t>=0}function d(e){return e&&typeof e[Symbol.iterator]==`function`}function f(e){return e&&typeof e.next==`function`}function p(e){return e==null?!0:typeof e==`string`?e===``||e.trim()===``:!1}function m(e){return e==null?!0:typeof e==`object`?u(e)?e.length===0:e instanceof Map||e instanceof Set?e.size===0:Reflect.ownKeys(e).length===0:!1}function h(e){return typeof e==`object`?m(e):p(e)}var g=/^[A-Za-z_$]+[\w$]*$/;function _(e){return g.test(e)}var v=/(^\s*(async\s+)?\s*(\b[A-Za-z_$]+[\w$]*\b)\s*=>)|(^\s*(async\s+)?\s*\(\s*(\b[A-Za-z_$]+[\w$]*\b)?\s*(,\s*(\b[A-Za-z_$]+[\w$]*\b)\s*)*\)\s*=>)/;function y(e){let t=e.toString();return v.test(t)}var b=globalThis.AsyncFunction??async function(){}.constructor;function x(e){return e instanceof b}var S=globalThis.GeneratorFunction??function*(){}.constructor;function C(e){return e instanceof S}var w=globalThis.AsyncGeneratorFunction??async function*(){}.constructor;function T(e){return e instanceof w}var E=/(^\s*(async\s+)?function\s*(\s|\*)\s*)[A-Za-z_$]+[\w$]*(\s*\()/;function D(e){if(e.name){let t=e.toString();return!E.test(t)}return!0}function O(e){return Array.isArray(e)?e:e==null?[]:[e]}function k(e){for(let[t,n]of Object.entries(e))e[t]=Array.isArray(n)?n:n==null?[]:[n];return e}function A(){return function(e){return e}}function j(e,t){return e instanceof Promise?e.then(e=>t(e,!1,void 0),e=>t(void 0,!0,e)):t(e,!1,void 0)}var M=function(e){return e.equal=`equal`,e.intersect=`intersect`,e.intersectEqual=`intersectEqual`,e}({});(function(e){function t(e){let t;switch(e){case M.equal:t=((e,t)=>e===t);case M.intersect:t=((e,t)=>e&t);default:t=((e,t)=>(e&t)===e)}return t}e.getEqualFun=t})(M||={}),Object.defineProperty(e,`BitFlagEqualTestType`,{enumerable:!0,get:function(){return M}}),e.formatAsArray=O,e.formatMemberAsArray=k,e.getExactTypeNameOf=c,e.getExactTypeOf=s,e.getNameOfType=i,e.getTypeByName=a,e.getTypeNameOf=o,e.getTypeOf=r,e.isAnonymousFunction=D,e.isArrayLike=u,e.isArrowFunction=y,e.isAsyncFunction=x,e.isAsyncGeneratorFunction=T,e.isBaseType=l,e.isEmptyObject=m,e.isEmptyValue=h,e.isEmptyValue_Base=p,e.isGeneratorFunction=C,e.isIdentifier=_,e.isIterable=d,e.isIterator=f,e.isObject=t,e.isPlainObject=n,e.patchType=A,e.waitAsyncable=j});
|
package/dist/member.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "type-tls",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.14.0",
|
|
4
4
|
"description": "type-tls 封装了与类型相关的工具,比如:获取数据的类型 或 类型名字、判断数据的类型 等",
|
|
5
|
-
"main": "./dist/
|
|
6
|
-
"module": "./dist/
|
|
5
|
+
"main": "./dist/index.umd.cjs",
|
|
6
|
+
"module": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
7
8
|
"exports": {
|
|
8
|
-
"require": "./dist/type-tls.umd.cjs",
|
|
9
9
|
"types": "./dist/index.d.ts",
|
|
10
|
-
"
|
|
10
|
+
"require": "./dist/index.umd.cjs",
|
|
11
|
+
"import": "./dist/index.js"
|
|
11
12
|
},
|
|
12
|
-
"types": "./dist/index.d.ts",
|
|
13
13
|
"type": "module",
|
|
14
14
|
"sideEffects": false,
|
|
15
15
|
"homepage": "https://github.com/GuoBinyong/type-tls#readme",
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
"@microsoft/api-documenter": "latest",
|
|
44
44
|
"@microsoft/api-extractor": "latest",
|
|
45
45
|
"build-tls": "latest",
|
|
46
|
+
"cross-env": "latest",
|
|
46
47
|
"dts-bundle-generator": "latest",
|
|
47
48
|
"package-tls": "latest",
|
|
48
49
|
"rollup-plugin-preserve-shebang": "latest",
|
|
@@ -56,8 +57,8 @@
|
|
|
56
57
|
"dev:bin": "vite-node src/bin.ts",
|
|
57
58
|
"build": "vite build",
|
|
58
59
|
"bunch": "vite build --mode bunch",
|
|
59
|
-
"debug": "debug=true vite build",
|
|
60
|
-
"debug:bunch": "debug=true vite build --mode bunch",
|
|
60
|
+
"debug": "cross-env debug=true vite build",
|
|
61
|
+
"debug:bunch": "cross-env debug=true vite build --mode bunch",
|
|
61
62
|
"exe": "bun build --compile --minify ./src/bin.ts --outfile ./exe/library-vite-template",
|
|
62
63
|
"exe:win": "bun build --compile --minify --target=bun-windows-x64 ./src/bin.ts --outfile ./exe/library-vite-template_win",
|
|
63
64
|
"exe:linux": "bun build --compile --minify --target=bun-linux-x64 ./src/bin.ts --outfile ./exe/library-vite-template_linux",
|
package/dist/type-tls.iife.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var TypeTls=function(e){"use strict";function s(n){var t=typeof n;return n&&(t==="object"||t==="function")}function o(n){var t=n;return n!=null&&(t=n.constructor,t==null&&(t=typeof n)),t}function f(n){switch(n){case void 0:return"undefined";case null:return"null"}let t=typeof n;switch(t){case"function":return n.name;case"string":return n;default:return t}}function g(n){return globalThis[n]}function m(n){let t=o(n);return f(t)}function a(n){return n==null||s(n)?o(n):typeof n}function T(n){var t=a(n);return f(t)}function b(n){var t=typeof n;return n==null||t!=="object"&&t!=="function"}function y(n){let t=n&&n.length;return Number.isInteger(n.length)&&t>=0}function F(n){return n&&typeof n[Symbol.iterator]=="function"}function O(n){return n&&typeof n.next=="function"}function l(n){return n==null?!0:typeof n=="string"?n===""||n.trim()==="":!1}function A(n){return n==null?!0:typeof n!="object"?!1:y(n)?n.length===0:n instanceof Map||n instanceof Set?n.size===0:Reflect.ownKeys(n).length===0}function E(n){return typeof n=="object"?A(n):l(n)}const h=/^[A-Za-z_$]+[\w$]*$/;function p(n){return h.test(n)}const w=/(^\s*(async\s+)?\s*(\b[A-Za-z_$]+[\w$]*\b)\s*=>)|(^\s*(async\s+)?\s*\(\s*(\b[A-Za-z_$]+[\w$]*\b)?\s*(,\s*(\b[A-Za-z_$]+[\w$]*\b)\s*)*\)\s*=>)/;function d(n){const t=n.toString();return w.test(t)}const j=globalThis.AsyncFunction??(async function(){}).constructor;function S(n){return n instanceof j}const $=globalThis.GeneratorFunction??(function*(){}).constructor;function N(n){return n instanceof $}const q=globalThis.AsyncGeneratorFunction??(async function*(){}).constructor;function I(n){return n instanceof q}const G=/(^\s*(async\s+)?function\s*(\s|\*)\s*)[A-Za-z_$]+[\w$]*(\s*\()/;function B(n){if(n.name){const t=n.toString();return!G.test(t)}return!0}function _(n){return Array.isArray(n)?n:n==null?[]:[n]}function z(n){for(const[t,r]of Object.entries(n))n[t]=Array.isArray(r)?r:r==null?[]:[r];return n}function Z(){return function(n){return n}}function M(n,t){return n instanceof Promise?n.then(r=>t(r,!1,void 0),r=>t(void 0,!0,r)):t(n,!1,void 0)}return e.BitFlagEqualTestType=(n=>(n.equal="equal",n.intersect="intersect",n.intersectEqual="intersectEqual",n))(e.BitFlagEqualTestType||{}),(n=>{function t(r){let c;switch(r){case"equal":c=(i,u)=>i===u;case"intersect":c=(i,u)=>i&u;default:c=(i,u)=>(i&u)===i}return c}n.getEqualFun=t})(e.BitFlagEqualTestType||(e.BitFlagEqualTestType={})),e.formatAsArray=_,e.formatMemberAsArray=z,e.getExactTypeNameOf=T,e.getExactTypeOf=a,e.getNameOfType=f,e.getTypeByName=g,e.getTypeNameOf=m,e.getTypeOf=o,e.isAnonymousFunction=B,e.isArrayLike=y,e.isArrowFunction=d,e.isAsyncFunction=S,e.isAsyncGeneratorFunction=I,e.isBaseType=b,e.isEmptyObject=A,e.isEmptyValue=E,e.isEmptyValue_Base=l,e.isGeneratorFunction=N,e.isIdentifier=p,e.isIterable=F,e.isIterator=O,e.isObject=s,e.patchType=Z,e.waitAsyncable=M,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),e}({});
|
package/dist/type-tls.js
DELETED
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
function f(n) {
|
|
2
|
-
var t = typeof n;
|
|
3
|
-
return n && (t === "object" || t === "function");
|
|
4
|
-
}
|
|
5
|
-
function c(n) {
|
|
6
|
-
var t = n;
|
|
7
|
-
return n != null && (t = n.constructor, t == null && (t = typeof n)), t;
|
|
8
|
-
}
|
|
9
|
-
function s(n) {
|
|
10
|
-
switch (n) {
|
|
11
|
-
case void 0:
|
|
12
|
-
return "undefined";
|
|
13
|
-
case null:
|
|
14
|
-
return "null";
|
|
15
|
-
}
|
|
16
|
-
let t = typeof n;
|
|
17
|
-
switch (t) {
|
|
18
|
-
case "function":
|
|
19
|
-
return n.name;
|
|
20
|
-
case "string":
|
|
21
|
-
return n;
|
|
22
|
-
default:
|
|
23
|
-
return t;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
function w(n) {
|
|
27
|
-
return globalThis[n];
|
|
28
|
-
}
|
|
29
|
-
function $(n) {
|
|
30
|
-
let t = c(n);
|
|
31
|
-
return s(t);
|
|
32
|
-
}
|
|
33
|
-
function y(n) {
|
|
34
|
-
return n == null || f(n) ? c(n) : typeof n;
|
|
35
|
-
}
|
|
36
|
-
function O(n) {
|
|
37
|
-
var t = y(n);
|
|
38
|
-
return s(t);
|
|
39
|
-
}
|
|
40
|
-
function T(n) {
|
|
41
|
-
var t = typeof n;
|
|
42
|
-
return n == null || t !== "object" && t !== "function";
|
|
43
|
-
}
|
|
44
|
-
function a(n) {
|
|
45
|
-
let t = n && n.length;
|
|
46
|
-
return Number.isInteger(n.length) && t >= 0;
|
|
47
|
-
}
|
|
48
|
-
function E(n) {
|
|
49
|
-
return n && typeof n[Symbol.iterator] == "function";
|
|
50
|
-
}
|
|
51
|
-
function S(n) {
|
|
52
|
-
return n && typeof n.next == "function";
|
|
53
|
-
}
|
|
54
|
-
function l(n) {
|
|
55
|
-
return n == null ? !0 : typeof n == "string" ? n === "" || n.trim() === "" : !1;
|
|
56
|
-
}
|
|
57
|
-
function p(n) {
|
|
58
|
-
return n == null ? !0 : typeof n != "object" ? !1 : a(n) ? n.length === 0 : n instanceof Map || n instanceof Set ? n.size === 0 : Reflect.ownKeys(n).length === 0;
|
|
59
|
-
}
|
|
60
|
-
function d(n) {
|
|
61
|
-
return typeof n == "object" ? p(n) : l(n);
|
|
62
|
-
}
|
|
63
|
-
const A = /^[A-Za-z_$]+[\w$]*$/;
|
|
64
|
-
function j(n) {
|
|
65
|
-
return A.test(n);
|
|
66
|
-
}
|
|
67
|
-
const g = /(^\s*(async\s+)?\s*(\b[A-Za-z_$]+[\w$]*\b)\s*=>)|(^\s*(async\s+)?\s*\(\s*(\b[A-Za-z_$]+[\w$]*\b)?\s*(,\s*(\b[A-Za-z_$]+[\w$]*\b)\s*)*\)\s*=>)/;
|
|
68
|
-
function q(n) {
|
|
69
|
-
const t = n.toString();
|
|
70
|
-
return g.test(t);
|
|
71
|
-
}
|
|
72
|
-
const b = globalThis.AsyncFunction ?? (async function() {
|
|
73
|
-
}).constructor;
|
|
74
|
-
function x(n) {
|
|
75
|
-
return n instanceof b;
|
|
76
|
-
}
|
|
77
|
-
const m = globalThis.GeneratorFunction ?? (function* () {
|
|
78
|
-
}).constructor;
|
|
79
|
-
function z(n) {
|
|
80
|
-
return n instanceof m;
|
|
81
|
-
}
|
|
82
|
-
const h = globalThis.AsyncGeneratorFunction ?? (async function* () {
|
|
83
|
-
}).constructor;
|
|
84
|
-
function G(n) {
|
|
85
|
-
return n instanceof h;
|
|
86
|
-
}
|
|
87
|
-
const F = /(^\s*(async\s+)?function\s*(\s|\*)\s*)[A-Za-z_$]+[\w$]*(\s*\()/;
|
|
88
|
-
function I(n) {
|
|
89
|
-
if (n.name) {
|
|
90
|
-
const t = n.toString();
|
|
91
|
-
return !F.test(t);
|
|
92
|
-
}
|
|
93
|
-
return !0;
|
|
94
|
-
}
|
|
95
|
-
function N(n) {
|
|
96
|
-
return Array.isArray(n) ? n : n == null ? [] : [n];
|
|
97
|
-
}
|
|
98
|
-
function _(n) {
|
|
99
|
-
for (const [t, r] of Object.entries(n))
|
|
100
|
-
n[t] = Array.isArray(r) ? r : r == null ? [] : [r];
|
|
101
|
-
return n;
|
|
102
|
-
}
|
|
103
|
-
function Z() {
|
|
104
|
-
return function(n) {
|
|
105
|
-
return n;
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
function R(n, t) {
|
|
109
|
-
return n instanceof Promise ? n.then((r) => t(r, !1, void 0), (r) => t(void 0, !0, r)) : t(n, !1, void 0);
|
|
110
|
-
}
|
|
111
|
-
var i = /* @__PURE__ */ ((n) => (n.equal = "equal", n.intersect = "intersect", n.intersectEqual = "intersectEqual", n))(i || {});
|
|
112
|
-
((n) => {
|
|
113
|
-
function t(r) {
|
|
114
|
-
let u;
|
|
115
|
-
switch (r) {
|
|
116
|
-
case "equal":
|
|
117
|
-
u = (e, o) => e === o;
|
|
118
|
-
case "intersect":
|
|
119
|
-
u = (e, o) => e & o;
|
|
120
|
-
default:
|
|
121
|
-
u = (e, o) => (e & o) === e;
|
|
122
|
-
}
|
|
123
|
-
return u;
|
|
124
|
-
}
|
|
125
|
-
n.getEqualFun = t;
|
|
126
|
-
})(i || (i = {}));
|
|
127
|
-
export {
|
|
128
|
-
i as BitFlagEqualTestType,
|
|
129
|
-
N as formatAsArray,
|
|
130
|
-
_ as formatMemberAsArray,
|
|
131
|
-
O as getExactTypeNameOf,
|
|
132
|
-
y as getExactTypeOf,
|
|
133
|
-
s as getNameOfType,
|
|
134
|
-
w as getTypeByName,
|
|
135
|
-
$ as getTypeNameOf,
|
|
136
|
-
c as getTypeOf,
|
|
137
|
-
I as isAnonymousFunction,
|
|
138
|
-
a as isArrayLike,
|
|
139
|
-
q as isArrowFunction,
|
|
140
|
-
x as isAsyncFunction,
|
|
141
|
-
G as isAsyncGeneratorFunction,
|
|
142
|
-
T as isBaseType,
|
|
143
|
-
p as isEmptyObject,
|
|
144
|
-
d as isEmptyValue,
|
|
145
|
-
l as isEmptyValue_Base,
|
|
146
|
-
z as isGeneratorFunction,
|
|
147
|
-
j as isIdentifier,
|
|
148
|
-
E as isIterable,
|
|
149
|
-
S as isIterator,
|
|
150
|
-
f as isObject,
|
|
151
|
-
Z as patchType,
|
|
152
|
-
R as waitAsyncable
|
|
153
|
-
};
|
package/dist/type-tls.umd.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(function(t,i){typeof exports=="object"&&typeof module<"u"?i(exports):typeof define=="function"&&define.amd?define(["exports"],i):(t=typeof globalThis<"u"?globalThis:t||self,i(t.TypeTls={}))})(this,function(t){"use strict";function i(n){var e=typeof n;return n&&(e==="object"||e==="function")}function f(n){var e=n;return n!=null&&(e=n.constructor,e==null&&(e=typeof n)),e}function s(n){switch(n){case void 0:return"undefined";case null:return"null"}let e=typeof n;switch(e){case"function":return n.name;case"string":return n;default:return e}}function m(n){return globalThis[n]}function g(n){let e=f(n);return s(e)}function a(n){return n==null||i(n)?f(n):typeof n}function T(n){var e=a(n);return s(e)}function b(n){var e=typeof n;return n==null||e!=="object"&&e!=="function"}function y(n){let e=n&&n.length;return Number.isInteger(n.length)&&e>=0}function p(n){return n&&typeof n[Symbol.iterator]=="function"}function F(n){return n&&typeof n.next=="function"}function l(n){return n==null?!0:typeof n=="string"?n===""||n.trim()==="":!1}function A(n){return n==null?!0:typeof n!="object"?!1:y(n)?n.length===0:n instanceof Map||n instanceof Set?n.size===0:Reflect.ownKeys(n).length===0}function d(n){return typeof n=="object"?A(n):l(n)}const h=/^[A-Za-z_$]+[\w$]*$/;function O(n){return h.test(n)}const E=/(^\s*(async\s+)?\s*(\b[A-Za-z_$]+[\w$]*\b)\s*=>)|(^\s*(async\s+)?\s*\(\s*(\b[A-Za-z_$]+[\w$]*\b)?\s*(,\s*(\b[A-Za-z_$]+[\w$]*\b)\s*)*\)\s*=>)/;function w(n){const e=n.toString();return E.test(e)}const j=globalThis.AsyncFunction??(async function(){}).constructor;function S(n){return n instanceof j}const $=globalThis.GeneratorFunction??(function*(){}).constructor;function N(n){return n instanceof $}const q=globalThis.AsyncGeneratorFunction??(async function*(){}).constructor;function I(n){return n instanceof q}const G=/(^\s*(async\s+)?function\s*(\s|\*)\s*)[A-Za-z_$]+[\w$]*(\s*\()/;function B(n){if(n.name){const e=n.toString();return!G.test(e)}return!0}function _(n){return Array.isArray(n)?n:n==null?[]:[n]}function z(n){for(const[e,r]of Object.entries(n))n[e]=Array.isArray(r)?r:r==null?[]:[r];return n}function Z(){return function(n){return n}}function M(n,e){return n instanceof Promise?n.then(r=>e(r,!1,void 0),r=>e(void 0,!0,r)):e(n,!1,void 0)}t.BitFlagEqualTestType=(n=>(n.equal="equal",n.intersect="intersect",n.intersectEqual="intersectEqual",n))(t.BitFlagEqualTestType||{}),(n=>{function e(r){let o;switch(r){case"equal":o=(u,c)=>u===c;case"intersect":o=(u,c)=>u&c;default:o=(u,c)=>(u&c)===u}return o}n.getEqualFun=e})(t.BitFlagEqualTestType||(t.BitFlagEqualTestType={})),t.formatAsArray=_,t.formatMemberAsArray=z,t.getExactTypeNameOf=T,t.getExactTypeOf=a,t.getNameOfType=s,t.getTypeByName=m,t.getTypeNameOf=g,t.getTypeOf=f,t.isAnonymousFunction=B,t.isArrayLike=y,t.isArrowFunction=w,t.isAsyncFunction=S,t.isAsyncGeneratorFunction=I,t.isBaseType=b,t.isEmptyObject=A,t.isEmptyValue=d,t.isEmptyValue_Base=l,t.isGeneratorFunction=N,t.isIdentifier=O,t.isIterable=p,t.isIterator=F,t.isObject=i,t.patchType=Z,t.waitAsyncable=M,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})});
|