type-tls 2.4.3 → 2.4.5
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 +9 -3
- package/dist/index.d.ts +501 -6
- package/dist/tsdoc-metadata.json +1 -1
- package/dist/type-tls.d.ts +63 -16
- package/dist/type-tls.mjs +180 -0
- package/dist/type-tls.umd.js +1 -1
- package/doc/{index.md → api/index.md} +1 -1
- package/doc/api/type-tls.arrayitemtype.md +13 -0
- package/doc/api/type-tls.keyofcontainsvalue.md +15 -0
- package/doc/api/type-tls.keyofnoncontainsvalue.md +15 -0
- package/doc/api/type-tls.keyofnonvalue.md +15 -0
- package/doc/{type-tls.keyofvalue.md → api/type-tls.keyofvalue.md} +1 -1
- package/doc/{type-tls.md → api/type-tls.md} +10 -0
- package/doc/{type-tls.waitasyncablecallback.md → api/type-tls.waitasyncablecallback.md} +3 -1
- package/doc//346/225/231/347/250/213.md +7 -0
- package/package.json +12 -12
- package/dist/async.d.ts +0 -28
- package/dist/base.d.ts +0 -190
- package/dist/buffer.d.ts +0 -1
- package/dist/extend.d.ts +0 -86
- package/dist/function.d.ts +0 -49
- package/dist/member.d.ts +0 -16
- package/dist/mixin.d.ts +0 -96
- package/dist/type-tls.es.js +0 -171
- /package/doc/{type-tls.anyfunction.md → api/type-tls.anyfunction.md} +0 -0
- /package/doc/{type-tls.classtype._new_.md → api/type-tls.classtype._new_.md} +0 -0
- /package/doc/{type-tls.classtype.md → api/type-tls.classtype.md} +0 -0
- /package/doc/{type-tls.createdefinemixin.md → api/type-tls.createdefinemixin.md} +0 -0
- /package/doc/{type-tls.createextendtarget.md → api/type-tls.createextendtarget.md} +0 -0
- /package/doc/{type-tls.createmixintarget.md → api/type-tls.createmixintarget.md} +0 -0
- /package/doc/{type-tls.createtargetextend.md → api/type-tls.createtargetextend.md} +0 -0
- /package/doc/{type-tls.createtargetmixin.md → api/type-tls.createtargetmixin.md} +0 -0
- /package/doc/{type-tls.defineextend.md → api/type-tls.defineextend.md} +0 -0
- /package/doc/{type-tls.definemixin.md → api/type-tls.definemixin.md} +0 -0
- /package/doc/{type-tls.exacttype.md → api/type-tls.exacttype.md} +0 -0
- /package/doc/{type-tls.exacttypename.md → api/type-tls.exacttypename.md} +0 -0
- /package/doc/{type-tls.extendtarget.md → api/type-tls.extendtarget.md} +0 -0
- /package/doc/{type-tls.getexacttypenameof.md → api/type-tls.getexacttypenameof.md} +0 -0
- /package/doc/{type-tls.getexacttypeof.md → api/type-tls.getexacttypeof.md} +0 -0
- /package/doc/{type-tls.getnameoftype.md → api/type-tls.getnameoftype.md} +0 -0
- /package/doc/{type-tls.gettypebyname.md → api/type-tls.gettypebyname.md} +0 -0
- /package/doc/{type-tls.gettypenameof.md → api/type-tls.gettypenameof.md} +0 -0
- /package/doc/{type-tls.gettypeof.md → api/type-tls.gettypeof.md} +0 -0
- /package/doc/{type-tls.isanonymousfunction.md → api/type-tls.isanonymousfunction.md} +0 -0
- /package/doc/{type-tls.isarraylike.md → api/type-tls.isarraylike.md} +0 -0
- /package/doc/{type-tls.isarrowfunction.md → api/type-tls.isarrowfunction.md} +0 -0
- /package/doc/{type-tls.isasyncfunction.md → api/type-tls.isasyncfunction.md} +0 -0
- /package/doc/{type-tls.isasyncgeneratorfunction.md → api/type-tls.isasyncgeneratorfunction.md} +0 -0
- /package/doc/{type-tls.isbasetype.md → api/type-tls.isbasetype.md} +0 -0
- /package/doc/{type-tls.isgeneratorfunction.md → api/type-tls.isgeneratorfunction.md} +0 -0
- /package/doc/{type-tls.isidentifier.md → api/type-tls.isidentifier.md} +0 -0
- /package/doc/{type-tls.isiterable.md → api/type-tls.isiterable.md} +0 -0
- /package/doc/{type-tls.isiterator.md → api/type-tls.isiterator.md} +0 -0
- /package/doc/{type-tls.isobject.md → api/type-tls.isobject.md} +0 -0
- /package/doc/{type-tls.loosetype.md → api/type-tls.loosetype.md} +0 -0
- /package/doc/{type-tls.loosetypename.md → api/type-tls.loosetypename.md} +0 -0
- /package/doc/{type-tls.methodparams.md → api/type-tls.methodparams.md} +0 -0
- /package/doc/{type-tls.methodreturntype.md → api/type-tls.methodreturntype.md} +0 -0
- /package/doc/{type-tls.mixin_4.md → api/type-tls.mixin_4.md} +0 -0
- /package/doc/{type-tls.mixintarget.md → api/type-tls.mixintarget.md} +0 -0
- /package/doc/{type-tls.optional.md → api/type-tls.optional.md} +0 -0
- /package/doc/{type-tls.optionalboolean.md → api/type-tls.optionalboolean.md} +0 -0
- /package/doc/{type-tls.privatememberofextend._constructor.md → api/type-tls.privatememberofextend._constructor.md} +0 -0
- /package/doc/{type-tls.privatememberofextend.md → api/type-tls.privatememberofextend.md} +0 -0
- /package/doc/{type-tls.replace.md → api/type-tls.replace.md} +0 -0
- /package/doc/{type-tls.replacenull.md → api/type-tls.replacenull.md} +0 -0
- /package/doc/{type-tls.replaceundefined.md → api/type-tls.replaceundefined.md} +0 -0
- /package/doc/{type-tls.replacevoid.md → api/type-tls.replacevoid.md} +0 -0
- /package/doc/{type-tls.resolvedata.md → api/type-tls.resolvedata.md} +0 -0
- /package/doc/{type-tls.targetextend.md → api/type-tls.targetextend.md} +0 -0
- /package/doc/{type-tls.targetmixin.md → api/type-tls.targetmixin.md} +0 -0
- /package/doc/{type-tls.typeofreturntype.md → api/type-tls.typeofreturntype.md} +0 -0
- /package/doc/{type-tls.waitasyncable.md → api/type-tls.waitasyncable.md} +0 -0
- /package/doc/{type-tls.waitasyncablereturn.md → api/type-tls.waitasyncablereturn.md} +0 -0
package/dist/function.d.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 判断 code 是否是有校的 js 标识符
|
|
3
|
-
* @param code - 标识符的字符串
|
|
4
|
-
*/
|
|
5
|
-
export declare function isIdentifier(code: string): boolean;
|
|
6
|
-
/**
|
|
7
|
-
* 判断函数是否是箭头函数
|
|
8
|
-
* @param fun - 被判断的函数
|
|
9
|
-
*/
|
|
10
|
-
export declare function isArrowFunction(fun: Function): boolean;
|
|
11
|
-
/**
|
|
12
|
-
* 判断函数是否是 async 异步函数
|
|
13
|
-
* @remarks
|
|
14
|
-
* 异步函数 不包含 异步生成器函数 AsyncGeneratorFunction
|
|
15
|
-
* @param fun - 被判断的函数
|
|
16
|
-
*/
|
|
17
|
-
export declare function isAsyncFunction(fun: Function): boolean;
|
|
18
|
-
/**
|
|
19
|
-
* 判断函数是否是生成器函数
|
|
20
|
-
*
|
|
21
|
-
* @remarks
|
|
22
|
-
* 生成器函数 不包含 异步生成器函数 AsyncGeneratorFunction
|
|
23
|
-
* @param fun - 被判断的函数
|
|
24
|
-
*/
|
|
25
|
-
export declare function isGeneratorFunction(fun: Function): boolean;
|
|
26
|
-
/**
|
|
27
|
-
* 判断函数是否是异步生成器函数
|
|
28
|
-
* @param fun - 被判断的函数
|
|
29
|
-
*/
|
|
30
|
-
export declare function isAsyncGeneratorFunction(fun: Function): boolean;
|
|
31
|
-
/**
|
|
32
|
-
* 判断是否是匿名函数
|
|
33
|
-
*
|
|
34
|
-
* @remarks
|
|
35
|
-
* 判断函数在被定义时是否是通过匿名函数来定义的。
|
|
36
|
-
* 匿名函数是指声明函数时没有写名字的函数。
|
|
37
|
-
* 注意:即使是匿名函数,函数对象上的 name 属性也可能是有值的,因为 js解析器 会自动将 函数表达式函数变量的名字作为匿名函数的名字,如下:
|
|
38
|
-
* ```ts
|
|
39
|
-
* var funName = function(){};
|
|
40
|
-
* ```
|
|
41
|
-
* 其中的匿名函数对象的 name 属性的值会是 `funName`
|
|
42
|
-
*
|
|
43
|
-
* 如果 函数对象上的 name 属性的值为 `""`,函数一定是匿名函数。
|
|
44
|
-
*/
|
|
45
|
-
export declare function isAnonymousFunction(fun: Function): boolean;
|
|
46
|
-
/**
|
|
47
|
-
* 表示任意的函数类型
|
|
48
|
-
*/
|
|
49
|
-
export declare type AnyFunction = (...args: any) => any;
|
package/dist/member.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { AnyFunction } from "./function";
|
|
2
|
-
/**
|
|
3
|
-
* 获取对象的方法的某个参数的类型
|
|
4
|
-
*
|
|
5
|
-
* @typeParam Obj - 对象
|
|
6
|
-
* @typeParam Method - 对象方法的名字
|
|
7
|
-
* @typeParam ParamIndex - 参数的索引个数
|
|
8
|
-
*/
|
|
9
|
-
export declare type MethodParams<Obj, Method extends keyof Obj, ParamIndex extends number> = Obj[Method] extends AnyFunction ? Parameters<Obj[Method]>[ParamIndex] : never;
|
|
10
|
-
/**
|
|
11
|
-
* 获取对象的方法的返回的类型
|
|
12
|
-
*
|
|
13
|
-
* @typeParam Obj - 对象
|
|
14
|
-
* @typeParam Method - 对象方法的名字
|
|
15
|
-
*/
|
|
16
|
-
export declare type MethodReturnType<Obj, Method extends keyof Obj> = Obj[Method] extends AnyFunction ? ReturnType<Obj[Method]> : never;
|
package/dist/mixin.d.ts
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 混合
|
|
3
|
-
* @internal
|
|
4
|
-
*/
|
|
5
|
-
export declare function mixin<T, S>(target: T, source: S): T & S;
|
|
6
|
-
/**
|
|
7
|
-
* 混合
|
|
8
|
-
* @internal
|
|
9
|
-
*/
|
|
10
|
-
export declare function mixin<T, S1, S2>(target: T, source1: S1, source2: S2): T & S1 & S2;
|
|
11
|
-
/**
|
|
12
|
-
* 混合
|
|
13
|
-
* @internal
|
|
14
|
-
*/
|
|
15
|
-
export declare function mixin<T, S1, S2, S3>(target: T, source1: S1, source2: S2, source3: S3): T & S1 & S2 & S3;
|
|
16
|
-
/**
|
|
17
|
-
* 混合
|
|
18
|
-
* @internal
|
|
19
|
-
*/
|
|
20
|
-
export declare function mixin<T, S1, S2, S3, S4>(target: T, source1: S1, source2: S2, source3: S3, source4: S3): T & S1 & S2 & S3 & S4;
|
|
21
|
-
/**
|
|
22
|
-
* 混合
|
|
23
|
-
*
|
|
24
|
-
* @remarks
|
|
25
|
-
* 将 source 的所有成员混入 target 对象中。
|
|
26
|
-
*
|
|
27
|
-
* 与 `Object.assign()` 的功能类似,不同的是 `mixin()` 会在 target 对象中 保持 source 对象属性的 PropertyDescriptors
|
|
28
|
-
*
|
|
29
|
-
* @param target - 目标对象,所有 源对象 的属性都要被混入进到 目标对象中
|
|
30
|
-
* @param sources - 源对象,所有 源对象 的属性都要被混入进到 目标对象中
|
|
31
|
-
* @returns 混入后的 target
|
|
32
|
-
*/
|
|
33
|
-
export declare function mixin(target: any, ...sources: any[]): any;
|
|
34
|
-
/**
|
|
35
|
-
* 定义混合的类型便利函数
|
|
36
|
-
*
|
|
37
|
-
* @remarks
|
|
38
|
-
* 它会更改 mixin 中方法的this指向为 target & mixin,不会真的执行混合操作
|
|
39
|
-
*
|
|
40
|
-
* @param target - 混合的目标,用作 this 的类型
|
|
41
|
-
* @param mixin - 混合对象,会自动更改其this的类型
|
|
42
|
-
* @returns 返回注入了 this 类型的 mixin 对象本身
|
|
43
|
-
*/
|
|
44
|
-
export declare function defineMixin<T, M>(target: T, mixin: M & ThisType<T & M>): M & ThisType<T & M>;
|
|
45
|
-
/**
|
|
46
|
-
* 创建定义混合的类型便利函数
|
|
47
|
-
*
|
|
48
|
-
* @remarks
|
|
49
|
-
* 它返回的便利函数的功能与 {@link defineMixin} 的功能一样,唯一区别是不再需要接收 target 参数了
|
|
50
|
-
*
|
|
51
|
-
* @returns 可以用于 定义混合的 类型便利函数
|
|
52
|
-
*/
|
|
53
|
-
export declare function createDefineMixin<T>(): <M>(target: T, mixin: M & ThisType<T & M>) => M & ThisType<T & M>;
|
|
54
|
-
/**
|
|
55
|
-
* 混合目标
|
|
56
|
-
*
|
|
57
|
-
* @remarks
|
|
58
|
-
* 与 {@link defineMixin} 的区别是:`targetMixin` 会执行对 target 的混合操作,而 {@link defineMixin} 不会
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
* @param target - 混合的目标,用作 this 的类型
|
|
62
|
-
* @param m - 混合对象,会自动更改其this的类型
|
|
63
|
-
* @returns 返回注入了 this 类型的 mixin 对象本身
|
|
64
|
-
*/
|
|
65
|
-
export declare function targetMixin<T, M>(target: T, m: M & ThisType<T & M>): M & ThisType<T & M>;
|
|
66
|
-
/**
|
|
67
|
-
* 创建用于混合目标的便捷函数
|
|
68
|
-
*
|
|
69
|
-
* @remarks
|
|
70
|
-
* 它返回的便利函数的功能与 {@link targetMixin} 的功能一样,唯一区别是不再需要接收 target 参数了
|
|
71
|
-
*
|
|
72
|
-
* @param target - 混合的目标,用作 this 的类型
|
|
73
|
-
* @returns 可以用于 混合目标 的便利函数
|
|
74
|
-
*/
|
|
75
|
-
export declare function createTargetMixin<T>(target: T): <M>(m: M & ThisType<T & M>) => M & ThisType<T & M>;
|
|
76
|
-
/**
|
|
77
|
-
* 混合目标
|
|
78
|
-
*
|
|
79
|
-
* @remarks
|
|
80
|
-
* 会执行对 CEarth 类的扩展操作。
|
|
81
|
-
* 与 {@link targetMixin} 的区别仅仅是返回类型不一样。
|
|
82
|
-
*
|
|
83
|
-
* @param target - 混合的目标,用作 this 的类型
|
|
84
|
-
* @param m - 混合对象,会自动更改其this的类型
|
|
85
|
-
* @returns 返回混合后的 target 对象
|
|
86
|
-
*/
|
|
87
|
-
export declare function mixinTarget<T, M>(target: T, m: M & ThisType<T & M>): M & ThisType<T & M> & T;
|
|
88
|
-
/**
|
|
89
|
-
* 创建用于混合目标工具函数
|
|
90
|
-
*
|
|
91
|
-
* @remarks
|
|
92
|
-
* 它返回的便利函数的功能与 {@link mixinTarget} 的功能一样,唯一区别是不再需要接收 target 参数了
|
|
93
|
-
*
|
|
94
|
-
* @returns 可以用于 混合目标 的便利函数
|
|
95
|
-
*/
|
|
96
|
-
export declare function createMixinTarget<T>(target: T): <M>(m: M & ThisType<T & M>) => M & ThisType<T & M> & T;
|
package/dist/type-tls.es.js
DELETED
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
var _a, _b, _c;
|
|
2
|
-
function isObject(target) {
|
|
3
|
-
var tarType = typeof target;
|
|
4
|
-
return target && (tarType === "object" || tarType === "function");
|
|
5
|
-
}
|
|
6
|
-
function getTypeOf(inst) {
|
|
7
|
-
var typeInfo = inst;
|
|
8
|
-
if (inst != null) {
|
|
9
|
-
typeInfo = inst.constructor;
|
|
10
|
-
if (typeInfo == void 0) {
|
|
11
|
-
typeInfo = typeof inst;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
return typeInfo;
|
|
15
|
-
}
|
|
16
|
-
function getNameOfType(t) {
|
|
17
|
-
switch (t) {
|
|
18
|
-
case void 0:
|
|
19
|
-
return "undefined";
|
|
20
|
-
case null:
|
|
21
|
-
return "null";
|
|
22
|
-
}
|
|
23
|
-
let tType = typeof t;
|
|
24
|
-
switch (tType) {
|
|
25
|
-
case "function":
|
|
26
|
-
return t.name;
|
|
27
|
-
case "string":
|
|
28
|
-
return t;
|
|
29
|
-
default:
|
|
30
|
-
return tType;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
function getTypeByName(typeName) {
|
|
34
|
-
return globalThis[typeName];
|
|
35
|
-
}
|
|
36
|
-
function getTypeNameOf(inst) {
|
|
37
|
-
let t = getTypeOf(inst);
|
|
38
|
-
return getNameOfType(t);
|
|
39
|
-
}
|
|
40
|
-
function getExactTypeOf(inst) {
|
|
41
|
-
if (inst == null || isObject(inst)) {
|
|
42
|
-
return getTypeOf(inst);
|
|
43
|
-
}
|
|
44
|
-
return typeof inst;
|
|
45
|
-
}
|
|
46
|
-
function getExactTypeNameOf(inst) {
|
|
47
|
-
var t = getExactTypeOf(inst);
|
|
48
|
-
return getNameOfType(t);
|
|
49
|
-
}
|
|
50
|
-
function isBaseType(data) {
|
|
51
|
-
var typeStr = typeof data;
|
|
52
|
-
return data == null || typeStr !== "object" && typeStr !== "function";
|
|
53
|
-
}
|
|
54
|
-
function isArrayLike(target) {
|
|
55
|
-
let length = target && target.length;
|
|
56
|
-
return Number.isInteger(target.length) && length >= 0;
|
|
57
|
-
}
|
|
58
|
-
function isIterable(target) {
|
|
59
|
-
return target && typeof target[Symbol.iterator] === "function";
|
|
60
|
-
}
|
|
61
|
-
function isIterator(target) {
|
|
62
|
-
return target && typeof target.next === "function";
|
|
63
|
-
}
|
|
64
|
-
function mixin(target, ...sources) {
|
|
65
|
-
for (const s of sources) {
|
|
66
|
-
const propDes = Object.getOwnPropertyDescriptors(s);
|
|
67
|
-
Object.defineProperties(target, propDes);
|
|
68
|
-
}
|
|
69
|
-
return target;
|
|
70
|
-
}
|
|
71
|
-
function defineMixin(target, mixin2) {
|
|
72
|
-
return mixin2;
|
|
73
|
-
}
|
|
74
|
-
function createDefineMixin() {
|
|
75
|
-
return function defineMixin2(target, mixin2) {
|
|
76
|
-
return mixin2;
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
function targetMixin(target, m) {
|
|
80
|
-
mixin(target, m);
|
|
81
|
-
return m;
|
|
82
|
-
}
|
|
83
|
-
function createTargetMixin(target) {
|
|
84
|
-
return function targetMixin2(m) {
|
|
85
|
-
mixin(target, m);
|
|
86
|
-
return m;
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
function mixinTarget(target, m) {
|
|
90
|
-
mixin(target, m);
|
|
91
|
-
return target;
|
|
92
|
-
}
|
|
93
|
-
function createMixinTarget(target) {
|
|
94
|
-
return function mixinTarget2(m) {
|
|
95
|
-
mixin(target, m);
|
|
96
|
-
return target;
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
function defineExtend(cla, ext) {
|
|
100
|
-
return ext;
|
|
101
|
-
}
|
|
102
|
-
function targetExtend(cla, ext) {
|
|
103
|
-
var _a2;
|
|
104
|
-
mixin(cla.prototype, ext);
|
|
105
|
-
const _constructor = ext._constructor;
|
|
106
|
-
if (typeof _constructor === "function") {
|
|
107
|
-
const target = cla;
|
|
108
|
-
const _constructors = (_a2 = target._constructors) != null ? _a2 : target._constructors = [];
|
|
109
|
-
_constructors.push(_constructor);
|
|
110
|
-
}
|
|
111
|
-
return ext;
|
|
112
|
-
}
|
|
113
|
-
function createTargetExtend(cla) {
|
|
114
|
-
return function classExtend(ext) {
|
|
115
|
-
targetExtend(cla, ext);
|
|
116
|
-
return ext;
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
function extendTarget(cla, ext) {
|
|
120
|
-
targetExtend(cla, ext);
|
|
121
|
-
return cla;
|
|
122
|
-
}
|
|
123
|
-
function createExtendTarget(cla) {
|
|
124
|
-
return function extendTarget2(ext) {
|
|
125
|
-
targetExtend(cla, ext);
|
|
126
|
-
return cla;
|
|
127
|
-
};
|
|
128
|
-
}
|
|
129
|
-
const jsIdentifier = /^[A-Za-z_$]+[\w$]*$/;
|
|
130
|
-
function isIdentifier(code) {
|
|
131
|
-
return jsIdentifier.test(code);
|
|
132
|
-
}
|
|
133
|
-
const arrowFunctionRegExpOfFunString = /(^\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*=>)/;
|
|
134
|
-
function isArrowFunction(fun) {
|
|
135
|
-
const funStr = fun.toString();
|
|
136
|
-
return arrowFunctionRegExpOfFunString.test(funStr);
|
|
137
|
-
}
|
|
138
|
-
const AsyncFun = (_a = globalThis.AsyncFunction) != null ? _a : async function() {
|
|
139
|
-
}.constructor;
|
|
140
|
-
function isAsyncFunction(fun) {
|
|
141
|
-
return fun instanceof AsyncFun;
|
|
142
|
-
}
|
|
143
|
-
const GeneratorFun = (_b = globalThis.GeneratorFunction) != null ? _b : function* () {
|
|
144
|
-
}.constructor;
|
|
145
|
-
function isGeneratorFunction(fun) {
|
|
146
|
-
return fun instanceof GeneratorFun;
|
|
147
|
-
}
|
|
148
|
-
const AsyncGeneratorFun = (_c = globalThis.AsyncGeneratorFunction) != null ? _c : async function* () {
|
|
149
|
-
}.constructor;
|
|
150
|
-
function isAsyncGeneratorFunction(fun) {
|
|
151
|
-
return fun instanceof AsyncGeneratorFun;
|
|
152
|
-
}
|
|
153
|
-
const funNameRegExpOfFunString = /(^\s*(async\s+)?function\s*(\s|\*)\s*)[A-Za-z_$]+[\w$]*(\s*\()/;
|
|
154
|
-
function isAnonymousFunction(fun) {
|
|
155
|
-
if (fun.name) {
|
|
156
|
-
const funStr = fun.toString();
|
|
157
|
-
return !funNameRegExpOfFunString.test(funStr);
|
|
158
|
-
}
|
|
159
|
-
return true;
|
|
160
|
-
}
|
|
161
|
-
function waitAsyncable(asyncable, callback) {
|
|
162
|
-
if (asyncable instanceof Promise) {
|
|
163
|
-
return asyncable.then((syncRes) => {
|
|
164
|
-
return callback(syncRes, false, void 0);
|
|
165
|
-
}, (error) => {
|
|
166
|
-
return callback(void 0, true, error);
|
|
167
|
-
});
|
|
168
|
-
}
|
|
169
|
-
return callback(asyncable, false, void 0);
|
|
170
|
-
}
|
|
171
|
-
export { createDefineMixin, createExtendTarget, createMixinTarget, createTargetExtend, createTargetMixin, defineExtend, defineMixin, extendTarget, getExactTypeNameOf, getExactTypeOf, getNameOfType, getTypeByName, getTypeNameOf, getTypeOf, isAnonymousFunction, isArrayLike, isArrowFunction, isAsyncFunction, isAsyncGeneratorFunction, isBaseType, isGeneratorFunction, isIdentifier, isIterable, isIterator, isObject, mixin, mixinTarget, targetExtend, targetMixin, waitAsyncable };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/doc/{type-tls.isasyncgeneratorfunction.md → api/type-tls.isasyncgeneratorfunction.md}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|