@hairy/utils 0.6.3 → 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 +15 -2
- package/dist/index.esm.js +17 -4
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -56,7 +56,7 @@ __export(src_exports, {
|
|
|
56
56
|
isWeex: () => isWeex,
|
|
57
57
|
isWindow: () => isWindow,
|
|
58
58
|
objectToFormData: () => objectToFormData,
|
|
59
|
-
pPipe: () =>
|
|
59
|
+
pPipe: () => pPipe,
|
|
60
60
|
pipe: () => pipe,
|
|
61
61
|
weexPlatform: () => weexPlatform
|
|
62
62
|
});
|
|
@@ -127,8 +127,21 @@ function isTypeof(target, type) {
|
|
|
127
127
|
return getTypeof(target) === type;
|
|
128
128
|
}
|
|
129
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
|
+
|
|
130
144
|
// src/util/index.ts
|
|
131
|
-
var import_p_pipe = __toESM(require("p-pipe"));
|
|
132
145
|
var import_delay = __toESM(require("delay"));
|
|
133
146
|
var pipe = (...fns) => fns.reduce((v, f) => f(v));
|
|
134
147
|
var compose = (...fns) => fns.reduceRight((v, f) => f(v));
|
package/dist/index.esm.js
CHANGED
|
@@ -63,9 +63,22 @@ function isTypeof(target, type) {
|
|
|
63
63
|
return getTypeof(target) === type;
|
|
64
64
|
}
|
|
65
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
|
+
|
|
66
80
|
// src/util/index.ts
|
|
67
|
-
import { default as default2 } from "
|
|
68
|
-
import { default as default3 } from "delay";
|
|
81
|
+
import { default as default2 } from "delay";
|
|
69
82
|
var pipe = (...fns) => fns.reduce((v, f) => f(v));
|
|
70
83
|
var compose = (...fns) => fns.reduceRight((v, f) => f(v));
|
|
71
84
|
function arange(x1, x2, stp = 1, z = [], z0 = z.length) {
|
|
@@ -95,7 +108,7 @@ export {
|
|
|
95
108
|
atWillToUnit,
|
|
96
109
|
compose,
|
|
97
110
|
createDeferred,
|
|
98
|
-
|
|
111
|
+
default2 as delay,
|
|
99
112
|
formDataToObject,
|
|
100
113
|
getTypeof,
|
|
101
114
|
isAndroid,
|
|
@@ -115,7 +128,7 @@ export {
|
|
|
115
128
|
isWeex,
|
|
116
129
|
isWindow,
|
|
117
130
|
objectToFormData,
|
|
118
|
-
|
|
131
|
+
pPipe,
|
|
119
132
|
pipe,
|
|
120
133
|
weexPlatform
|
|
121
134
|
};
|