paperlint 19.0.2 → 20.0.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/.claude-plugin/plugin.json +1 -1
- package/CLAUDE.md +2 -2
- package/dist/CLAUDE.md.spec.d.ts.map +1 -1
- package/dist/CLAUDE.md.spec.js +7 -1
- package/dist/CLAUDE.md.spec.js.map +1 -1
- package/dist/cli.d.ts +2 -21
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +45 -93
- package/dist/cli.js.map +1 -1
- package/dist/doctor.d.ts +8 -10
- package/dist/doctor.d.ts.map +1 -1
- package/dist/doctor.js +27 -37
- package/dist/doctor.js.map +1 -1
- package/dist/hooks-notice.d.ts +8 -2
- package/dist/hooks-notice.d.ts.map +1 -1
- package/dist/hooks-notice.js +15 -20
- package/dist/hooks-notice.js.map +1 -1
- package/dist/hooks-settings.d.ts +1 -1
- package/dist/hooks-settings.js +1 -1
- package/dist/init.d.ts +1 -1
- package/dist/init.js +5 -5
- package/dist/lib/paper-config.d.ts +4 -9
- package/dist/lib/paper-config.d.ts.map +1 -1
- package/dist/lib/paper-config.js +4 -9
- package/dist/lib/paper-config.js.map +1 -1
- package/dist/papers-roots.d.ts +19 -0
- package/dist/papers-roots.d.ts.map +1 -0
- package/dist/papers-roots.js +42 -0
- package/dist/papers-roots.js.map +1 -0
- package/dist/retired-hooks.d.ts +6 -0
- package/dist/retired-hooks.d.ts.map +1 -0
- package/dist/retired-hooks.js +34 -0
- package/dist/retired-hooks.js.map +1 -0
- package/dist/skill-chunks/chunk-C2G5EK7S.js +579 -0
- package/dist/skill-chunks/{chunk-UL4INX2P.js → chunk-L3NJUJUP.js} +446 -446
- package/dist/skill-chunks/{chunk-EOVEVX67.js → chunk-X4VKG4KT.js} +1 -1
- package/dist/types.d.ts +1 -1
- package/docs/install.md +9 -11
- package/docs/layout.md +2 -4
- package/docs/rules/paper/allowed-files-only.md +1 -2
- package/docs/testing.md +1 -1
- package/eslint.config.mjs +1 -1
- package/lib/paper-config.harness.mjs +3 -6
- package/lib/paper-config.ts +4 -9
- package/lib/skill-eval-kit.mjs +0 -14
- package/package.json +2 -4
- package/plugin/hooks/hooks.json +0 -13
- package/scripts/coverage-config.test.ts +0 -2
- package/scripts/eslint-file-length.mjs +0 -1
- package/skills/argument-arc/scripts/headings.js +2 -2
- package/skills/build-label-page/scripts/label-page.js +125 -125
- package/skills/cold-read-diff/scripts/cold-read.js +11 -11
- package/skills/paper-pipeline/scripts/extract-ref-facts.js +3 -3
- package/skills/paper-status/SKILL.md +1 -2
- package/skills/paper-status/SKILL.md.spec.ts +0 -1
- package/skills/pc-panel-review/scripts/prior-reviews.js +1 -1
- package/skills/verify-citations/scripts/bib-authors.js +3 -3
- package/skills/verify-citations/scripts/verify-cites.js +3 -3
- package/src/CLAUDE.md +16 -1
- package/src/CLAUDE.md.spec.ts +12 -1
- package/src/cli.harness.mjs +14 -79
- package/src/cli.test.ts +4 -34
- package/src/cli.ts +47 -140
- package/src/doctor.harness.mjs +17 -59
- package/src/doctor.test.ts +1 -1
- package/src/doctor.ts +26 -41
- package/src/domain/paper-folder.test.ts +1 -1
- package/src/hooks-notice.test.ts +21 -74
- package/src/hooks-notice.ts +30 -20
- package/src/hooks-settings.harness.ts +25 -27
- package/src/hooks-settings.ts +1 -1
- package/src/in-process-hooks.test.ts +18 -0
- package/src/init.ts +5 -5
- package/src/lint-edited-site-example.test.ts +0 -3
- package/src/papers-roots.test.ts +56 -0
- package/src/papers-roots.ts +56 -0
- package/src/retired-hooks.test.ts +155 -0
- package/src/retired-hooks.ts +41 -0
- package/src/types.ts +1 -1
- package/dist/skill-chunks/chunk-GRSXIWYF.js +0 -352
- package/hooks/CLAUDE.md +0 -34
- package/hooks/CLAUDE.md.spec.ts +0 -30
- package/hooks/hooks.harness.ts +0 -566
- package/hooks/paper-edit-guard.hook.d.mts +0 -12
- package/hooks/paper-edit-guard.hook.mjs +0 -443
- package/hooks/paper-edit-guard.test.ts +0 -66
- package/hooks/paper-skills-nudge.hook.d.mts +0 -22
- package/hooks/paper-skills-nudge.hook.mjs +0 -193
- package/hooks/paper-skills-nudge.test.ts +0 -122
- package/lib/trigger-ledger.mjs +0 -215
|
@@ -0,0 +1,579 @@
|
|
|
1
|
+
import { createRequire as __plCreateRequire } from "node:module";
|
|
2
|
+
import { fileURLToPath as __plFileURLToPath } from "node:url";
|
|
3
|
+
import { dirname as __plDirname } from "node:path";
|
|
4
|
+
const require = __plCreateRequire(import.meta.url);
|
|
5
|
+
const __filename = __plFileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __plDirname(__filename);
|
|
7
|
+
|
|
8
|
+
// node_modules/remeda/dist/dataLastImplementation-Bv4VSrOR.js
|
|
9
|
+
var dataLastImplementation1 = (dataFirst, argument) => (data) => dataFirst(data, argument);
|
|
10
|
+
|
|
11
|
+
// node_modules/remeda/dist/purryByArity-Cy9fRh2p.js
|
|
12
|
+
var purry1 = (dataFirst, argumentsLength, data) => argumentsLength >= 1 ? dataFirst(data) : dataFirst;
|
|
13
|
+
var purry2 = (dataFirst, argumentsLength, dataOrArgument, argument) => argumentsLength >= 2 ? dataFirst(dataOrArgument, argument) : dataLastImplementation1(dataFirst, dataOrArgument);
|
|
14
|
+
|
|
15
|
+
// node_modules/remeda/dist/chunk.js
|
|
16
|
+
function chunk(dataOrSize, size) {
|
|
17
|
+
return purry2(chunkImplementation, arguments.length, dataOrSize, size);
|
|
18
|
+
}
|
|
19
|
+
function chunkImplementation(data, size) {
|
|
20
|
+
if (size < 1) throw new RangeError(`chunk: A chunk size of '${size.toString()}' would result in an infinite array`);
|
|
21
|
+
if (data.length === 0) return [];
|
|
22
|
+
if (size >= data.length) return [data.concat()];
|
|
23
|
+
const chunks = Math.ceil(data.length / size);
|
|
24
|
+
const result = new Array(chunks);
|
|
25
|
+
for (let index = 0; index < chunks; index += 1) {
|
|
26
|
+
const start = index * size;
|
|
27
|
+
result[index] = data.slice(start, start + size);
|
|
28
|
+
}
|
|
29
|
+
return result;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// node_modules/remeda/dist/last.js
|
|
33
|
+
function last(data) {
|
|
34
|
+
return purry1(lastImplementation, arguments.length, data);
|
|
35
|
+
}
|
|
36
|
+
var lastImplementation = (data) => data.at(-1);
|
|
37
|
+
|
|
38
|
+
// node_modules/remeda/dist/countBy.js
|
|
39
|
+
function countBy(dataOrCategorizationFn, categorizationFn) {
|
|
40
|
+
return typeof dataOrCategorizationFn === "function" ? dataLast(dataOrCategorizationFn) : countByImplementation(dataOrCategorizationFn, categorizationFn);
|
|
41
|
+
}
|
|
42
|
+
var dataLast = (categorizationFn) => (data) => countByImplementation(data, categorizationFn);
|
|
43
|
+
var countByImplementation = (data, categorizationFn) => {
|
|
44
|
+
const out = /* @__PURE__ */ Object.create(null);
|
|
45
|
+
data.forEach((item, index) => {
|
|
46
|
+
const category = categorizationFn(item, index, data);
|
|
47
|
+
if (category !== void 0) out[category] = (out[category] ?? 0) + 1;
|
|
48
|
+
});
|
|
49
|
+
Object.setPrototypeOf(out, Object.prototype);
|
|
50
|
+
return out;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
// node_modules/remeda/dist/lazyControl-CRWUIUVK.js
|
|
54
|
+
var SKIP_ITEM = /* @__PURE__ */ Symbol.for("remeda/lazy/skip");
|
|
55
|
+
var MANY = /* @__PURE__ */ Symbol.for("remeda/lazy/many");
|
|
56
|
+
var NO_VALUES = [];
|
|
57
|
+
var createLazySlot = () => ({
|
|
58
|
+
value: void 0,
|
|
59
|
+
values: NO_VALUES
|
|
60
|
+
});
|
|
61
|
+
function manyLazyValues(values, slot) {
|
|
62
|
+
slot.values = values;
|
|
63
|
+
return MANY;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// node_modules/remeda/dist/lazyDataLastImplementation-DVJYwqUg.js
|
|
67
|
+
function withLazyImplementation(dataLast7, lazy, lazyArgument) {
|
|
68
|
+
dataLast7.lazy = lazy;
|
|
69
|
+
dataLast7.lazyArgument = lazyArgument;
|
|
70
|
+
return dataLast7;
|
|
71
|
+
}
|
|
72
|
+
function lazyDataLastImplementation0(dataFirst, lazy) {
|
|
73
|
+
const dataLast7 = (data) => dataFirst(data);
|
|
74
|
+
dataLast7.lazy = lazy;
|
|
75
|
+
dataLast7.lazyArgument = void 0;
|
|
76
|
+
return dataLast7;
|
|
77
|
+
}
|
|
78
|
+
function lazyDataLastImplementation1(dataFirst, lazy, argument) {
|
|
79
|
+
const dataLast7 = dataLastImplementation1(dataFirst, argument);
|
|
80
|
+
dataLast7.lazy = lazy;
|
|
81
|
+
dataLast7.lazyArgument = argument;
|
|
82
|
+
return dataLast7;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// node_modules/remeda/dist/purryWithLazyByArity-CWb0HTZi.js
|
|
86
|
+
var purryWithLazy1 = (dataFirst, lazy, argumentsLength, data) => argumentsLength >= 1 ? dataFirst(data) : lazyDataLastImplementation0(dataFirst, lazy);
|
|
87
|
+
var purryWithLazy2 = (dataFirst, lazy, argumentsLength, dataOrArgument, argument) => argumentsLength >= 2 ? dataFirst(dataOrArgument, argument) : lazyDataLastImplementation1(dataFirst, lazy, dataOrArgument);
|
|
88
|
+
|
|
89
|
+
// node_modules/remeda/dist/purryOrderRules-BLuMpepK.js
|
|
90
|
+
function purryOrderRules(func, inputArgs) {
|
|
91
|
+
const [dataOrRule, ...rules] = inputArgs;
|
|
92
|
+
if (!isOrderRule(dataOrRule)) return func(dataOrRule, orderRuleComparer(...rules));
|
|
93
|
+
const compareFn = orderRuleComparer(dataOrRule, ...rules);
|
|
94
|
+
return (data) => func(data, compareFn);
|
|
95
|
+
}
|
|
96
|
+
function orderRuleComparer(primaryRule, secondaryRule, ...otherRules) {
|
|
97
|
+
const projector = typeof primaryRule === "function" ? primaryRule : primaryRule[0];
|
|
98
|
+
const sign = typeof primaryRule === "function" || primaryRule[1] === "asc" ? 1 : -1;
|
|
99
|
+
const nextComparer = secondaryRule === void 0 ? void 0 : orderRuleComparer(secondaryRule, ...otherRules);
|
|
100
|
+
return (a, b) => {
|
|
101
|
+
const projectedA = projector(a);
|
|
102
|
+
const projectedB = projector(b);
|
|
103
|
+
if (projectedA > projectedB) return sign;
|
|
104
|
+
if (projectedA < projectedB) return -sign;
|
|
105
|
+
return nextComparer?.(a, b) ?? 0;
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
function isOrderRule(x) {
|
|
109
|
+
if (isProjection(x)) return true;
|
|
110
|
+
if (!Array.isArray(x) || x.length !== 2) return false;
|
|
111
|
+
return isProjection(x[0]) && (x[1] === "asc" || x[1] === "desc");
|
|
112
|
+
}
|
|
113
|
+
var isProjection = (x) => typeof x === "function" && x.length <= 1;
|
|
114
|
+
|
|
115
|
+
// node_modules/remeda/dist/requireData-eKl6kcG1.js
|
|
116
|
+
var requireData = (evaluator) => {
|
|
117
|
+
evaluator.requiresData = true;
|
|
118
|
+
return evaluator;
|
|
119
|
+
};
|
|
120
|
+
var requireDataByArity = (callback, dataParameterIndex, evaluator) => canReadData(callback, dataParameterIndex) ? requireData(evaluator) : evaluator;
|
|
121
|
+
var canReadData = ({ length }, dataParameterIndex) => length === 0 || length > dataParameterIndex;
|
|
122
|
+
|
|
123
|
+
// node_modules/remeda/dist/entries.js
|
|
124
|
+
function entries(data) {
|
|
125
|
+
return purry1(Object.entries, arguments.length, data);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// node_modules/remeda/dist/makeStoppable-DYALPttO.js
|
|
129
|
+
var STOP = /* @__PURE__ */ Symbol.for("remeda/lazy/stop");
|
|
130
|
+
var LAST = /* @__PURE__ */ Symbol.for("remeda/lazy/last");
|
|
131
|
+
var LAZY_EMPTY_EVALUATOR = () => STOP;
|
|
132
|
+
var makeStoppable = (fn) => Object.assign(fn, { isStoppable: true });
|
|
133
|
+
function lastLazyValue(value, slot) {
|
|
134
|
+
slot.value = value;
|
|
135
|
+
return LAST;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// node_modules/remeda/dist/flatMap.js
|
|
139
|
+
function flatMap(dataOrCallbackfn, callbackfn) {
|
|
140
|
+
return typeof dataOrCallbackfn === "function" ? withLazyImplementation(dataLast2(dataOrCallbackfn), lazyImplementation, dataOrCallbackfn) : flatMapImplementation(dataOrCallbackfn, callbackfn);
|
|
141
|
+
}
|
|
142
|
+
var dataLast2 = (callbackfn) => (data) => flatMapImplementation(data, callbackfn);
|
|
143
|
+
var flatMapImplementation = (data, callbackfn) => data.flatMap(callbackfn);
|
|
144
|
+
var lazyImplementation = (callbackfn) => requireDataByArity(callbackfn, 2, (value, index, data, slot) => {
|
|
145
|
+
const mapped = callbackfn(value, index, data);
|
|
146
|
+
return Array.isArray(mapped) ? manyLazyValues(mapped, slot) : mapped;
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
// node_modules/remeda/dist/forEachObj.js
|
|
150
|
+
function forEachObj(dataOrCallbackfn, callbackfn) {
|
|
151
|
+
return purry2(forEachObjImplementation, arguments.length, dataOrCallbackfn, callbackfn);
|
|
152
|
+
}
|
|
153
|
+
function forEachObjImplementation(data, fn) {
|
|
154
|
+
for (const entry of Object.entries(data)) fn(entry[1], entry[0], data);
|
|
155
|
+
return data;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// node_modules/remeda/dist/fromKeys.js
|
|
159
|
+
function fromKeys(dataOrMapper, mapper) {
|
|
160
|
+
return typeof dataOrMapper === "function" ? dataLast3(dataOrMapper) : fromKeysImplementation(dataOrMapper, mapper);
|
|
161
|
+
}
|
|
162
|
+
var dataLast3 = (mapper) => (data) => fromKeysImplementation(data, mapper);
|
|
163
|
+
function fromKeysImplementation(data, mapper) {
|
|
164
|
+
const result = {};
|
|
165
|
+
data.forEach((key, index) => {
|
|
166
|
+
const value = mapper(key, index, data);
|
|
167
|
+
if (key === "__proto__") Object.defineProperty(result, "__proto__", {
|
|
168
|
+
value,
|
|
169
|
+
configurable: true,
|
|
170
|
+
enumerable: true,
|
|
171
|
+
writable: true
|
|
172
|
+
});
|
|
173
|
+
else result[key] = value;
|
|
174
|
+
});
|
|
175
|
+
return result;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
// node_modules/remeda/dist/hasAtLeast.js
|
|
179
|
+
function hasAtLeast(dataOrMinimum, minimum) {
|
|
180
|
+
return purry2(hasAtLeastImplementation, arguments.length, dataOrMinimum, minimum);
|
|
181
|
+
}
|
|
182
|
+
var hasAtLeastImplementation = (data, minimum) => data.length >= minimum;
|
|
183
|
+
|
|
184
|
+
// node_modules/remeda/dist/indexBy.js
|
|
185
|
+
function indexBy(dataOrMapper, mapper) {
|
|
186
|
+
return typeof dataOrMapper === "function" ? dataLast4(dataOrMapper) : indexByImplementation(dataOrMapper, mapper);
|
|
187
|
+
}
|
|
188
|
+
var dataLast4 = (mapper) => (data) => indexByImplementation(data, mapper);
|
|
189
|
+
function indexByImplementation(data, mapper) {
|
|
190
|
+
const out = {};
|
|
191
|
+
data.forEach((item, index) => {
|
|
192
|
+
const key = mapper(item, index, data);
|
|
193
|
+
if (key === "__proto__") Object.defineProperty(out, "__proto__", {
|
|
194
|
+
value: item,
|
|
195
|
+
configurable: true,
|
|
196
|
+
enumerable: true,
|
|
197
|
+
writable: true
|
|
198
|
+
});
|
|
199
|
+
else out[key] = item;
|
|
200
|
+
});
|
|
201
|
+
return out;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
// node_modules/remeda/dist/isDefined.js
|
|
205
|
+
function isDefined(data) {
|
|
206
|
+
return data !== void 0;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
// node_modules/remeda/dist/isIncludedIn.js
|
|
210
|
+
function isIncludedIn(dataOrContainer, container) {
|
|
211
|
+
if (container === void 0) {
|
|
212
|
+
const asSet = new Set(dataOrContainer);
|
|
213
|
+
return (data) => asSet.has(data);
|
|
214
|
+
}
|
|
215
|
+
return container.includes(dataOrContainer);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
// node_modules/remeda/dist/mapKeys.js
|
|
219
|
+
function mapKeys(dataOrKeyMapper, keyMapper) {
|
|
220
|
+
return purry2(mapKeysImplementation, arguments.length, dataOrKeyMapper, keyMapper);
|
|
221
|
+
}
|
|
222
|
+
function mapKeysImplementation(data, keyMapper) {
|
|
223
|
+
const out = {};
|
|
224
|
+
for (const entry of Object.entries(data)) {
|
|
225
|
+
const value = entry[1];
|
|
226
|
+
const mappedKey = keyMapper(entry[0], value, data);
|
|
227
|
+
if (mappedKey === "__proto__") Object.defineProperty(out, "__proto__", {
|
|
228
|
+
value,
|
|
229
|
+
configurable: true,
|
|
230
|
+
enumerable: true,
|
|
231
|
+
writable: true
|
|
232
|
+
});
|
|
233
|
+
else out[mappedKey] = value;
|
|
234
|
+
}
|
|
235
|
+
return out;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
// node_modules/remeda/dist/mapValues.js
|
|
239
|
+
function mapValues(dataOrValueMapper, valueMapper) {
|
|
240
|
+
return purry2(mapValuesImplementation, arguments.length, dataOrValueMapper, valueMapper);
|
|
241
|
+
}
|
|
242
|
+
function mapValuesImplementation(data, valueMapper) {
|
|
243
|
+
const out = {};
|
|
244
|
+
for (const entry of Object.entries(data)) {
|
|
245
|
+
const key = entry[0];
|
|
246
|
+
const mappedValue = valueMapper(entry[1], key, data);
|
|
247
|
+
if (key === "__proto__") Object.defineProperty(out, "__proto__", {
|
|
248
|
+
value: mappedValue,
|
|
249
|
+
configurable: true,
|
|
250
|
+
enumerable: true,
|
|
251
|
+
writable: true
|
|
252
|
+
});
|
|
253
|
+
else out[key] = mappedValue;
|
|
254
|
+
}
|
|
255
|
+
return out;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
// node_modules/remeda/dist/mapWithFeedback.js
|
|
259
|
+
function mapWithFeedback(dataOrCallbackfn, callbackfnOrInitialValue, initialValue) {
|
|
260
|
+
return typeof dataOrCallbackfn === "function" ? withLazyImplementation(dataLast5(dataOrCallbackfn, callbackfnOrInitialValue), lazyImplementation2, [dataOrCallbackfn, callbackfnOrInitialValue]) : mapWithFeedbackImplementation(dataOrCallbackfn, callbackfnOrInitialValue, initialValue);
|
|
261
|
+
}
|
|
262
|
+
var dataLast5 = (callbackfn, initialValue) => (data) => mapWithFeedbackImplementation(data, callbackfn, initialValue);
|
|
263
|
+
function mapWithFeedbackImplementation(data, callbackfn, initialValue) {
|
|
264
|
+
let previousValue = initialValue;
|
|
265
|
+
const result = [];
|
|
266
|
+
for (const currentValue of data) {
|
|
267
|
+
previousValue = callbackfn(previousValue, currentValue, result.length, data);
|
|
268
|
+
result.push(previousValue);
|
|
269
|
+
}
|
|
270
|
+
return result;
|
|
271
|
+
}
|
|
272
|
+
function lazyImplementation2([callbackfn, initialValue]) {
|
|
273
|
+
let previousValue = initialValue;
|
|
274
|
+
return requireDataByArity(callbackfn, 3, (currentValue, index, data) => {
|
|
275
|
+
previousValue = callbackfn(previousValue, currentValue, index, data);
|
|
276
|
+
return previousValue;
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
// node_modules/remeda/dist/omit.js
|
|
281
|
+
function omit(dataOrKeys, keys) {
|
|
282
|
+
return purry2(omitImplementation, arguments.length, dataOrKeys, keys);
|
|
283
|
+
}
|
|
284
|
+
function omitImplementation(data, keys) {
|
|
285
|
+
if (keys.length === 0) return { ...data };
|
|
286
|
+
if (keys.length === 1) {
|
|
287
|
+
const { [keys[0]]: _omitted, ...remaining } = data;
|
|
288
|
+
return remaining;
|
|
289
|
+
}
|
|
290
|
+
const out = { ...data };
|
|
291
|
+
for (const key of keys) delete out[key];
|
|
292
|
+
return out;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
// node_modules/remeda/dist/once.js
|
|
296
|
+
function once(fn) {
|
|
297
|
+
let wasCalled = false;
|
|
298
|
+
let ret;
|
|
299
|
+
return () => {
|
|
300
|
+
if (!wasCalled) {
|
|
301
|
+
ret = fn();
|
|
302
|
+
wasCalled = true;
|
|
303
|
+
}
|
|
304
|
+
return ret;
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
// node_modules/remeda/dist/only.js
|
|
309
|
+
function only(data) {
|
|
310
|
+
return purry1(onlyImplementation, arguments.length, data);
|
|
311
|
+
}
|
|
312
|
+
var onlyImplementation = (data) => data.length === 1 ? data[0] : void 0;
|
|
313
|
+
|
|
314
|
+
// node_modules/remeda/dist/pick.js
|
|
315
|
+
function pick(dataOrKeys, keys) {
|
|
316
|
+
return purry2(pickImplementation, arguments.length, dataOrKeys, keys);
|
|
317
|
+
}
|
|
318
|
+
function pickImplementation(data, keys) {
|
|
319
|
+
const out = {};
|
|
320
|
+
for (const key of keys) if (key === "__proto__") {
|
|
321
|
+
if (Object.hasOwn(data, "__proto__")) Object.defineProperty(out, "__proto__", {
|
|
322
|
+
value: data[key],
|
|
323
|
+
configurable: true,
|
|
324
|
+
enumerable: true,
|
|
325
|
+
writable: true
|
|
326
|
+
});
|
|
327
|
+
} else if (key in data) out[key] = data[key];
|
|
328
|
+
return out;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
// node_modules/remeda/dist/pickBy.js
|
|
332
|
+
function pickBy(dataOrPredicate, predicate) {
|
|
333
|
+
return purry2(pickByImplementation, arguments.length, dataOrPredicate, predicate);
|
|
334
|
+
}
|
|
335
|
+
function pickByImplementation(data, predicate) {
|
|
336
|
+
const out = {};
|
|
337
|
+
for (const entry of Object.entries(data)) {
|
|
338
|
+
const key = entry[0];
|
|
339
|
+
const value = entry[1];
|
|
340
|
+
if (predicate(value, key, data)) {
|
|
341
|
+
if (key === "__proto__") Object.defineProperty(out, "__proto__", {
|
|
342
|
+
value,
|
|
343
|
+
configurable: true,
|
|
344
|
+
enumerable: true,
|
|
345
|
+
writable: true
|
|
346
|
+
});
|
|
347
|
+
else out[key] = value;
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
return out;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
// node_modules/remeda/dist/pipe-BXW1-oD4.js
|
|
354
|
+
var UNEXPECTED_ACCESS_MESSAGE = "Remeda: unexpected access to a callback's `data` argument during lazy evaluation.";
|
|
355
|
+
var ARRAY_INDEX = /^(?:0|[1-9]\d*)$/u;
|
|
356
|
+
var UNEXPECTED_ACCESS_SENTINEL = new Proxy([{ error: UNEXPECTED_ACCESS_MESSAGE }], {
|
|
357
|
+
get: throwOnArrayKey,
|
|
358
|
+
getOwnPropertyDescriptor: throwOnArrayKey,
|
|
359
|
+
has: throwOnArrayKey,
|
|
360
|
+
ownKeys: alwaysThrow,
|
|
361
|
+
defineProperty: alwaysThrow,
|
|
362
|
+
deleteProperty: alwaysThrow,
|
|
363
|
+
preventExtensions: alwaysThrow,
|
|
364
|
+
set: alwaysThrow,
|
|
365
|
+
setPrototypeOf: alwaysThrow
|
|
366
|
+
});
|
|
367
|
+
function throwOnArrayKey(_, key) {
|
|
368
|
+
if (key in Array.prototype || ARRAY_INDEX.test(String(key))) alwaysThrow();
|
|
369
|
+
}
|
|
370
|
+
function alwaysThrow() {
|
|
371
|
+
throw new Error(UNEXPECTED_ACCESS_MESSAGE);
|
|
372
|
+
}
|
|
373
|
+
function buildFusedSequence(functions, startIndex) {
|
|
374
|
+
const fusedSequence = [];
|
|
375
|
+
for (let index = startIndex; index < functions.length; index++) {
|
|
376
|
+
const currentFunction = functions[index];
|
|
377
|
+
if (!("lazy" in currentFunction)) break;
|
|
378
|
+
const lazyEvaluator = currentFunction.lazy(currentFunction.lazyArgument);
|
|
379
|
+
fusedSequence.push(lazyEvaluator.requiresData ? {
|
|
380
|
+
lazyEvaluator,
|
|
381
|
+
itemIndex: 0,
|
|
382
|
+
requiresData: true,
|
|
383
|
+
data: []
|
|
384
|
+
} : {
|
|
385
|
+
lazyEvaluator,
|
|
386
|
+
itemIndex: 0,
|
|
387
|
+
requiresData: false,
|
|
388
|
+
data: UNEXPECTED_ACCESS_SENTINEL
|
|
389
|
+
});
|
|
390
|
+
if (currentFunction.lazy.isReducing) break;
|
|
391
|
+
}
|
|
392
|
+
return fusedSequence;
|
|
393
|
+
}
|
|
394
|
+
function runFusedSequence(input, fusedSequence) {
|
|
395
|
+
const accumulator = [];
|
|
396
|
+
const slot = createLazySlot();
|
|
397
|
+
if (Array.isArray(input)) {
|
|
398
|
+
for (const item of input) if (processItem(fusedSequence, accumulator, item, slot, 0)) break;
|
|
399
|
+
} else for (const item of input) if (processItem(fusedSequence, accumulator, item, slot, 0)) break;
|
|
400
|
+
return accumulator;
|
|
401
|
+
}
|
|
402
|
+
function processItem(fusedSequence, accumulator, item, slot, firstStepIndex) {
|
|
403
|
+
let isDone = false;
|
|
404
|
+
let currentItem = item;
|
|
405
|
+
for (let stepIndex = firstStepIndex; stepIndex < fusedSequence.length; stepIndex++) {
|
|
406
|
+
const step = fusedSequence[stepIndex];
|
|
407
|
+
if (step.requiresData) step.data.push(currentItem);
|
|
408
|
+
const { lazyEvaluator } = step;
|
|
409
|
+
const result = lazyEvaluator(currentItem, step.itemIndex, step.data, slot);
|
|
410
|
+
step.itemIndex += 1;
|
|
411
|
+
if (typeof result === "symbol") {
|
|
412
|
+
if (result === SKIP_ITEM) return isDone;
|
|
413
|
+
if (result === MANY) {
|
|
414
|
+
for (const subItem of slot.values) if (processItem(fusedSequence, accumulator, subItem, slot, stepIndex + 1)) return true;
|
|
415
|
+
return isDone;
|
|
416
|
+
}
|
|
417
|
+
if (result === LAST) {
|
|
418
|
+
currentItem = slot.value;
|
|
419
|
+
isDone = true;
|
|
420
|
+
continue;
|
|
421
|
+
}
|
|
422
|
+
if (result === STOP) return true;
|
|
423
|
+
}
|
|
424
|
+
currentItem = result;
|
|
425
|
+
}
|
|
426
|
+
accumulator.push(currentItem);
|
|
427
|
+
return isDone;
|
|
428
|
+
}
|
|
429
|
+
function iterableDataFirst(input, lazy, lazyArgument) {
|
|
430
|
+
const lazyEvaluator = lazy(lazyArgument);
|
|
431
|
+
const dataBuffer = lazyEvaluator.requiresData ? [] : void 0;
|
|
432
|
+
const data = dataBuffer ?? UNEXPECTED_ACCESS_SENTINEL;
|
|
433
|
+
const slot = createLazySlot();
|
|
434
|
+
const accumulator = [];
|
|
435
|
+
let index = 0;
|
|
436
|
+
for (const item of input) {
|
|
437
|
+
dataBuffer?.push(item);
|
|
438
|
+
const isDone = collect(lazyEvaluator(item, index, data, slot), accumulator, slot);
|
|
439
|
+
index += 1;
|
|
440
|
+
if (isDone) break;
|
|
441
|
+
}
|
|
442
|
+
return lazy.isReducing ? accumulator[0] : accumulator;
|
|
443
|
+
}
|
|
444
|
+
function collect(result, accumulator, slot) {
|
|
445
|
+
if (typeof result === "symbol") {
|
|
446
|
+
if (result === SKIP_ITEM) return false;
|
|
447
|
+
if (result === MANY) {
|
|
448
|
+
for (const subItem of slot.values) accumulator.push(subItem);
|
|
449
|
+
return false;
|
|
450
|
+
}
|
|
451
|
+
if (result === LAST) {
|
|
452
|
+
accumulator.push(slot.value);
|
|
453
|
+
return true;
|
|
454
|
+
}
|
|
455
|
+
if (result === STOP) return true;
|
|
456
|
+
}
|
|
457
|
+
accumulator.push(result);
|
|
458
|
+
return false;
|
|
459
|
+
}
|
|
460
|
+
function pipe(input, ...functions) {
|
|
461
|
+
let output = input;
|
|
462
|
+
for (let functionIndex = 0; functionIndex < functions.length; functionIndex += 1) {
|
|
463
|
+
const currentFunction = functions[functionIndex];
|
|
464
|
+
if (!("lazy" in currentFunction)) {
|
|
465
|
+
output = currentFunction(output);
|
|
466
|
+
continue;
|
|
467
|
+
}
|
|
468
|
+
const nextFunction = functions[functionIndex + 1];
|
|
469
|
+
if (nextFunction === void 0 || !("lazy" in nextFunction) || currentFunction.lazy.isReducing) {
|
|
470
|
+
output = Array.isArray(output) ? currentFunction(output) : iterableDataFirst(output, currentFunction.lazy, currentFunction.lazyArgument);
|
|
471
|
+
continue;
|
|
472
|
+
}
|
|
473
|
+
if (Array.isArray(output) && !isStoppableFrom(functions, functionIndex)) {
|
|
474
|
+
output = currentFunction(output);
|
|
475
|
+
continue;
|
|
476
|
+
}
|
|
477
|
+
const fusedSequence = buildFusedSequence(functions, functionIndex);
|
|
478
|
+
const fusedOutput = runFusedSequence(output, fusedSequence);
|
|
479
|
+
functionIndex += fusedSequence.length - 1;
|
|
480
|
+
output = functions[functionIndex].lazy.isReducing ? fusedOutput[0] : fusedOutput;
|
|
481
|
+
}
|
|
482
|
+
return output;
|
|
483
|
+
}
|
|
484
|
+
function isStoppableFrom(functions, fromIndex) {
|
|
485
|
+
for (let candidateIndex = fromIndex; candidateIndex < functions.length; candidateIndex++) {
|
|
486
|
+
const candidate = functions[candidateIndex];
|
|
487
|
+
if (!("lazy" in candidate)) return false;
|
|
488
|
+
if (candidate.lazy.isStoppable) return true;
|
|
489
|
+
if (candidate.lazy.isReducing) return false;
|
|
490
|
+
}
|
|
491
|
+
return false;
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
// node_modules/remeda/dist/pullObject.js
|
|
495
|
+
function pullObject(dataOrKeyExtractor, keyExtractorOrValueExtractor, valueExtractor) {
|
|
496
|
+
return typeof dataOrKeyExtractor === "function" ? dataLast6(dataOrKeyExtractor, keyExtractorOrValueExtractor) : pullObjectImplementation(dataOrKeyExtractor, keyExtractorOrValueExtractor, valueExtractor);
|
|
497
|
+
}
|
|
498
|
+
var dataLast6 = (keyExtractor, valueExtractor) => (data) => pullObjectImplementation(data, keyExtractor, valueExtractor);
|
|
499
|
+
function pullObjectImplementation(data, keyExtractor, valueExtractor) {
|
|
500
|
+
const result = {};
|
|
501
|
+
data.forEach((item, index) => {
|
|
502
|
+
const key = keyExtractor(item, index, data);
|
|
503
|
+
const value = valueExtractor(item, index, data);
|
|
504
|
+
if (key === "__proto__") Object.defineProperty(result, "__proto__", {
|
|
505
|
+
value,
|
|
506
|
+
configurable: true,
|
|
507
|
+
enumerable: true,
|
|
508
|
+
writable: true
|
|
509
|
+
});
|
|
510
|
+
else result[key] = value;
|
|
511
|
+
});
|
|
512
|
+
return result;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
// node_modules/remeda/dist/sortBy.js
|
|
516
|
+
function sortBy(...args) {
|
|
517
|
+
return purryOrderRules(sortByImplementation, args);
|
|
518
|
+
}
|
|
519
|
+
var sortByImplementation = (data, compareFn) => data.concat().sort(compareFn);
|
|
520
|
+
|
|
521
|
+
// node_modules/remeda/dist/unique.js
|
|
522
|
+
function unique(data) {
|
|
523
|
+
return purryWithLazy1(uniqueImplementation, lazyImplementation3, arguments.length, data);
|
|
524
|
+
}
|
|
525
|
+
function uniqueImplementation(data) {
|
|
526
|
+
const seen = /* @__PURE__ */ new Set();
|
|
527
|
+
const result = [];
|
|
528
|
+
for (const value of data) {
|
|
529
|
+
const sizeBefore = seen.size;
|
|
530
|
+
seen.add(value);
|
|
531
|
+
if (seen.size > sizeBefore) result.push(value);
|
|
532
|
+
}
|
|
533
|
+
return result;
|
|
534
|
+
}
|
|
535
|
+
function lazyImplementation3() {
|
|
536
|
+
const seen = /* @__PURE__ */ new Set();
|
|
537
|
+
return (value) => {
|
|
538
|
+
const sizeBefore = seen.size;
|
|
539
|
+
seen.add(value);
|
|
540
|
+
return seen.size === sizeBefore ? SKIP_ITEM : value;
|
|
541
|
+
};
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
// node_modules/remeda/dist/zip.js
|
|
545
|
+
function zip(dataOrOther, other) {
|
|
546
|
+
return purryWithLazy2(zipImplementation, lazyImplementation4, arguments.length, dataOrOther, other);
|
|
547
|
+
}
|
|
548
|
+
var zipImplementation = (data, other) => data.length < other.length ? data.map((item, index) => [item, other[index]]) : other.map((item, index) => [data[index], item]);
|
|
549
|
+
var lazyImplementation4 = makeStoppable((other) => other.length === 0 ? LAZY_EMPTY_EVALUATOR : (value, index, _data, slot) => {
|
|
550
|
+
const pair = [value, other[index]];
|
|
551
|
+
return index >= other.length - 1 ? lastLazyValue(pair, slot) : pair;
|
|
552
|
+
});
|
|
553
|
+
|
|
554
|
+
export {
|
|
555
|
+
chunk,
|
|
556
|
+
countBy,
|
|
557
|
+
entries,
|
|
558
|
+
flatMap,
|
|
559
|
+
forEachObj,
|
|
560
|
+
fromKeys,
|
|
561
|
+
hasAtLeast,
|
|
562
|
+
indexBy,
|
|
563
|
+
isDefined,
|
|
564
|
+
isIncludedIn,
|
|
565
|
+
last,
|
|
566
|
+
mapKeys,
|
|
567
|
+
mapValues,
|
|
568
|
+
mapWithFeedback,
|
|
569
|
+
omit,
|
|
570
|
+
once,
|
|
571
|
+
only,
|
|
572
|
+
pick,
|
|
573
|
+
pickBy,
|
|
574
|
+
pipe,
|
|
575
|
+
pullObject,
|
|
576
|
+
sortBy,
|
|
577
|
+
unique,
|
|
578
|
+
zip
|
|
579
|
+
};
|