@design-edito/tools 0.2.2 → 0.2.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/agnostic/colors/index.js +11 -11
- package/agnostic/css/index.js +4 -4
- package/agnostic/html/hyper-json/cast/index.js +5 -5
- package/agnostic/html/hyper-json/index.js +6 -6
- package/agnostic/html/hyper-json/smart-tags/coalesced/add/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/addclass/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/and/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/append/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/at/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/call/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/clone/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/deleteproperties/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/equals/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/getattribute/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/getproperties/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/getproperty/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/if/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/initialize/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/join/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/length/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/map/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/negate/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/notrailing/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/or/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/pickrandom/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/populate/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/print/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/push/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/pusheach/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/recordtoarray/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/removeattribute/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/removeclass/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/renameproperty/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/replace/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/select/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/set/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/setattribute/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/setproperty/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/sorton/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/split/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/spread/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/toarray/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/toboolean/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/toelement/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/toggleclass/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/tonodelist/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/tonull/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/tonumber/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/torecord/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/toref/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/tostring/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/totext/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/transformselected/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/trim/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/isolated/boolean/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/isolated/element/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/isolated/get/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/isolated/global/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/isolated/guess/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/isolated/nodelist/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/isolated/number/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/isolated/record/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/isolated/ref/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/isolated/string/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/isolated/text/index.js +5 -5
- package/agnostic/html/hyper-json/tree/index.js +5 -5
- package/agnostic/html/hyper-json/utils/index.js +5 -5
- package/agnostic/html/index.js +9 -9
- package/agnostic/misc/index.js +6 -6
- package/agnostic/numbers/index.js +5 -5
- package/agnostic/objects/index.js +12 -12
- package/agnostic/optim/index.js +3 -3
- package/agnostic/strings/index.d.ts +2 -0
- package/agnostic/strings/index.js +14 -9
- package/agnostic/strings/read-table/index.d.ts +38 -0
- package/agnostic/strings/read-table/index.js +10 -0
- package/agnostic/time/index.js +3 -3
- package/chunks/{chunk-FEIU5EB2.js → chunk-AIEEEZLK.js} +9 -9
- package/chunks/{chunk-HN7XLETR.js → chunk-AMJDX7MB.js} +19 -19
- package/chunks/chunk-BJVLBGZH.js +232 -0
- package/chunks/chunk-BLWSRM7I.js +38 -0
- package/chunks/{chunk-TLX7ZDXI.js → chunk-K2SL55BG.js} +4 -4
- package/chunks/{chunk-4W7NAQMC.js → chunk-QHQ3WLN4.js} +1 -1
- package/chunks/{chunk-TY6PMUBC.js → chunk-T4HGXBXC.js} +3 -3
- package/node/@aws-s3/index.js +8 -8
- package/node/@aws-s3/storage/directory/index.js +6 -6
- package/node/@aws-s3/storage/file/index.js +7 -7
- package/node/@aws-s3/storage/index.js +10 -10
- package/node/@google-cloud/index.js +11 -11
- package/node/@google-cloud/storage/bucket/index.js +5 -5
- package/node/@google-cloud/storage/directory/index.js +6 -6
- package/node/@google-cloud/storage/file/index.js +10 -10
- package/node/@google-cloud/storage/file/revoke-signed-urls/index.js +2 -2
- package/node/@google-cloud/storage/index.js +11 -11
- package/node/cloud-storage/index.js +45 -45
- package/node/cloud-storage/operations/copy-dir/index.js +3 -3
- package/node/cloud-storage/operations/copy-file/index.js +3 -3
- package/node/cloud-storage/operations/download-file/index.js +3 -3
- package/node/cloud-storage/operations/exists-file/index.js +3 -3
- package/node/cloud-storage/operations/index.js +53 -53
- package/node/cloud-storage/operations/list-dir/index.js +3 -3
- package/node/cloud-storage/operations/move-dir/index.js +3 -3
- package/node/cloud-storage/operations/move-file/index.js +3 -3
- package/node/cloud-storage/operations/remove-dir/index.js +3 -3
- package/node/cloud-storage/operations/remove-file/index.js +3 -3
- package/node/cloud-storage/operations/stat-file/index.js +3 -3
- package/node/cloud-storage/operations/upload-file/index.js +3 -3
- package/node/files/index.js +3 -3
- package/node/ftps/directory/index.js +6 -6
- package/node/ftps/file/index.js +7 -7
- package/node/ftps/index.js +9 -9
- package/node/images/index.js +13 -12
- package/node/images/transform/index.d.ts +19 -2
- package/node/images/transform/index.js +9 -6
- package/node/sftp/directory/index.js +6 -6
- package/node/sftp/file/index.js +7 -7
- package/node/sftp/index.js +7 -7
- package/package.json +1 -1
- package/chunks/chunk-B6AUVPAA.js +0 -181
- package/chunks/{chunk-MJCOPMAD.js → chunk-24ZUWYIR.js} +5 -5
- package/chunks/{chunk-4OK2UH4M.js → chunk-2WIWINVL.js} +5 -5
- package/chunks/{chunk-7KSMK42F.js → chunk-42B5RQDS.js} +5 -5
- package/chunks/{chunk-KOHJNRP7.js → chunk-4ZPWZQVR.js} +6 -6
- package/chunks/{chunk-UWHQFQI2.js → chunk-646R6BQZ.js} +5 -5
- package/chunks/{chunk-GJGGDURA.js → chunk-6NLNUGBI.js} +5 -5
- package/chunks/{chunk-QT6N2QNW.js → chunk-CA3UPHYO.js} +5 -5
- package/chunks/{chunk-WWEDO42X.js → chunk-DPQRXSZH.js} +5 -5
- package/chunks/{chunk-PGT5NXPS.js → chunk-E4MMN22Y.js} +12 -12
- package/chunks/{chunk-VTZRFTRR.js → chunk-EOTOFHUR.js} +5 -5
- package/chunks/{chunk-NAN5WRTL.js → chunk-FS6LRTDK.js} +5 -5
- package/chunks/{chunk-LSZVKXDZ.js → chunk-G5RRNREY.js} +3 -3
- package/chunks/{chunk-ENCASRD5.js → chunk-GFQMBB2J.js} +6 -6
- package/chunks/{chunk-RCCKFZCR.js → chunk-H4LW6FP3.js} +5 -5
- package/chunks/{chunk-AIC5YAJU.js → chunk-HJARCTOH.js} +5 -5
- package/chunks/{chunk-74CFPDKM.js → chunk-MUOULXIW.js} +5 -5
- package/chunks/{chunk-3T67XKWX.js → chunk-NOLQR5RW.js} +5 -5
- package/chunks/{chunk-JVFAQFHD.js → chunk-OA7Y2A5T.js} +5 -5
- package/chunks/{chunk-UXEKCYL7.js → chunk-OMTDHKJI.js} +4 -4
- package/chunks/{chunk-VRFYLKZW.js → chunk-UK4HNSEJ.js} +5 -5
- package/chunks/{chunk-64TRCQ5C.js → chunk-ZMR2PK34.js} +6 -6
@@ -0,0 +1,232 @@
|
|
1
|
+
import {
|
2
|
+
hue,
|
3
|
+
isHueOperationParams
|
4
|
+
} from "./chunk-DJJBT23A.js";
|
5
|
+
import {
|
6
|
+
flop
|
7
|
+
} from "./chunk-YA2YCZUF.js";
|
8
|
+
import {
|
9
|
+
isLevelOperationParams,
|
10
|
+
level
|
11
|
+
} from "./chunk-IFH5LQHA.js";
|
12
|
+
import {
|
13
|
+
isNormalizeOperationParams,
|
14
|
+
normalize
|
15
|
+
} from "./chunk-BHEWHO2M.js";
|
16
|
+
import {
|
17
|
+
isLightenOperationParams,
|
18
|
+
lighten
|
19
|
+
} from "./chunk-LIV7TJ46.js";
|
20
|
+
import {
|
21
|
+
isResizeOperationParams,
|
22
|
+
resize
|
23
|
+
} from "./chunk-DL5G2SYX.js";
|
24
|
+
import {
|
25
|
+
isRotateOperationParams,
|
26
|
+
rotate
|
27
|
+
} from "./chunk-5OZAL6GW.js";
|
28
|
+
import {
|
29
|
+
isSaturateOperationParams,
|
30
|
+
saturate
|
31
|
+
} from "./chunk-DOASQI7Y.js";
|
32
|
+
import {
|
33
|
+
extend,
|
34
|
+
isExtendOperationParams
|
35
|
+
} from "./chunk-5EY3BYMT.js";
|
36
|
+
import {
|
37
|
+
brighten,
|
38
|
+
isBrightenOperationParams
|
39
|
+
} from "./chunk-GZDDL6RB.js";
|
40
|
+
import {
|
41
|
+
blur,
|
42
|
+
isBlurOperationParams
|
43
|
+
} from "./chunk-5D472NLE.js";
|
44
|
+
import {
|
45
|
+
extract,
|
46
|
+
isExtractOperationParams
|
47
|
+
} from "./chunk-OVLFK3C3.js";
|
48
|
+
import {
|
49
|
+
flatten,
|
50
|
+
isFlattenOperationParams
|
51
|
+
} from "./chunk-CLZY2DXU.js";
|
52
|
+
import {
|
53
|
+
flip
|
54
|
+
} from "./chunk-WNDMYNDU.js";
|
55
|
+
import {
|
56
|
+
Outcome
|
57
|
+
} from "./chunk-JMU5PDBD.js";
|
58
|
+
import {
|
59
|
+
unknownToString
|
60
|
+
} from "./chunk-FENXVJYO.js";
|
61
|
+
import {
|
62
|
+
__export
|
63
|
+
} from "./chunk-WSFCRVEQ.js";
|
64
|
+
|
65
|
+
// src/node/images/transform/index.ts
|
66
|
+
var transform_exports = {};
|
67
|
+
__export(transform_exports, {
|
68
|
+
OpName: () => OpName,
|
69
|
+
TransformErrCodes: () => TransformErrCodes,
|
70
|
+
isOperationDescriptor: () => isOperationDescriptor,
|
71
|
+
transform: () => transform
|
72
|
+
});
|
73
|
+
import sharp from "sharp";
|
74
|
+
var OpName = /* @__PURE__ */ ((OpName2) => {
|
75
|
+
OpName2["BLUR"] = "blur";
|
76
|
+
OpName2["BRIGHTEN"] = "brighten";
|
77
|
+
OpName2["EXTEND"] = "extend";
|
78
|
+
OpName2["EXTRACT"] = "extract";
|
79
|
+
OpName2["FLATTEN"] = "flatten";
|
80
|
+
OpName2["FLIP"] = "flip";
|
81
|
+
OpName2["FLOP"] = "flop";
|
82
|
+
OpName2["HUE"] = "hue";
|
83
|
+
OpName2["LEVEL"] = "level";
|
84
|
+
OpName2["LIGHTEN"] = "lighten";
|
85
|
+
OpName2["NORMALIZE"] = "normalize";
|
86
|
+
OpName2["RESIZE"] = "resize";
|
87
|
+
OpName2["ROTATE"] = "rotate";
|
88
|
+
OpName2["SATURATE"] = "saturate";
|
89
|
+
return OpName2;
|
90
|
+
})(OpName || {});
|
91
|
+
function isOperationDescriptor(obj) {
|
92
|
+
if (typeof obj !== "object" || obj === null) return Outcome.makeFailure("Invalid operation descriptor");
|
93
|
+
if (!("name" in obj) || typeof obj.name !== "string") return Outcome.makeFailure("Field named 'name' in operation descriptor is required and must be a string");
|
94
|
+
const name = obj.name;
|
95
|
+
const validateOperation = (validatorFn) => {
|
96
|
+
const result = validatorFn(obj);
|
97
|
+
if (result.success) return Outcome.makeSuccess({ name: obj.name, ...result.payload });
|
98
|
+
return Outcome.makeFailure(result.error);
|
99
|
+
};
|
100
|
+
const validators = {
|
101
|
+
["blur" /* BLUR */]: isBlurOperationParams,
|
102
|
+
["brighten" /* BRIGHTEN */]: isBrightenOperationParams,
|
103
|
+
["extend" /* EXTEND */]: isExtendOperationParams,
|
104
|
+
["extract" /* EXTRACT */]: isExtractOperationParams,
|
105
|
+
["flatten" /* FLATTEN */]: isFlattenOperationParams,
|
106
|
+
["hue" /* HUE */]: isHueOperationParams,
|
107
|
+
["level" /* LEVEL */]: isLevelOperationParams,
|
108
|
+
["lighten" /* LIGHTEN */]: isLightenOperationParams,
|
109
|
+
["normalize" /* NORMALIZE */]: isNormalizeOperationParams,
|
110
|
+
["resize" /* RESIZE */]: isResizeOperationParams,
|
111
|
+
["rotate" /* ROTATE */]: isRotateOperationParams,
|
112
|
+
["saturate" /* SATURATE */]: isSaturateOperationParams
|
113
|
+
};
|
114
|
+
const simpleOperations = /* @__PURE__ */ new Set(["flip" /* FLIP */, "flop" /* FLOP */]);
|
115
|
+
if (simpleOperations.has(name)) return Outcome.makeSuccess({ name });
|
116
|
+
const validator = validators[name];
|
117
|
+
if (validator) return validateOperation(validator);
|
118
|
+
return Outcome.makeFailure("Invalid operation descriptor");
|
119
|
+
}
|
120
|
+
var TransformErrCodes = /* @__PURE__ */ ((TransformErrCodes2) => {
|
121
|
+
TransformErrCodes2["PROCESS_TIMEOUT"] = "process-timeout";
|
122
|
+
TransformErrCodes2["OP_TIMEOUT"] = "op-timeout";
|
123
|
+
TransformErrCodes2["WIDTH_LIMIT_EXCEEDED"] = "width-limit-exceeded";
|
124
|
+
TransformErrCodes2["HEIGHT_LIMIT_EXCEEDED"] = "height-limit-exceeded";
|
125
|
+
TransformErrCodes2["UNKNOWN_ERROR"] = "unknown-error";
|
126
|
+
return TransformErrCodes2;
|
127
|
+
})(TransformErrCodes || {});
|
128
|
+
async function transform(input, operationsSequence, limits) {
|
129
|
+
if (Buffer.isBuffer(input)) return transformBuffer(input, operationsSequence, limits);
|
130
|
+
return transformSharpInstance(input, operationsSequence, limits);
|
131
|
+
}
|
132
|
+
async function transformSharpInstance(sharpInstance, operationsSequence, limits) {
|
133
|
+
const start = Date.now();
|
134
|
+
const deadline = limits?.timeoutMs ? start + limits.timeoutMs : void 0;
|
135
|
+
const runWithOpTimeout = async (op) => {
|
136
|
+
if (!limits?.opTimeoutMs) return op();
|
137
|
+
const opTimeout = new Promise(
|
138
|
+
(resolve) => setTimeout(() => resolve("op-timeout" /* OP_TIMEOUT */), limits.opTimeoutMs)
|
139
|
+
);
|
140
|
+
return Promise.race([op(), opTimeout]);
|
141
|
+
};
|
142
|
+
for (const operation of operationsSequence) {
|
143
|
+
if (deadline !== void 0 && Date.now() > deadline) return Outcome.makeFailure({
|
144
|
+
code: "process-timeout" /* PROCESS_TIMEOUT */,
|
145
|
+
details: "Process timed out"
|
146
|
+
});
|
147
|
+
let result;
|
148
|
+
try {
|
149
|
+
result = await runWithOpTimeout(async () => {
|
150
|
+
switch (operation.name) {
|
151
|
+
case "blur" /* BLUR */:
|
152
|
+
return blur(sharpInstance, operation);
|
153
|
+
case "brighten" /* BRIGHTEN */:
|
154
|
+
return brighten(sharpInstance, operation);
|
155
|
+
case "extend" /* EXTEND */:
|
156
|
+
return extend(sharpInstance, operation);
|
157
|
+
case "extract" /* EXTRACT */:
|
158
|
+
return extract(sharpInstance, operation);
|
159
|
+
case "flatten" /* FLATTEN */:
|
160
|
+
return flatten(sharpInstance, operation);
|
161
|
+
case "flip" /* FLIP */:
|
162
|
+
return flip(sharpInstance);
|
163
|
+
case "flop" /* FLOP */:
|
164
|
+
return flop(sharpInstance);
|
165
|
+
case "hue" /* HUE */:
|
166
|
+
return hue(sharpInstance, operation);
|
167
|
+
case "level" /* LEVEL */:
|
168
|
+
return level(sharpInstance, operation);
|
169
|
+
case "lighten" /* LIGHTEN */:
|
170
|
+
return lighten(sharpInstance, operation);
|
171
|
+
case "normalize" /* NORMALIZE */:
|
172
|
+
return normalize(sharpInstance, operation);
|
173
|
+
case "resize" /* RESIZE */:
|
174
|
+
return resize(sharpInstance, operation);
|
175
|
+
case "rotate" /* ROTATE */:
|
176
|
+
return rotate(sharpInstance, operation);
|
177
|
+
case "saturate" /* SATURATE */:
|
178
|
+
return saturate(sharpInstance, operation);
|
179
|
+
default:
|
180
|
+
return sharpInstance;
|
181
|
+
}
|
182
|
+
});
|
183
|
+
} catch (err) {
|
184
|
+
return Outcome.makeFailure({
|
185
|
+
code: "unknown-error" /* UNKNOWN_ERROR */,
|
186
|
+
details: unknownToString(err)
|
187
|
+
});
|
188
|
+
}
|
189
|
+
if (result === "op-timeout" /* OP_TIMEOUT */) return Outcome.makeFailure({
|
190
|
+
code: "op-timeout" /* OP_TIMEOUT */,
|
191
|
+
details: "Operation timed out"
|
192
|
+
});
|
193
|
+
else {
|
194
|
+
sharpInstance = result;
|
195
|
+
}
|
196
|
+
if (limits && (operation.name === "resize" /* RESIZE */ || operation.name === "extend" /* EXTEND */ || operation.name === "extract" /* EXTRACT */ || operation.name === "rotate" /* ROTATE */)) {
|
197
|
+
try {
|
198
|
+
const meta = await sharpInstance.metadata();
|
199
|
+
if (limits.width !== void 0 && meta.width && meta.width > limits.width) {
|
200
|
+
return Outcome.makeFailure({
|
201
|
+
code: "width-limit-exceeded" /* WIDTH_LIMIT_EXCEEDED */,
|
202
|
+
details: `Image width exceeded the limit (${meta.width}px)`
|
203
|
+
});
|
204
|
+
}
|
205
|
+
if (limits.height !== void 0 && meta.height && meta.height > limits.height) {
|
206
|
+
return Outcome.makeFailure({
|
207
|
+
code: "height-limit-exceeded" /* HEIGHT_LIMIT_EXCEEDED */,
|
208
|
+
details: `Image height exceeded the limit (${meta.height}px)`
|
209
|
+
});
|
210
|
+
}
|
211
|
+
} catch (err) {
|
212
|
+
return Outcome.makeFailure({
|
213
|
+
code: "unknown-error" /* UNKNOWN_ERROR */,
|
214
|
+
details: `Failed to read metadata: ${unknownToString(err)}`
|
215
|
+
});
|
216
|
+
}
|
217
|
+
}
|
218
|
+
}
|
219
|
+
return Outcome.makeSuccess(sharpInstance);
|
220
|
+
}
|
221
|
+
async function transformBuffer(fileBuffer, operationsSequence, limits) {
|
222
|
+
const sharpInstance = sharp(fileBuffer);
|
223
|
+
return transformSharpInstance(sharpInstance, operationsSequence, limits);
|
224
|
+
}
|
225
|
+
|
226
|
+
export {
|
227
|
+
OpName,
|
228
|
+
isOperationDescriptor,
|
229
|
+
TransformErrCodes,
|
230
|
+
transform,
|
231
|
+
transform_exports
|
232
|
+
};
|
@@ -0,0 +1,38 @@
|
|
1
|
+
import {
|
2
|
+
Outcome
|
3
|
+
} from "./chunk-JMU5PDBD.js";
|
4
|
+
|
5
|
+
// src/agnostic/strings/read-table/index.ts
|
6
|
+
var defaultOptions = {
|
7
|
+
inputToLines: (i) => i.split("\n"),
|
8
|
+
headLinePos: 0,
|
9
|
+
headLineToHeaders: (i) => i.split(" "),
|
10
|
+
bodyLinesBounds: [1, Infinity],
|
11
|
+
bodyLineToCellValue: (i) => i.split(" "),
|
12
|
+
schema: (i) => i
|
13
|
+
};
|
14
|
+
function readTable(table, options = defaultOptions) {
|
15
|
+
const lines = options.inputToLines(table);
|
16
|
+
const headLine = lines.at(options.headLinePos);
|
17
|
+
if (headLine === void 0) return Outcome.makeFailure("Head line not found");
|
18
|
+
const headers = options.headLineToHeaders(headLine);
|
19
|
+
const bodyLines = lines.slice(options.bodyLinesBounds[0], options.bodyLinesBounds[1]);
|
20
|
+
const bodyLinesSplit = bodyLines.map(options.bodyLineToCellValue);
|
21
|
+
const rows = bodyLinesSplit.map((line) => {
|
22
|
+
const row = {};
|
23
|
+
line.forEach((cell, cellPos) => {
|
24
|
+
const cellName = headers.at(cellPos);
|
25
|
+
if (cellName === void 0) return;
|
26
|
+
const cellValue = cell;
|
27
|
+
row[cellName] = cellValue;
|
28
|
+
});
|
29
|
+
const checked = options.schema(row);
|
30
|
+
return checked;
|
31
|
+
});
|
32
|
+
return Outcome.makeSuccess(rows);
|
33
|
+
}
|
34
|
+
|
35
|
+
export {
|
36
|
+
defaultOptions,
|
37
|
+
readTable
|
38
|
+
};
|
@@ -1,9 +1,9 @@
|
|
1
|
-
import {
|
2
|
-
file_exports
|
3
|
-
} from "./chunk-ENCASRD5.js";
|
4
1
|
import {
|
5
2
|
directory_exports
|
6
|
-
} from "./chunk-
|
3
|
+
} from "./chunk-2WIWINVL.js";
|
4
|
+
import {
|
5
|
+
file_exports
|
6
|
+
} from "./chunk-GFQMBB2J.js";
|
7
7
|
import {
|
8
8
|
__export
|
9
9
|
} from "./chunk-WSFCRVEQ.js";
|
@@ -1,12 +1,12 @@
|
|
1
1
|
import {
|
2
2
|
file_exports
|
3
|
-
} from "./chunk-
|
3
|
+
} from "./chunk-AIEEEZLK.js";
|
4
4
|
import {
|
5
5
|
bucket_exports
|
6
|
-
} from "./chunk-
|
6
|
+
} from "./chunk-OMTDHKJI.js";
|
7
7
|
import {
|
8
8
|
directory_exports
|
9
|
-
} from "./chunk-
|
9
|
+
} from "./chunk-HJARCTOH.js";
|
10
10
|
import {
|
11
11
|
__export
|
12
12
|
} from "./chunk-WSFCRVEQ.js";
|
package/node/@aws-s3/index.js
CHANGED
@@ -1,19 +1,19 @@
|
|
1
1
|
import {
|
2
2
|
storage_exports
|
3
|
-
} from "../../chunks/chunk-
|
4
|
-
import "../../chunks/chunk-
|
5
|
-
import "../../chunks/chunk-
|
3
|
+
} from "../../chunks/chunk-K2SL55BG.js";
|
4
|
+
import "../../chunks/chunk-2WIWINVL.js";
|
5
|
+
import "../../chunks/chunk-GFQMBB2J.js";
|
6
|
+
import "../../chunks/chunk-3TKBCG7Y.js";
|
7
|
+
import "../../chunks/chunk-QWZ4ZNFA.js";
|
6
8
|
import "../../chunks/chunk-VROZGPC5.js";
|
7
9
|
import "../../chunks/chunk-FD5WR2A5.js";
|
8
|
-
import "../../chunks/chunk-4XSDRT23.js";
|
9
|
-
import "../../chunks/chunk-4XBUJAQU.js";
|
10
10
|
import "../../chunks/chunk-C6QTHDDM.js";
|
11
11
|
import "../../chunks/chunk-ZEZCYPLQ.js";
|
12
|
+
import "../../chunks/chunk-4XBUJAQU.js";
|
12
13
|
import "../../chunks/chunk-IV75M3KE.js";
|
13
|
-
import "../../chunks/chunk-ZSUG52DO.js";
|
14
14
|
import "../../chunks/chunk-ON6LC3HE.js";
|
15
|
-
import "../../chunks/chunk-
|
16
|
-
import "../../chunks/chunk-
|
15
|
+
import "../../chunks/chunk-ZSUG52DO.js";
|
16
|
+
import "../../chunks/chunk-4XSDRT23.js";
|
17
17
|
import "../../chunks/chunk-JMU5PDBD.js";
|
18
18
|
import "../../chunks/chunk-FENXVJYO.js";
|
19
19
|
import "../../chunks/chunk-WSFCRVEQ.js";
|
@@ -1,16 +1,16 @@
|
|
1
|
-
import "../../../../chunks/chunk-
|
2
|
-
import {
|
3
|
-
remove_dir_exports
|
4
|
-
} from "../../../../chunks/chunk-4XSDRT23.js";
|
1
|
+
import "../../../../chunks/chunk-2WIWINVL.js";
|
5
2
|
import {
|
6
3
|
copy_dir_exports
|
7
4
|
} from "../../../../chunks/chunk-4XBUJAQU.js";
|
5
|
+
import {
|
6
|
+
move_dir_exports
|
7
|
+
} from "../../../../chunks/chunk-ON6LC3HE.js";
|
8
8
|
import {
|
9
9
|
list_exports
|
10
10
|
} from "../../../../chunks/chunk-ZSUG52DO.js";
|
11
11
|
import {
|
12
|
-
|
13
|
-
} from "../../../../chunks/chunk-
|
12
|
+
remove_dir_exports
|
13
|
+
} from "../../../../chunks/chunk-4XSDRT23.js";
|
14
14
|
import "../../../../chunks/chunk-JMU5PDBD.js";
|
15
15
|
import "../../../../chunks/chunk-FENXVJYO.js";
|
16
16
|
import "../../../../chunks/chunk-WSFCRVEQ.js";
|
@@ -1,4 +1,10 @@
|
|
1
|
-
import "../../../../chunks/chunk-
|
1
|
+
import "../../../../chunks/chunk-GFQMBB2J.js";
|
2
|
+
import {
|
3
|
+
remove_exports
|
4
|
+
} from "../../../../chunks/chunk-3TKBCG7Y.js";
|
5
|
+
import {
|
6
|
+
move_exports
|
7
|
+
} from "../../../../chunks/chunk-QWZ4ZNFA.js";
|
2
8
|
import {
|
3
9
|
stat_exports
|
4
10
|
} from "../../../../chunks/chunk-VROZGPC5.js";
|
@@ -14,12 +20,6 @@ import {
|
|
14
20
|
import {
|
15
21
|
download_exports
|
16
22
|
} from "../../../../chunks/chunk-IV75M3KE.js";
|
17
|
-
import {
|
18
|
-
move_exports
|
19
|
-
} from "../../../../chunks/chunk-QWZ4ZNFA.js";
|
20
|
-
import {
|
21
|
-
remove_exports
|
22
|
-
} from "../../../../chunks/chunk-3TKBCG7Y.js";
|
23
23
|
import "../../../../chunks/chunk-JMU5PDBD.js";
|
24
24
|
import "../../../../chunks/chunk-FENXVJYO.js";
|
25
25
|
import "../../../../chunks/chunk-WSFCRVEQ.js";
|
@@ -1,21 +1,21 @@
|
|
1
|
-
import "../../../chunks/chunk-
|
2
|
-
import {
|
3
|
-
file_exports
|
4
|
-
} from "../../../chunks/chunk-ENCASRD5.js";
|
1
|
+
import "../../../chunks/chunk-K2SL55BG.js";
|
5
2
|
import {
|
6
3
|
directory_exports
|
7
|
-
} from "../../../chunks/chunk-
|
4
|
+
} from "../../../chunks/chunk-2WIWINVL.js";
|
5
|
+
import {
|
6
|
+
file_exports
|
7
|
+
} from "../../../chunks/chunk-GFQMBB2J.js";
|
8
|
+
import "../../../chunks/chunk-3TKBCG7Y.js";
|
9
|
+
import "../../../chunks/chunk-QWZ4ZNFA.js";
|
8
10
|
import "../../../chunks/chunk-VROZGPC5.js";
|
9
11
|
import "../../../chunks/chunk-FD5WR2A5.js";
|
10
|
-
import "../../../chunks/chunk-4XSDRT23.js";
|
11
|
-
import "../../../chunks/chunk-4XBUJAQU.js";
|
12
12
|
import "../../../chunks/chunk-C6QTHDDM.js";
|
13
13
|
import "../../../chunks/chunk-ZEZCYPLQ.js";
|
14
|
+
import "../../../chunks/chunk-4XBUJAQU.js";
|
14
15
|
import "../../../chunks/chunk-IV75M3KE.js";
|
15
|
-
import "../../../chunks/chunk-ZSUG52DO.js";
|
16
16
|
import "../../../chunks/chunk-ON6LC3HE.js";
|
17
|
-
import "../../../chunks/chunk-
|
18
|
-
import "../../../chunks/chunk-
|
17
|
+
import "../../../chunks/chunk-ZSUG52DO.js";
|
18
|
+
import "../../../chunks/chunk-4XSDRT23.js";
|
19
19
|
import "../../../chunks/chunk-JMU5PDBD.js";
|
20
20
|
import "../../../chunks/chunk-FENXVJYO.js";
|
21
21
|
import "../../../chunks/chunk-WSFCRVEQ.js";
|
@@ -1,26 +1,26 @@
|
|
1
1
|
import {
|
2
2
|
storage_exports
|
3
|
-
} from "../../chunks/chunk-
|
4
|
-
import "../../chunks/chunk-
|
5
|
-
import "../../chunks/chunk-
|
3
|
+
} from "../../chunks/chunk-T4HGXBXC.js";
|
4
|
+
import "../../chunks/chunk-AIEEEZLK.js";
|
5
|
+
import "../../chunks/chunk-G5RRNREY.js";
|
6
6
|
import "../../chunks/chunk-HWVEI3RH.js";
|
7
|
+
import "../../chunks/chunk-YKPA3MQL.js";
|
7
8
|
import "../../chunks/chunk-PAIUCLVK.js";
|
8
9
|
import "../../chunks/chunk-42K3MQQ5.js";
|
9
|
-
import "../../chunks/chunk-
|
10
|
-
import "../../chunks/chunk-UXEKCYL7.js";
|
10
|
+
import "../../chunks/chunk-OMTDHKJI.js";
|
11
11
|
import "../../chunks/chunk-ZNA7SWFK.js";
|
12
|
-
import "../../chunks/chunk-
|
12
|
+
import "../../chunks/chunk-HJARCTOH.js";
|
13
|
+
import "../../chunks/chunk-7J7CYOXU.js";
|
14
|
+
import "../../chunks/chunk-6IYUA43Q.js";
|
13
15
|
import "../../chunks/chunk-W3RXHN5I.js";
|
14
16
|
import "../../chunks/chunk-FB3GNE2B.js";
|
15
|
-
import "../../chunks/chunk-QLDN574K.js";
|
16
|
-
import "../../chunks/chunk-V3L55I2S.js";
|
17
17
|
import "../../chunks/chunk-CWZFRUBS.js";
|
18
18
|
import "../../chunks/chunk-5VHFXWFM.js";
|
19
|
+
import "../../chunks/chunk-V3L55I2S.js";
|
19
20
|
import "../../chunks/chunk-2JH4TCT2.js";
|
20
|
-
import "../../chunks/chunk-37TRFYZT.js";
|
21
21
|
import "../../chunks/chunk-BWYH445G.js";
|
22
|
-
import "../../chunks/chunk-
|
23
|
-
import "../../chunks/chunk-
|
22
|
+
import "../../chunks/chunk-37TRFYZT.js";
|
23
|
+
import "../../chunks/chunk-QLDN574K.js";
|
24
24
|
import "../../chunks/chunk-JMU5PDBD.js";
|
25
25
|
import "../../chunks/chunk-FENXVJYO.js";
|
26
26
|
import "../../chunks/chunk-WSFCRVEQ.js";
|
@@ -1,16 +1,16 @@
|
|
1
|
-
import "../../../../chunks/chunk-
|
1
|
+
import "../../../../chunks/chunk-OMTDHKJI.js";
|
2
2
|
import {
|
3
3
|
get_metadata_exports
|
4
4
|
} from "../../../../chunks/chunk-ZNA7SWFK.js";
|
5
5
|
import {
|
6
|
-
|
7
|
-
} from "../../../../chunks/chunk-
|
6
|
+
move_dir_exports
|
7
|
+
} from "../../../../chunks/chunk-BWYH445G.js";
|
8
8
|
import {
|
9
9
|
list_exports
|
10
10
|
} from "../../../../chunks/chunk-37TRFYZT.js";
|
11
11
|
import {
|
12
|
-
|
13
|
-
} from "../../../../chunks/chunk-
|
12
|
+
remove_dir_exports
|
13
|
+
} from "../../../../chunks/chunk-QLDN574K.js";
|
14
14
|
import "../../../../chunks/chunk-JMU5PDBD.js";
|
15
15
|
import "../../../../chunks/chunk-FENXVJYO.js";
|
16
16
|
import "../../../../chunks/chunk-WSFCRVEQ.js";
|
@@ -1,16 +1,16 @@
|
|
1
|
-
import "../../../../chunks/chunk-
|
2
|
-
import {
|
3
|
-
remove_dir_exports
|
4
|
-
} from "../../../../chunks/chunk-QLDN574K.js";
|
1
|
+
import "../../../../chunks/chunk-HJARCTOH.js";
|
5
2
|
import {
|
6
3
|
copy_dir_exports
|
7
4
|
} from "../../../../chunks/chunk-V3L55I2S.js";
|
5
|
+
import {
|
6
|
+
move_dir_exports
|
7
|
+
} from "../../../../chunks/chunk-BWYH445G.js";
|
8
8
|
import {
|
9
9
|
list_exports
|
10
10
|
} from "../../../../chunks/chunk-37TRFYZT.js";
|
11
11
|
import {
|
12
|
-
|
13
|
-
} from "../../../../chunks/chunk-
|
12
|
+
remove_dir_exports
|
13
|
+
} from "../../../../chunks/chunk-QLDN574K.js";
|
14
14
|
import "../../../../chunks/chunk-JMU5PDBD.js";
|
15
15
|
import "../../../../chunks/chunk-FENXVJYO.js";
|
16
16
|
import "../../../../chunks/chunk-WSFCRVEQ.js";
|
@@ -1,10 +1,13 @@
|
|
1
|
-
import "../../../../chunks/chunk-
|
1
|
+
import "../../../../chunks/chunk-AIEEEZLK.js";
|
2
2
|
import {
|
3
3
|
revoke_signed_urls_exports
|
4
|
-
} from "../../../../chunks/chunk-
|
4
|
+
} from "../../../../chunks/chunk-G5RRNREY.js";
|
5
5
|
import {
|
6
6
|
update_metadata_exports
|
7
7
|
} from "../../../../chunks/chunk-HWVEI3RH.js";
|
8
|
+
import {
|
9
|
+
get_permissions_exports
|
10
|
+
} from "../../../../chunks/chunk-YKPA3MQL.js";
|
8
11
|
import {
|
9
12
|
generate_signed_url_exports
|
10
13
|
} from "../../../../chunks/chunk-PAIUCLVK.js";
|
@@ -12,8 +15,11 @@ import {
|
|
12
15
|
get_metadata_exports
|
13
16
|
} from "../../../../chunks/chunk-42K3MQQ5.js";
|
14
17
|
import {
|
15
|
-
|
16
|
-
} from "../../../../chunks/chunk-
|
18
|
+
remove_exports
|
19
|
+
} from "../../../../chunks/chunk-7J7CYOXU.js";
|
20
|
+
import {
|
21
|
+
move_exports
|
22
|
+
} from "../../../../chunks/chunk-6IYUA43Q.js";
|
17
23
|
import {
|
18
24
|
stat_exports
|
19
25
|
} from "../../../../chunks/chunk-W3RXHN5I.js";
|
@@ -29,12 +35,6 @@ import {
|
|
29
35
|
import {
|
30
36
|
download_exports
|
31
37
|
} from "../../../../chunks/chunk-2JH4TCT2.js";
|
32
|
-
import {
|
33
|
-
move_exports
|
34
|
-
} from "../../../../chunks/chunk-6IYUA43Q.js";
|
35
|
-
import {
|
36
|
-
remove_exports
|
37
|
-
} from "../../../../chunks/chunk-7J7CYOXU.js";
|
38
38
|
import "../../../../chunks/chunk-JMU5PDBD.js";
|
39
39
|
import "../../../../chunks/chunk-FENXVJYO.js";
|
40
40
|
import "../../../../chunks/chunk-WSFCRVEQ.js";
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import {
|
2
2
|
revokeSignedUrls
|
3
|
-
} from "../../../../../chunks/chunk-
|
3
|
+
} from "../../../../../chunks/chunk-G5RRNREY.js";
|
4
|
+
import "../../../../../chunks/chunk-7J7CYOXU.js";
|
4
5
|
import "../../../../../chunks/chunk-FB3GNE2B.js";
|
5
6
|
import "../../../../../chunks/chunk-2JH4TCT2.js";
|
6
|
-
import "../../../../../chunks/chunk-7J7CYOXU.js";
|
7
7
|
import "../../../../../chunks/chunk-JMU5PDBD.js";
|
8
8
|
import "../../../../../chunks/chunk-FENXVJYO.js";
|
9
9
|
import "../../../../../chunks/chunk-WSFCRVEQ.js";
|
@@ -1,30 +1,30 @@
|
|
1
|
-
import "../../../chunks/chunk-
|
1
|
+
import "../../../chunks/chunk-T4HGXBXC.js";
|
2
2
|
import {
|
3
3
|
file_exports
|
4
|
-
} from "../../../chunks/chunk-
|
5
|
-
import "../../../chunks/chunk-
|
4
|
+
} from "../../../chunks/chunk-AIEEEZLK.js";
|
5
|
+
import "../../../chunks/chunk-G5RRNREY.js";
|
6
6
|
import "../../../chunks/chunk-HWVEI3RH.js";
|
7
|
+
import "../../../chunks/chunk-YKPA3MQL.js";
|
7
8
|
import "../../../chunks/chunk-PAIUCLVK.js";
|
8
9
|
import "../../../chunks/chunk-42K3MQQ5.js";
|
9
|
-
import "../../../chunks/chunk-YKPA3MQL.js";
|
10
10
|
import {
|
11
11
|
bucket_exports
|
12
|
-
} from "../../../chunks/chunk-
|
12
|
+
} from "../../../chunks/chunk-OMTDHKJI.js";
|
13
13
|
import "../../../chunks/chunk-ZNA7SWFK.js";
|
14
14
|
import {
|
15
15
|
directory_exports
|
16
|
-
} from "../../../chunks/chunk-
|
16
|
+
} from "../../../chunks/chunk-HJARCTOH.js";
|
17
|
+
import "../../../chunks/chunk-7J7CYOXU.js";
|
18
|
+
import "../../../chunks/chunk-6IYUA43Q.js";
|
17
19
|
import "../../../chunks/chunk-W3RXHN5I.js";
|
18
20
|
import "../../../chunks/chunk-FB3GNE2B.js";
|
19
|
-
import "../../../chunks/chunk-QLDN574K.js";
|
20
|
-
import "../../../chunks/chunk-V3L55I2S.js";
|
21
21
|
import "../../../chunks/chunk-CWZFRUBS.js";
|
22
22
|
import "../../../chunks/chunk-5VHFXWFM.js";
|
23
|
+
import "../../../chunks/chunk-V3L55I2S.js";
|
23
24
|
import "../../../chunks/chunk-2JH4TCT2.js";
|
24
|
-
import "../../../chunks/chunk-37TRFYZT.js";
|
25
25
|
import "../../../chunks/chunk-BWYH445G.js";
|
26
|
-
import "../../../chunks/chunk-
|
27
|
-
import "../../../chunks/chunk-
|
26
|
+
import "../../../chunks/chunk-37TRFYZT.js";
|
27
|
+
import "../../../chunks/chunk-QLDN574K.js";
|
28
28
|
import "../../../chunks/chunk-JMU5PDBD.js";
|
29
29
|
import "../../../chunks/chunk-FENXVJYO.js";
|
30
30
|
import "../../../chunks/chunk-WSFCRVEQ.js";
|