golar 0.1.4 → 0.1.6
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/builtin-rules.d.ts +2 -3
- package/dist/builtin-rules.generated.d.ts +3 -3
- package/dist/codegen-plugin.js +0 -1
- package/dist/config.js +32 -15
- package/dist/internal/linter/rule-creator.d.ts +3 -2
- package/dist/internal/linter/rule-creator.js +10 -10
- package/dist/internal/linter/rules/explicit-anys/config.js +3 -3
- package/dist/node_modules/.pnpm/valibot@1.3.1_typescript@5.9.3/node_modules/valibot/dist/index.d.ts +1430 -0
- package/dist/node_modules/.pnpm/valibot@1.3.1_typescript@5.9.3/node_modules/valibot/dist/index.js +658 -0
- package/dist/packages/golar/package.js +3 -2
- package/dist/workspace.js +2 -2
- package/package.json +10 -9
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/errors.d.ts +0 -22
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/errors.js +0 -29
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/iso.js +0 -37
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/parse.d.ts +0 -16
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/parse.js +0 -19
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/schemas.d.ts +0 -208
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/schemas.js +0 -578
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/api.d.ts +0 -32
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/api.js +0 -470
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/checks.d.ts +0 -64
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/checks.js +0 -225
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/core.d.ts +0 -47
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/core.js +0 -61
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/doc.js +0 -33
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/errors.d.ts +0 -127
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/errors.js +0 -62
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/json-schema-processors.js +0 -214
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/json-schema.d.ts +0 -69
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/parse.js +0 -109
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/regexes.js +0 -58
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/registries.d.ts +0 -31
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/registries.js +0 -49
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/schemas.d.ts +0 -805
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/schemas.js +0 -1096
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/standard-schema.d.ts +0 -120
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/to-json-schema.d.ts +0 -96
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/to-json-schema.js +0 -289
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/util.d.ts +0 -41
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/util.js +0 -304
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/versions.d.ts +0 -8
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/versions.js +0 -9
|
@@ -1,304 +0,0 @@
|
|
|
1
|
-
//#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/util.js
|
|
2
|
-
function getEnumValues(entries) {
|
|
3
|
-
const numericValues = Object.values(entries).filter((v) => typeof v === "number");
|
|
4
|
-
return Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
|
|
5
|
-
}
|
|
6
|
-
function jsonStringifyReplacer(_, value) {
|
|
7
|
-
if (typeof value === "bigint") return value.toString();
|
|
8
|
-
return value;
|
|
9
|
-
}
|
|
10
|
-
function cached(getter) {
|
|
11
|
-
return { get value() {
|
|
12
|
-
{
|
|
13
|
-
const value = getter();
|
|
14
|
-
Object.defineProperty(this, "value", { value });
|
|
15
|
-
return value;
|
|
16
|
-
}
|
|
17
|
-
throw new Error("cached value already set");
|
|
18
|
-
} };
|
|
19
|
-
}
|
|
20
|
-
function nullish(input) {
|
|
21
|
-
return input === null || input === void 0;
|
|
22
|
-
}
|
|
23
|
-
function cleanRegex(source) {
|
|
24
|
-
const start = source.startsWith("^") ? 1 : 0;
|
|
25
|
-
const end = source.endsWith("$") ? source.length - 1 : source.length;
|
|
26
|
-
return source.slice(start, end);
|
|
27
|
-
}
|
|
28
|
-
const EVALUATING = Symbol("evaluating");
|
|
29
|
-
function defineLazy(object, key, getter) {
|
|
30
|
-
let value = void 0;
|
|
31
|
-
Object.defineProperty(object, key, {
|
|
32
|
-
get() {
|
|
33
|
-
if (value === EVALUATING) return;
|
|
34
|
-
if (value === void 0) {
|
|
35
|
-
value = EVALUATING;
|
|
36
|
-
value = getter();
|
|
37
|
-
}
|
|
38
|
-
return value;
|
|
39
|
-
},
|
|
40
|
-
set(v) {
|
|
41
|
-
Object.defineProperty(object, key, { value: v });
|
|
42
|
-
},
|
|
43
|
-
configurable: true
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
function assignProp(target, prop, value) {
|
|
47
|
-
Object.defineProperty(target, prop, {
|
|
48
|
-
value,
|
|
49
|
-
writable: true,
|
|
50
|
-
enumerable: true,
|
|
51
|
-
configurable: true
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
function mergeDefs(...defs) {
|
|
55
|
-
const mergedDescriptors = {};
|
|
56
|
-
for (const def of defs) {
|
|
57
|
-
const descriptors = Object.getOwnPropertyDescriptors(def);
|
|
58
|
-
Object.assign(mergedDescriptors, descriptors);
|
|
59
|
-
}
|
|
60
|
-
return Object.defineProperties({}, mergedDescriptors);
|
|
61
|
-
}
|
|
62
|
-
function esc(str) {
|
|
63
|
-
return JSON.stringify(str);
|
|
64
|
-
}
|
|
65
|
-
function slugify(input) {
|
|
66
|
-
return input.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
67
|
-
}
|
|
68
|
-
const captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => {};
|
|
69
|
-
function isObject(data) {
|
|
70
|
-
return typeof data === "object" && data !== null && !Array.isArray(data);
|
|
71
|
-
}
|
|
72
|
-
const allowsEval = cached(() => {
|
|
73
|
-
if (typeof navigator !== "undefined" && navigator?.userAgent?.includes("Cloudflare")) return false;
|
|
74
|
-
try {
|
|
75
|
-
new Function("");
|
|
76
|
-
return true;
|
|
77
|
-
} catch (_) {
|
|
78
|
-
return false;
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
function isPlainObject(o) {
|
|
82
|
-
if (isObject(o) === false) return false;
|
|
83
|
-
const ctor = o.constructor;
|
|
84
|
-
if (ctor === void 0) return true;
|
|
85
|
-
if (typeof ctor !== "function") return true;
|
|
86
|
-
const prot = ctor.prototype;
|
|
87
|
-
if (isObject(prot) === false) return false;
|
|
88
|
-
if (Object.prototype.hasOwnProperty.call(prot, "isPrototypeOf") === false) return false;
|
|
89
|
-
return true;
|
|
90
|
-
}
|
|
91
|
-
function shallowClone(o) {
|
|
92
|
-
if (isPlainObject(o)) return { ...o };
|
|
93
|
-
if (Array.isArray(o)) return [...o];
|
|
94
|
-
return o;
|
|
95
|
-
}
|
|
96
|
-
const propertyKeyTypes = new Set([
|
|
97
|
-
"string",
|
|
98
|
-
"number",
|
|
99
|
-
"symbol"
|
|
100
|
-
]);
|
|
101
|
-
function escapeRegex(str) {
|
|
102
|
-
return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
103
|
-
}
|
|
104
|
-
function clone(inst, def, params) {
|
|
105
|
-
const cl = new inst._zod.constr(def ?? inst._zod.def);
|
|
106
|
-
if (!def || params?.parent) cl._zod.parent = inst;
|
|
107
|
-
return cl;
|
|
108
|
-
}
|
|
109
|
-
function normalizeParams(_params) {
|
|
110
|
-
const params = _params;
|
|
111
|
-
if (!params) return {};
|
|
112
|
-
if (typeof params === "string") return { error: () => params };
|
|
113
|
-
if (params?.message !== void 0) {
|
|
114
|
-
if (params?.error !== void 0) throw new Error("Cannot specify both `message` and `error` params");
|
|
115
|
-
params.error = params.message;
|
|
116
|
-
}
|
|
117
|
-
delete params.message;
|
|
118
|
-
if (typeof params.error === "string") return {
|
|
119
|
-
...params,
|
|
120
|
-
error: () => params.error
|
|
121
|
-
};
|
|
122
|
-
return params;
|
|
123
|
-
}
|
|
124
|
-
function optionalKeys(shape) {
|
|
125
|
-
return Object.keys(shape).filter((k) => {
|
|
126
|
-
return shape[k]._zod.optin === "optional" && shape[k]._zod.optout === "optional";
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
const NUMBER_FORMAT_RANGES = {
|
|
130
|
-
safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
|
|
131
|
-
int32: [-2147483648, 2147483647],
|
|
132
|
-
uint32: [0, 4294967295],
|
|
133
|
-
float32: [-34028234663852886e22, 34028234663852886e22],
|
|
134
|
-
float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
|
|
135
|
-
};
|
|
136
|
-
function pick(schema, mask) {
|
|
137
|
-
const currDef = schema._zod.def;
|
|
138
|
-
const checks = currDef.checks;
|
|
139
|
-
if (checks && checks.length > 0) throw new Error(".pick() cannot be used on object schemas containing refinements");
|
|
140
|
-
return clone(schema, mergeDefs(schema._zod.def, {
|
|
141
|
-
get shape() {
|
|
142
|
-
const newShape = {};
|
|
143
|
-
for (const key in mask) {
|
|
144
|
-
if (!(key in currDef.shape)) throw new Error(`Unrecognized key: "${key}"`);
|
|
145
|
-
if (!mask[key]) continue;
|
|
146
|
-
newShape[key] = currDef.shape[key];
|
|
147
|
-
}
|
|
148
|
-
assignProp(this, "shape", newShape);
|
|
149
|
-
return newShape;
|
|
150
|
-
},
|
|
151
|
-
checks: []
|
|
152
|
-
}));
|
|
153
|
-
}
|
|
154
|
-
function omit(schema, mask) {
|
|
155
|
-
const currDef = schema._zod.def;
|
|
156
|
-
const checks = currDef.checks;
|
|
157
|
-
if (checks && checks.length > 0) throw new Error(".omit() cannot be used on object schemas containing refinements");
|
|
158
|
-
return clone(schema, mergeDefs(schema._zod.def, {
|
|
159
|
-
get shape() {
|
|
160
|
-
const newShape = { ...schema._zod.def.shape };
|
|
161
|
-
for (const key in mask) {
|
|
162
|
-
if (!(key in currDef.shape)) throw new Error(`Unrecognized key: "${key}"`);
|
|
163
|
-
if (!mask[key]) continue;
|
|
164
|
-
delete newShape[key];
|
|
165
|
-
}
|
|
166
|
-
assignProp(this, "shape", newShape);
|
|
167
|
-
return newShape;
|
|
168
|
-
},
|
|
169
|
-
checks: []
|
|
170
|
-
}));
|
|
171
|
-
}
|
|
172
|
-
function extend(schema, shape) {
|
|
173
|
-
if (!isPlainObject(shape)) throw new Error("Invalid input to extend: expected a plain object");
|
|
174
|
-
const checks = schema._zod.def.checks;
|
|
175
|
-
if (checks && checks.length > 0) {
|
|
176
|
-
const existingShape = schema._zod.def.shape;
|
|
177
|
-
for (const key in shape) if (Object.getOwnPropertyDescriptor(existingShape, key) !== void 0) throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
|
|
178
|
-
}
|
|
179
|
-
return clone(schema, mergeDefs(schema._zod.def, { get shape() {
|
|
180
|
-
const _shape = {
|
|
181
|
-
...schema._zod.def.shape,
|
|
182
|
-
...shape
|
|
183
|
-
};
|
|
184
|
-
assignProp(this, "shape", _shape);
|
|
185
|
-
return _shape;
|
|
186
|
-
} }));
|
|
187
|
-
}
|
|
188
|
-
function safeExtend(schema, shape) {
|
|
189
|
-
if (!isPlainObject(shape)) throw new Error("Invalid input to safeExtend: expected a plain object");
|
|
190
|
-
return clone(schema, mergeDefs(schema._zod.def, { get shape() {
|
|
191
|
-
const _shape = {
|
|
192
|
-
...schema._zod.def.shape,
|
|
193
|
-
...shape
|
|
194
|
-
};
|
|
195
|
-
assignProp(this, "shape", _shape);
|
|
196
|
-
return _shape;
|
|
197
|
-
} }));
|
|
198
|
-
}
|
|
199
|
-
function merge(a, b) {
|
|
200
|
-
return clone(a, mergeDefs(a._zod.def, {
|
|
201
|
-
get shape() {
|
|
202
|
-
const _shape = {
|
|
203
|
-
...a._zod.def.shape,
|
|
204
|
-
...b._zod.def.shape
|
|
205
|
-
};
|
|
206
|
-
assignProp(this, "shape", _shape);
|
|
207
|
-
return _shape;
|
|
208
|
-
},
|
|
209
|
-
get catchall() {
|
|
210
|
-
return b._zod.def.catchall;
|
|
211
|
-
},
|
|
212
|
-
checks: []
|
|
213
|
-
}));
|
|
214
|
-
}
|
|
215
|
-
function partial(Class, schema, mask) {
|
|
216
|
-
const checks = schema._zod.def.checks;
|
|
217
|
-
if (checks && checks.length > 0) throw new Error(".partial() cannot be used on object schemas containing refinements");
|
|
218
|
-
return clone(schema, mergeDefs(schema._zod.def, {
|
|
219
|
-
get shape() {
|
|
220
|
-
const oldShape = schema._zod.def.shape;
|
|
221
|
-
const shape = { ...oldShape };
|
|
222
|
-
if (mask) for (const key in mask) {
|
|
223
|
-
if (!(key in oldShape)) throw new Error(`Unrecognized key: "${key}"`);
|
|
224
|
-
if (!mask[key]) continue;
|
|
225
|
-
shape[key] = Class ? new Class({
|
|
226
|
-
type: "optional",
|
|
227
|
-
innerType: oldShape[key]
|
|
228
|
-
}) : oldShape[key];
|
|
229
|
-
}
|
|
230
|
-
else for (const key in oldShape) shape[key] = Class ? new Class({
|
|
231
|
-
type: "optional",
|
|
232
|
-
innerType: oldShape[key]
|
|
233
|
-
}) : oldShape[key];
|
|
234
|
-
assignProp(this, "shape", shape);
|
|
235
|
-
return shape;
|
|
236
|
-
},
|
|
237
|
-
checks: []
|
|
238
|
-
}));
|
|
239
|
-
}
|
|
240
|
-
function required(Class, schema, mask) {
|
|
241
|
-
return clone(schema, mergeDefs(schema._zod.def, { get shape() {
|
|
242
|
-
const oldShape = schema._zod.def.shape;
|
|
243
|
-
const shape = { ...oldShape };
|
|
244
|
-
if (mask) for (const key in mask) {
|
|
245
|
-
if (!(key in shape)) throw new Error(`Unrecognized key: "${key}"`);
|
|
246
|
-
if (!mask[key]) continue;
|
|
247
|
-
shape[key] = new Class({
|
|
248
|
-
type: "nonoptional",
|
|
249
|
-
innerType: oldShape[key]
|
|
250
|
-
});
|
|
251
|
-
}
|
|
252
|
-
else for (const key in oldShape) shape[key] = new Class({
|
|
253
|
-
type: "nonoptional",
|
|
254
|
-
innerType: oldShape[key]
|
|
255
|
-
});
|
|
256
|
-
assignProp(this, "shape", shape);
|
|
257
|
-
return shape;
|
|
258
|
-
} }));
|
|
259
|
-
}
|
|
260
|
-
function aborted(x, startIndex = 0) {
|
|
261
|
-
if (x.aborted === true) return true;
|
|
262
|
-
for (let i = startIndex; i < x.issues.length; i++) if (x.issues[i]?.continue !== true) return true;
|
|
263
|
-
return false;
|
|
264
|
-
}
|
|
265
|
-
function prefixIssues(path, issues) {
|
|
266
|
-
return issues.map((iss) => {
|
|
267
|
-
var _a;
|
|
268
|
-
(_a = iss).path ?? (_a.path = []);
|
|
269
|
-
iss.path.unshift(path);
|
|
270
|
-
return iss;
|
|
271
|
-
});
|
|
272
|
-
}
|
|
273
|
-
function unwrapMessage(message) {
|
|
274
|
-
return typeof message === "string" ? message : message?.message;
|
|
275
|
-
}
|
|
276
|
-
function finalizeIssue(iss, ctx, config) {
|
|
277
|
-
const full = {
|
|
278
|
-
...iss,
|
|
279
|
-
path: iss.path ?? []
|
|
280
|
-
};
|
|
281
|
-
if (!iss.message) full.message = unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config.customError?.(iss)) ?? unwrapMessage(config.localeError?.(iss)) ?? "Invalid input";
|
|
282
|
-
delete full.inst;
|
|
283
|
-
delete full.continue;
|
|
284
|
-
if (!ctx?.reportInput) delete full.input;
|
|
285
|
-
return full;
|
|
286
|
-
}
|
|
287
|
-
function getLengthableOrigin(input) {
|
|
288
|
-
if (Array.isArray(input)) return "array";
|
|
289
|
-
if (typeof input === "string") return "string";
|
|
290
|
-
return "unknown";
|
|
291
|
-
}
|
|
292
|
-
function issue(...args) {
|
|
293
|
-
const [iss, input, inst] = args;
|
|
294
|
-
if (typeof iss === "string") return {
|
|
295
|
-
message: iss,
|
|
296
|
-
code: "custom",
|
|
297
|
-
input,
|
|
298
|
-
inst
|
|
299
|
-
};
|
|
300
|
-
return { ...iss };
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
//#endregion
|
|
304
|
-
export { aborted, allowsEval, cached, captureStackTrace, cleanRegex, clone, defineLazy, esc, escapeRegex, extend, finalizeIssue, getEnumValues, getLengthableOrigin, isObject, isPlainObject, issue, jsonStringifyReplacer, merge, mergeDefs, normalizeParams, nullish, omit, optionalKeys, partial, pick, prefixIssues, propertyKeyTypes, required, safeExtend, shallowClone, slugify };
|