@hairy/utils 0.6.2 → 0.6.4
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/index.cjs.js +199 -0
- package/dist/index.d.ts +108 -0
- package/dist/index.esm.js +134 -0
- package/package.json +1 -1
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/index.ts
|
|
31
|
+
var src_exports = {};
|
|
32
|
+
__export(src_exports, {
|
|
33
|
+
UA: () => UA,
|
|
34
|
+
arange: () => arange,
|
|
35
|
+
atWillToSize: () => atWillToSize,
|
|
36
|
+
atWillToUnit: () => atWillToUnit,
|
|
37
|
+
compose: () => compose,
|
|
38
|
+
createDeferred: () => createDeferred,
|
|
39
|
+
delay: () => import_delay.default,
|
|
40
|
+
formDataToObject: () => formDataToObject,
|
|
41
|
+
getTypeof: () => getTypeof,
|
|
42
|
+
isAndroid: () => isAndroid,
|
|
43
|
+
isBrowser: () => isBrowser,
|
|
44
|
+
isChrome: () => isChrome,
|
|
45
|
+
isEdge: () => isEdge,
|
|
46
|
+
isFF: () => isFF,
|
|
47
|
+
isFormData: () => isFormData,
|
|
48
|
+
isIE: () => isIE,
|
|
49
|
+
isIE11: () => isIE11,
|
|
50
|
+
isIE9: () => isIE9,
|
|
51
|
+
isIOS: () => isIOS,
|
|
52
|
+
isMobile: () => isMobile,
|
|
53
|
+
isObject: () => isObject,
|
|
54
|
+
isPhantomJS: () => isPhantomJS,
|
|
55
|
+
isTypeof: () => isTypeof,
|
|
56
|
+
isWeex: () => isWeex,
|
|
57
|
+
isWindow: () => isWindow,
|
|
58
|
+
objectToFormData: () => objectToFormData,
|
|
59
|
+
pPipe: () => pPipe,
|
|
60
|
+
pipe: () => pipe,
|
|
61
|
+
weexPlatform: () => weexPlatform
|
|
62
|
+
});
|
|
63
|
+
module.exports = __toCommonJS(src_exports);
|
|
64
|
+
|
|
65
|
+
// src/is/index.ts
|
|
66
|
+
var isBrowser = typeof window !== "undefined";
|
|
67
|
+
var isWeex = typeof WXEnvironment !== "undefined" && !!WXEnvironment.platform;
|
|
68
|
+
var weexPlatform = isWeex && WXEnvironment.platform.toLowerCase();
|
|
69
|
+
var UA = isBrowser && window.navigator.userAgent.toLowerCase();
|
|
70
|
+
var isIE = UA && /msie|trident/.test(UA);
|
|
71
|
+
var isIE9 = UA && UA.indexOf("msie 9.0") > 0;
|
|
72
|
+
var isIE11 = isBrowser && navigator.userAgent.includes("Trident") && navigator.userAgent.includes("rv:11.0");
|
|
73
|
+
var isEdge = UA && UA.indexOf("edge/") > 0;
|
|
74
|
+
var isAndroid = UA && UA.indexOf("android") > 0 || weexPlatform === "android";
|
|
75
|
+
var isIOS = UA && /iphone|ipad|ipod|ios/.test(UA) || weexPlatform === "ios";
|
|
76
|
+
var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
|
|
77
|
+
var isPhantomJS = UA && /phantomjs/.test(UA);
|
|
78
|
+
var isFF = typeof UA == "string" && UA.match(/firefox\/(\d+)/);
|
|
79
|
+
var isMobile = isBrowser && navigator.userAgent.toLowerCase().includes("mobile");
|
|
80
|
+
|
|
81
|
+
// src/lang/index.ts
|
|
82
|
+
var import_isObject = __toESM(require("lodash/isObject"));
|
|
83
|
+
function formDataToObject(formData) {
|
|
84
|
+
return Object.fromEntries(formData.entries());
|
|
85
|
+
}
|
|
86
|
+
function objectToFormData(object) {
|
|
87
|
+
const formData = new FormData();
|
|
88
|
+
for (const [key, value] of Object.entries(object))
|
|
89
|
+
formData.append(key, value);
|
|
90
|
+
return formData;
|
|
91
|
+
}
|
|
92
|
+
function isFormData(value) {
|
|
93
|
+
return isObject(value) && isBrowser && value instanceof FormData;
|
|
94
|
+
}
|
|
95
|
+
function isWindow(value) {
|
|
96
|
+
return typeof window !== "undefined" && toString.call(value) === "[object Window]";
|
|
97
|
+
}
|
|
98
|
+
function isObject(value) {
|
|
99
|
+
return (0, import_isObject.default)(value) && !Array.isArray(value);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// src/size/index.ts
|
|
103
|
+
var import_isNumber = __toESM(require("lodash/isNumber"));
|
|
104
|
+
var import_isString = __toESM(require("lodash/isString"));
|
|
105
|
+
function atWillToUnit(value, unit = "px") {
|
|
106
|
+
if (!((0, import_isString.default)(value) || (0, import_isNumber.default)(value)))
|
|
107
|
+
return "";
|
|
108
|
+
return (0, import_isString.default)(value) && /\D/g.test(value) ? value : value + unit;
|
|
109
|
+
}
|
|
110
|
+
function atWillToSize(size, unit) {
|
|
111
|
+
const _atWillToUnit = (value) => atWillToUnit(value, unit);
|
|
112
|
+
if (typeof size === "string" || typeof size === "number")
|
|
113
|
+
return { width: _atWillToUnit(size), height: _atWillToUnit(size) };
|
|
114
|
+
if (Array.isArray(size))
|
|
115
|
+
return { width: _atWillToUnit(size[0]), height: _atWillToUnit(size[1]) };
|
|
116
|
+
if (typeof size === "object")
|
|
117
|
+
return { width: _atWillToUnit(size.width), height: _atWillToUnit(size.height) };
|
|
118
|
+
return { width: "", height: "" };
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// src/typeof/index.ts
|
|
122
|
+
function getTypeof(target) {
|
|
123
|
+
const value = Object.prototype.toString.call(target).slice(8, -1).toLocaleLowerCase();
|
|
124
|
+
return value;
|
|
125
|
+
}
|
|
126
|
+
function isTypeof(target, type) {
|
|
127
|
+
return getTypeof(target) === type;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// ../../node_modules/.pnpm/p-pipe@4.0.0/node_modules/p-pipe/index.js
|
|
131
|
+
function pPipe(...functions) {
|
|
132
|
+
if (functions.length === 0) {
|
|
133
|
+
throw new Error("Expected at least one argument");
|
|
134
|
+
}
|
|
135
|
+
return async (input) => {
|
|
136
|
+
let currentValue = input;
|
|
137
|
+
for (const function_ of functions) {
|
|
138
|
+
currentValue = await function_(currentValue);
|
|
139
|
+
}
|
|
140
|
+
return currentValue;
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// src/util/index.ts
|
|
145
|
+
var import_delay = __toESM(require("delay"));
|
|
146
|
+
var pipe = (...fns) => fns.reduce((v, f) => f(v));
|
|
147
|
+
var compose = (...fns) => fns.reduceRight((v, f) => f(v));
|
|
148
|
+
function arange(x1, x2, stp = 1, z = [], z0 = z.length) {
|
|
149
|
+
if (!x2)
|
|
150
|
+
x1 -= x2 = x1;
|
|
151
|
+
for (let z1 = z0 + Math.max(Math.ceil((++x2 - x1) / stp), 0); z0 < z1; x1 += stp)
|
|
152
|
+
z[z0++] = x1;
|
|
153
|
+
return z;
|
|
154
|
+
}
|
|
155
|
+
function createDeferred() {
|
|
156
|
+
let resolve, reject;
|
|
157
|
+
const promise = new Promise((_resolve, _reject) => {
|
|
158
|
+
resolve = _resolve;
|
|
159
|
+
reject = _reject;
|
|
160
|
+
});
|
|
161
|
+
promise.resolve = (v) => {
|
|
162
|
+
resolve(v);
|
|
163
|
+
return promise;
|
|
164
|
+
};
|
|
165
|
+
promise.reject = reject;
|
|
166
|
+
return promise;
|
|
167
|
+
}
|
|
168
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
169
|
+
0 && (module.exports = {
|
|
170
|
+
UA,
|
|
171
|
+
arange,
|
|
172
|
+
atWillToSize,
|
|
173
|
+
atWillToUnit,
|
|
174
|
+
compose,
|
|
175
|
+
createDeferred,
|
|
176
|
+
delay,
|
|
177
|
+
formDataToObject,
|
|
178
|
+
getTypeof,
|
|
179
|
+
isAndroid,
|
|
180
|
+
isBrowser,
|
|
181
|
+
isChrome,
|
|
182
|
+
isEdge,
|
|
183
|
+
isFF,
|
|
184
|
+
isFormData,
|
|
185
|
+
isIE,
|
|
186
|
+
isIE11,
|
|
187
|
+
isIE9,
|
|
188
|
+
isIOS,
|
|
189
|
+
isMobile,
|
|
190
|
+
isObject,
|
|
191
|
+
isPhantomJS,
|
|
192
|
+
isTypeof,
|
|
193
|
+
isWeex,
|
|
194
|
+
isWindow,
|
|
195
|
+
objectToFormData,
|
|
196
|
+
pPipe,
|
|
197
|
+
pipe,
|
|
198
|
+
weexPlatform
|
|
199
|
+
});
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { PipeFn, ComposeFn } from 'pipe-and-compose-types';
|
|
2
|
+
export { default as pPipe } from 'p-pipe';
|
|
3
|
+
export { default as delay } from 'delay';
|
|
4
|
+
|
|
5
|
+
declare const isBrowser: boolean;
|
|
6
|
+
declare const isWeex: boolean;
|
|
7
|
+
declare const weexPlatform: any;
|
|
8
|
+
declare const UA: string | false;
|
|
9
|
+
declare const isIE: boolean | "";
|
|
10
|
+
declare const isIE9: boolean | "";
|
|
11
|
+
declare const isIE11: boolean;
|
|
12
|
+
declare const isEdge: boolean | "";
|
|
13
|
+
declare const isAndroid: boolean;
|
|
14
|
+
declare const isIOS: boolean;
|
|
15
|
+
declare const isChrome: boolean | "";
|
|
16
|
+
declare const isPhantomJS: boolean | "";
|
|
17
|
+
declare const isFF: false | RegExpMatchArray | null;
|
|
18
|
+
declare const isMobile: boolean;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* 将 formData 转换为 object
|
|
22
|
+
* @param formData
|
|
23
|
+
*/
|
|
24
|
+
declare function formDataToObject(formData: FormData): Record<string, string>;
|
|
25
|
+
/**
|
|
26
|
+
* 将 object 转换为 formData
|
|
27
|
+
* @param object
|
|
28
|
+
*/
|
|
29
|
+
declare function objectToFormData(object: Record<string, string | File>): FormData;
|
|
30
|
+
declare function isFormData(value: any): value is FormData;
|
|
31
|
+
declare function isWindow(value: any): value is Window;
|
|
32
|
+
declare function isObject(value: any): value is object;
|
|
33
|
+
|
|
34
|
+
interface AtWillObject {
|
|
35
|
+
[key: string]: any;
|
|
36
|
+
}
|
|
37
|
+
type AtWillNumber = string | number;
|
|
38
|
+
interface StringObject {
|
|
39
|
+
[key: string]: string;
|
|
40
|
+
}
|
|
41
|
+
type Key = string | number | symbol;
|
|
42
|
+
type DeepReadonly<T> = {
|
|
43
|
+
readonly [P in keyof T]: T[P] extends object ? DeepReadonly<T[P]> : T[P];
|
|
44
|
+
};
|
|
45
|
+
type DeepRequired<T> = {
|
|
46
|
+
[P in keyof T]-?: T[P] extends object ? DeepRequired<T[P]> : T[P];
|
|
47
|
+
};
|
|
48
|
+
type DeepPartial<T> = {
|
|
49
|
+
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
|
|
50
|
+
};
|
|
51
|
+
type DeepKeyof<T> = T extends object ? keyof T | DeepKeyof<T[keyof T]> : never;
|
|
52
|
+
type DeepReplace<T, K = unknown, V = unknown> = {
|
|
53
|
+
[P in keyof T]: K extends P ? V : DeepReplace<T[P], K, V>;
|
|
54
|
+
};
|
|
55
|
+
type Option<L extends Key = 'label', V extends Key = 'value', C extends Key = 'children'> = {
|
|
56
|
+
[P in L]?: string;
|
|
57
|
+
} & {
|
|
58
|
+
[P in V]?: AtWillNumber;
|
|
59
|
+
} & {
|
|
60
|
+
[P in C]?: Option<L, V, C>[];
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
declare function atWillToUnit(value: AtWillNumber, unit?: string): string;
|
|
64
|
+
/** size 转换配置 */
|
|
65
|
+
type AtWillSize = AtWillNumber | [AtWillNumber, AtWillNumber] | {
|
|
66
|
+
width: AtWillNumber;
|
|
67
|
+
height: AtWillNumber;
|
|
68
|
+
};
|
|
69
|
+
interface Size {
|
|
70
|
+
width: string;
|
|
71
|
+
height: string;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* 将 size 转换为宽高,用于元素宽高
|
|
75
|
+
* @param size AtWillSize
|
|
76
|
+
* @returns
|
|
77
|
+
*/
|
|
78
|
+
declare function atWillToSize(size: AtWillSize, unit?: string): Size;
|
|
79
|
+
|
|
80
|
+
type TypeofType = 'string' | 'number' | 'bigint' | 'boolean' | 'symbol' | 'undefined' | 'object' | 'function' | 'null' | 'regexp';
|
|
81
|
+
/**
|
|
82
|
+
* 获取数据类型
|
|
83
|
+
* @param target 检测对象
|
|
84
|
+
* @returns 返回字符串
|
|
85
|
+
*/
|
|
86
|
+
declare function getTypeof(target: any): TypeofType;
|
|
87
|
+
/**
|
|
88
|
+
* 检测数据类型
|
|
89
|
+
* @param target 检测对象
|
|
90
|
+
* @param type 类型
|
|
91
|
+
* @returns 返回字符串
|
|
92
|
+
*/
|
|
93
|
+
declare function isTypeof(target: any, type: TypeofType): boolean;
|
|
94
|
+
|
|
95
|
+
declare const pipe: PipeFn;
|
|
96
|
+
declare const compose: ComposeFn;
|
|
97
|
+
/**
|
|
98
|
+
* 生成区间数组
|
|
99
|
+
* arange(<start>, <stop>, [step=1], [target=[]], [at])
|
|
100
|
+
*/
|
|
101
|
+
declare function arange(x1: number, x2?: number, stp?: number, z?: number[], z0?: number): number[];
|
|
102
|
+
type Deferred<T = void> = Promise<T> & {
|
|
103
|
+
resolve: (value: T) => void;
|
|
104
|
+
reject: Function;
|
|
105
|
+
};
|
|
106
|
+
declare function createDeferred<T = void>(): Deferred<T>;
|
|
107
|
+
|
|
108
|
+
export { AtWillNumber, AtWillObject, AtWillSize, DeepKeyof, DeepPartial, DeepReadonly, DeepReplace, DeepRequired, Deferred, Key, Option, Size, StringObject, TypeofType, UA, arange, atWillToSize, atWillToUnit, compose, createDeferred, formDataToObject, getTypeof, isAndroid, isBrowser, isChrome, isEdge, isFF, isFormData, isIE, isIE11, isIE9, isIOS, isMobile, isObject, isPhantomJS, isTypeof, isWeex, isWindow, objectToFormData, pipe, weexPlatform };
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
// src/is/index.ts
|
|
2
|
+
var isBrowser = typeof window !== "undefined";
|
|
3
|
+
var isWeex = typeof WXEnvironment !== "undefined" && !!WXEnvironment.platform;
|
|
4
|
+
var weexPlatform = isWeex && WXEnvironment.platform.toLowerCase();
|
|
5
|
+
var UA = isBrowser && window.navigator.userAgent.toLowerCase();
|
|
6
|
+
var isIE = UA && /msie|trident/.test(UA);
|
|
7
|
+
var isIE9 = UA && UA.indexOf("msie 9.0") > 0;
|
|
8
|
+
var isIE11 = isBrowser && navigator.userAgent.includes("Trident") && navigator.userAgent.includes("rv:11.0");
|
|
9
|
+
var isEdge = UA && UA.indexOf("edge/") > 0;
|
|
10
|
+
var isAndroid = UA && UA.indexOf("android") > 0 || weexPlatform === "android";
|
|
11
|
+
var isIOS = UA && /iphone|ipad|ipod|ios/.test(UA) || weexPlatform === "ios";
|
|
12
|
+
var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
|
|
13
|
+
var isPhantomJS = UA && /phantomjs/.test(UA);
|
|
14
|
+
var isFF = typeof UA == "string" && UA.match(/firefox\/(\d+)/);
|
|
15
|
+
var isMobile = isBrowser && navigator.userAgent.toLowerCase().includes("mobile");
|
|
16
|
+
|
|
17
|
+
// src/lang/index.ts
|
|
18
|
+
import _isObject from "lodash/isObject";
|
|
19
|
+
function formDataToObject(formData) {
|
|
20
|
+
return Object.fromEntries(formData.entries());
|
|
21
|
+
}
|
|
22
|
+
function objectToFormData(object) {
|
|
23
|
+
const formData = new FormData();
|
|
24
|
+
for (const [key, value] of Object.entries(object))
|
|
25
|
+
formData.append(key, value);
|
|
26
|
+
return formData;
|
|
27
|
+
}
|
|
28
|
+
function isFormData(value) {
|
|
29
|
+
return isObject(value) && isBrowser && value instanceof FormData;
|
|
30
|
+
}
|
|
31
|
+
function isWindow(value) {
|
|
32
|
+
return typeof window !== "undefined" && toString.call(value) === "[object Window]";
|
|
33
|
+
}
|
|
34
|
+
function isObject(value) {
|
|
35
|
+
return _isObject(value) && !Array.isArray(value);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// src/size/index.ts
|
|
39
|
+
import isNumber from "lodash/isNumber";
|
|
40
|
+
import isString from "lodash/isString";
|
|
41
|
+
function atWillToUnit(value, unit = "px") {
|
|
42
|
+
if (!(isString(value) || isNumber(value)))
|
|
43
|
+
return "";
|
|
44
|
+
return isString(value) && /\D/g.test(value) ? value : value + unit;
|
|
45
|
+
}
|
|
46
|
+
function atWillToSize(size, unit) {
|
|
47
|
+
const _atWillToUnit = (value) => atWillToUnit(value, unit);
|
|
48
|
+
if (typeof size === "string" || typeof size === "number")
|
|
49
|
+
return { width: _atWillToUnit(size), height: _atWillToUnit(size) };
|
|
50
|
+
if (Array.isArray(size))
|
|
51
|
+
return { width: _atWillToUnit(size[0]), height: _atWillToUnit(size[1]) };
|
|
52
|
+
if (typeof size === "object")
|
|
53
|
+
return { width: _atWillToUnit(size.width), height: _atWillToUnit(size.height) };
|
|
54
|
+
return { width: "", height: "" };
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// src/typeof/index.ts
|
|
58
|
+
function getTypeof(target) {
|
|
59
|
+
const value = Object.prototype.toString.call(target).slice(8, -1).toLocaleLowerCase();
|
|
60
|
+
return value;
|
|
61
|
+
}
|
|
62
|
+
function isTypeof(target, type) {
|
|
63
|
+
return getTypeof(target) === type;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// ../../node_modules/.pnpm/p-pipe@4.0.0/node_modules/p-pipe/index.js
|
|
67
|
+
function pPipe(...functions) {
|
|
68
|
+
if (functions.length === 0) {
|
|
69
|
+
throw new Error("Expected at least one argument");
|
|
70
|
+
}
|
|
71
|
+
return async (input) => {
|
|
72
|
+
let currentValue = input;
|
|
73
|
+
for (const function_ of functions) {
|
|
74
|
+
currentValue = await function_(currentValue);
|
|
75
|
+
}
|
|
76
|
+
return currentValue;
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// src/util/index.ts
|
|
81
|
+
import { default as default2 } from "delay";
|
|
82
|
+
var pipe = (...fns) => fns.reduce((v, f) => f(v));
|
|
83
|
+
var compose = (...fns) => fns.reduceRight((v, f) => f(v));
|
|
84
|
+
function arange(x1, x2, stp = 1, z = [], z0 = z.length) {
|
|
85
|
+
if (!x2)
|
|
86
|
+
x1 -= x2 = x1;
|
|
87
|
+
for (let z1 = z0 + Math.max(Math.ceil((++x2 - x1) / stp), 0); z0 < z1; x1 += stp)
|
|
88
|
+
z[z0++] = x1;
|
|
89
|
+
return z;
|
|
90
|
+
}
|
|
91
|
+
function createDeferred() {
|
|
92
|
+
let resolve, reject;
|
|
93
|
+
const promise = new Promise((_resolve, _reject) => {
|
|
94
|
+
resolve = _resolve;
|
|
95
|
+
reject = _reject;
|
|
96
|
+
});
|
|
97
|
+
promise.resolve = (v) => {
|
|
98
|
+
resolve(v);
|
|
99
|
+
return promise;
|
|
100
|
+
};
|
|
101
|
+
promise.reject = reject;
|
|
102
|
+
return promise;
|
|
103
|
+
}
|
|
104
|
+
export {
|
|
105
|
+
UA,
|
|
106
|
+
arange,
|
|
107
|
+
atWillToSize,
|
|
108
|
+
atWillToUnit,
|
|
109
|
+
compose,
|
|
110
|
+
createDeferred,
|
|
111
|
+
default2 as delay,
|
|
112
|
+
formDataToObject,
|
|
113
|
+
getTypeof,
|
|
114
|
+
isAndroid,
|
|
115
|
+
isBrowser,
|
|
116
|
+
isChrome,
|
|
117
|
+
isEdge,
|
|
118
|
+
isFF,
|
|
119
|
+
isFormData,
|
|
120
|
+
isIE,
|
|
121
|
+
isIE11,
|
|
122
|
+
isIE9,
|
|
123
|
+
isIOS,
|
|
124
|
+
isMobile,
|
|
125
|
+
isObject,
|
|
126
|
+
isPhantomJS,
|
|
127
|
+
isTypeof,
|
|
128
|
+
isWeex,
|
|
129
|
+
isWindow,
|
|
130
|
+
objectToFormData,
|
|
131
|
+
pPipe,
|
|
132
|
+
pipe,
|
|
133
|
+
weexPlatform
|
|
134
|
+
};
|