@neocompose/cli 0.70.4 → 0.70.5

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.
@@ -43,13 +43,15 @@ var require_ignore = __commonJS({
43
43
  var EMPTY = "";
44
44
  var SPACE = " ";
45
45
  var ESCAPE = "\\";
46
- var REGEX_TEST_BLANK_LINE = /^\s+$/;
46
+ var REGEX_LITERAL_SPECIAL = /[.*+?()[\]{}^$|\\/]/;
47
+ var BOM = "\uFEFF";
47
48
  var REGEX_INVALID_TRAILING_BACKSLASH = /(?:[^\\]|^)\\$/;
48
49
  var REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION = /^\\!/;
49
50
  var REGEX_REPLACE_LEADING_EXCAPED_HASH = /^\\#/;
50
51
  var REGEX_SPLITALL_CRLF = /\r?\n/g;
51
- var REGEX_TEST_INVALID_PATH = /^\.{0,2}\/|^\.{1,2}$/;
52
- var REGEX_TEST_TRAILING_SLASH = /\/$/;
52
+ var DOUBLE_SLASH = "//";
53
+ var SLASH_CODE = 47;
54
+ var DOT_CODE = 46;
53
55
  var SLASH = "/";
54
56
  var TMP_KEY_IGNORE = "node-ignore";
55
57
  if (typeof Symbol !== "undefined") {
@@ -60,44 +62,173 @@ var require_ignore = __commonJS({
60
62
  Object.defineProperty(object, key, { value });
61
63
  return value;
62
64
  };
63
- var REGEX_REGEXP_RANGE = /([0-z])-([0-z])/g;
64
65
  var RETURN_FALSE = () => false;
65
- var sanitizeRange = (range2) => range2.replace(
66
- REGEX_REGEXP_RANGE,
67
- (match, from, to) => from.charCodeAt(0) <= to.charCodeAt(0) ? match : EMPTY
68
- );
69
- var negateRange = (range2) => range2.startsWith("!") || range2.startsWith("\\^") ? `^${range2.slice(range2[0] === "!" ? 1 : 2)}` : range2;
70
66
  var cleanRangeBackSlash = (slashes) => {
71
67
  const { length } = slashes;
72
68
  return slashes.slice(0, length - length % 2);
73
69
  };
70
+ var POSIX_CLASSES = {
71
+ alnum: "0-9A-Za-z",
72
+ alpha: "A-Za-z",
73
+ blank: " \\t",
74
+ cntrl: "\\x00-\\x1f\\x7f",
75
+ digit: "0-9",
76
+ graph: "!-.0-~",
77
+ lower: "a-z",
78
+ print: " -.0-~",
79
+ punct: "!-.:-@\\[-`{-~",
80
+ // git's `sane-ctype.h` classifies \v and \f as control, not space,
81
+ // unlike C's `isspace`
82
+ space: " \\t\\n\\r",
83
+ upper: "A-Z",
84
+ xdigit: "0-9A-Fa-f"
85
+ };
86
+ var CLASS_MEMBERS_TO_ESCAPE = "\\]^-[";
87
+ var escapeMember = (char) => CLASS_MEMBERS_TO_ESCAPE.indexOf(char) < 0 ? char : ESCAPE + char;
88
+ var NON_SLASH = "(?!\\/)";
89
+ var classSource = (negated, body) => {
90
+ if (negated) {
91
+ return `[^\\/${body}]`;
92
+ }
93
+ const source = `[${body}]`;
94
+ return new RegExp(source).test("/") ? NON_SLASH + source : source;
95
+ };
96
+ var scanBracket = (pattern, start) => {
97
+ const { length } = pattern;
98
+ let index = start + 1;
99
+ let negated = EMPTY;
100
+ const lead = pattern[index];
101
+ if (lead === "!" || lead === "^") {
102
+ negated = "^";
103
+ index++;
104
+ }
105
+ let body = EMPTY;
106
+ let prev = EMPTY;
107
+ for (; ; ) {
108
+ const char = pattern[index];
109
+ if (char === UNDEFINED) {
110
+ return null;
111
+ }
112
+ if (char === ESCAPE) {
113
+ const escaped = pattern[index + 1];
114
+ if (escaped === UNDEFINED) {
115
+ return null;
116
+ }
117
+ body += escapeMember(escaped);
118
+ prev = escaped;
119
+ index++;
120
+ } else if (char === "-" && prev && index + 1 < length && pattern[index + 1] !== "]") {
121
+ index++;
122
+ let to = pattern[index];
123
+ if (to === ESCAPE) {
124
+ to = pattern[index += 1];
125
+ }
126
+ if (prev <= to) {
127
+ body += `-${escapeMember(to)}`;
128
+ }
129
+ prev = EMPTY;
130
+ } else if (char === "[" && pattern[index + 1] === ":") {
131
+ const nameStart = index + 2;
132
+ let end = nameStart;
133
+ while (end < length && pattern[end] !== "]") {
134
+ end++;
135
+ }
136
+ if (end === length) {
137
+ return null;
138
+ }
139
+ if (end > nameStart && pattern[end - 1] === ":") {
140
+ const expanded = POSIX_CLASSES[pattern.slice(nameStart, end - 1)];
141
+ if (expanded === UNDEFINED) {
142
+ return null;
143
+ }
144
+ body += expanded;
145
+ prev = EMPTY;
146
+ index = end;
147
+ } else {
148
+ body += escapeMember("[");
149
+ prev = "[";
150
+ index = nameStart - 2;
151
+ }
152
+ } else {
153
+ body += escapeMember(char);
154
+ prev = char;
155
+ }
156
+ index++;
157
+ if (pattern[index] === "]") {
158
+ return {
159
+ end: index,
160
+ source: classSource(negated, body)
161
+ };
162
+ }
163
+ }
164
+ };
165
+ var NEVER_MATCH = "[]";
166
+ var PLACEHOLDER = "\0";
167
+ var REGEX_RESTORE_PLACEHOLDER = new RegExp(
168
+ `${PLACEHOLDER}(\\d+)${PLACEHOLDER}`,
169
+ "g"
170
+ );
171
+ var TRAILING_WILDCARD = "\uE000";
172
+ var TRAILING_DOUBLESTAR = "\uE001";
173
+ var extractBrackets = (pattern) => {
174
+ const sources2 = [];
175
+ const hold = (source) => `${PLACEHOLDER}${sources2.push(source) - 1}${PLACEHOLDER}`;
176
+ const { length } = pattern;
177
+ let out = EMPTY;
178
+ let index = 0;
179
+ while (index < length) {
180
+ const char = pattern[index];
181
+ if (char === ESCAPE) {
182
+ const escaped = pattern[index + 1];
183
+ if (escaped === UNDEFINED || escaped === SLASH && index + 2 === length) {
184
+ out += hold(NEVER_MATCH);
185
+ } else if (escaped === "*" || escaped === "[" || escaped === SPACE || escaped === ESCAPE) {
186
+ out += pattern.slice(index, index + 2);
187
+ } else {
188
+ out += hold(
189
+ REGEX_LITERAL_SPECIAL.test(escaped) ? ESCAPE + escaped : escaped
190
+ );
191
+ }
192
+ index += 2;
193
+ } else if (char === PLACEHOLDER) {
194
+ out += hold(`[${PLACEHOLDER}]`);
195
+ index++;
196
+ } else if (char === "[") {
197
+ const scanned = scanBracket(pattern, index);
198
+ if (scanned === null) {
199
+ out += hold(NEVER_MATCH);
200
+ index = length;
201
+ } else {
202
+ out += hold(scanned.source);
203
+ index = scanned.end + 1;
204
+ }
205
+ } else {
206
+ out += char;
207
+ index++;
208
+ }
209
+ }
210
+ return {
211
+ source: out,
212
+ sources: sources2
213
+ };
214
+ };
215
+ var DIRECT = null;
216
+ var REGEX_INNER_SLASH = /\/(?!$)/;
74
217
  var REPLACERS = [
75
- [
76
- // Remove BOM
77
- // TODO:
78
- // Other similar zero-width characters?
79
- /^\uFEFF/,
80
- () => EMPTY
81
- ],
82
- // > Trailing spaces are ignored unless they are quoted with backslash ("\")
83
- [
84
- // (a\ ) -> (a )
85
- // (a ) -> (a)
86
- // (a ) -> (a)
87
- // (a \ ) -> (a )
88
- /((?:\\\\)*?)(\\?\s+)$/,
89
- (_, m1, m2) => m1 + (m2.indexOf("\\") === 0 ? SPACE : EMPTY)
90
- ],
91
218
  // Replace (\ ) with ' '
219
+ // Only a space: an escaped tab or other whitespace is already a literal by
220
+ // the time it reaches here, and a bare tab must be left as one, not turned
221
+ // into a space.
92
222
  // (\ ) -> ' '
93
223
  // (\\ ) -> '\\ '
94
224
  // (\\\ ) -> '\\ '
95
225
  [
96
- /(\\+?)\s/g,
97
- (_, m1) => {
98
- const { length } = m1;
99
- return m1.slice(0, length - length % 2) + SPACE;
100
- }
226
+ // A run of backslashes is taken whole, from its first one, so no match
227
+ // ever starts again inside it -- `(\\+?) ` did, which made a long run
228
+ // quadratic.
229
+ /(\\+)( ?)/g,
230
+ (_, run, space) => space ? run.slice(0, run.length - run.length % 2) + SPACE : run,
231
+ ESCAPE + SPACE
101
232
  ],
102
233
  // Escape metacharacters
103
234
  // which is written down by users but means special for regular expressions.
@@ -122,7 +253,8 @@ var require_ignore = __commonJS({
122
253
  [
123
254
  // > a question mark (?) matches a single character
124
255
  /(?!\\)\?/g,
125
- () => "[^/]"
256
+ () => "[^/]",
257
+ "?"
126
258
  ],
127
259
  // leading slash
128
260
  [
@@ -130,12 +262,14 @@ var require_ignore = __commonJS({
130
262
  // > For example, "/*.c" matches "cat-file.c" but not "mozilla-sha1/sha1.c".
131
263
  // A leading slash matches the beginning of the pathname
132
264
  /^\//,
133
- () => "^"
265
+ () => "^",
266
+ SLASH
134
267
  ],
135
268
  // replace special metacharacter slash after the leading slash
136
269
  [
137
270
  /\//g,
138
- () => "\\/"
271
+ () => "\\/",
272
+ SLASH
139
273
  ],
140
274
  [
141
275
  // > A leading "**" followed by a slash means match in all directories.
@@ -146,16 +280,21 @@ var require_ignore = __commonJS({
146
280
  // Notice that the '*'s have been replaced as '\\*'
147
281
  /^\^*(?:\\\*\\\*\\\/)+/,
148
282
  // '**/foo' <-> 'foo'
149
- () => "^(?:.*\\/)?"
283
+ () => "^(?:.*\\/)?",
284
+ "*"
150
285
  ],
151
286
  // starting
152
287
  [
153
288
  // there will be no leading '/'
154
289
  // (which has been replaced by section "leading slash")
155
290
  // If starts with '**', adding a '^' to the regular expression also works
156
- /^(?=[^^])/,
157
- function startingReplacer() {
158
- return !/\/(?!$)/.test(this) ? "(?:^|\\/)" : "^";
291
+ DIRECT,
292
+ (source, pattern) => {
293
+ if (!source || source[0] === "^") {
294
+ return source;
295
+ }
296
+ const anchor = !REGEX_INNER_SLASH.test(pattern) ? "(?:^|\\/)" : "^";
297
+ return anchor + source;
159
298
  }
160
299
  ],
161
300
  // two globstars
@@ -165,7 +304,8 @@ var require_ignore = __commonJS({
165
304
  // Zero, one or several directories
166
305
  // should not use '*', or it will be replaced by the next replacer
167
306
  // Check if it is not the last `'/**'`
168
- (_, index, str) => index + 6 < str.length ? "(?:\\/[^\\/]+)*" : "\\/.+"
307
+ (_, index, str) => index + 6 < str.length ? str.slice(index + 6) === "\\/" ? "(?:\\/[^\\/]+)+" : "(?:\\/[^\\/]+)*" : `\\/${TRAILING_DOUBLESTAR}`,
308
+ "*"
169
309
  ],
170
310
  // normal intermediate wildcards
171
311
  [
@@ -180,32 +320,56 @@ var require_ignore = __commonJS({
180
320
  (_, p1, p2) => {
181
321
  const unescaped = p2.replace(/\\\*/g, "[^\\/]*");
182
322
  return p1 + unescaped;
183
- }
323
+ },
324
+ "*"
325
+ ],
326
+ // trailing wildcard, held apart from a literal star
327
+ [
328
+ // The step above leaves a trailing `*` alone, so a single `\*` is all that
329
+ // can be left at the end here. Whether it is a wildcard or a literal
330
+ // turns on the backslashes the user put in front of it: the escaper has
331
+ // since doubled every one, so what stands here is those `2N` doubled
332
+ // backslashes and then the star's own escape. An even number of the
333
+ // original `N` leaves the star unescaped -- a wildcard -- and an odd
334
+ // number escapes it -- a literal. This runs while the two are still
335
+ // distinct, before the unescape steps below collapse the literal onto
336
+ // the very `\*` a wildcard leaves behind.
337
+ /(^|[^\\])((?:\\\\)*)\\\*$/,
338
+ (match, p1, p2) => (
339
+ // `p2` holds the doubled user backslashes; half of them is `N`.
340
+ p2.length / 2 % 2 === 0 ? p1 + p2 + TRAILING_WILDCARD : match
341
+ ),
342
+ "*"
184
343
  ],
185
344
  [
186
345
  // unescape, revert step 3 except for back slash
187
346
  // For example, if a user escape a '\\*',
188
347
  // after step 3, the result will be '\\\\\\*'
189
348
  /\\\\\\(?=[$.|*+(){^])/g,
190
- () => ESCAPE
349
+ () => ESCAPE,
350
+ ESCAPE + ESCAPE
191
351
  ],
192
352
  [
193
353
  // '\\\\' -> '\\'
194
354
  /\\\\/g,
195
- () => ESCAPE
355
+ () => ESCAPE,
356
+ ESCAPE + ESCAPE
196
357
  ],
197
358
  [
198
- // > The range notation, e.g. [a-zA-Z],
199
- // > can be used to match one of the characters in a range.
359
+ // Every real bracket expression -- POSIX classes included -- has already
360
+ // been held aside by `extractBrackets`, so the only `[` left in the
361
+ // pattern is an escaped, literal one.
200
362
  // `\` is escaped by step 3
201
- /(\\)?\[([^\]/]*?)(\\*)($|\])/g,
202
- (match, leadEscape, range2, endEscape, close) => leadEscape === ESCAPE ? `\\[${range2}${cleanRangeBackSlash(endEscape)}${close}` : close === "]" ? endEscape.length % 2 === 0 ? `[${negateRange(sanitizeRange(range2))}${endEscape}]` : "[]" : "[]"
363
+ /\\\[([^\]/]*?)(\\*)($|\])/g,
364
+ // '\\[bar]' -> '\\\\[bar\\]'
365
+ (match, range2, endEscape, close) => `\\[${range2}${cleanRangeBackSlash(endEscape)}${close}`,
366
+ "["
203
367
  ],
204
368
  // ending
205
369
  [
206
370
  // 'js' will not match 'js.'
207
371
  // 'ab' will not match 'abc'
208
- /(?:[^*])$/,
372
+ DIRECT,
209
373
  // WTF!
210
374
  // https://git-scm.com/docs/gitignore
211
375
  // changes in [2.22.1](https://git-scm.com/docs/gitignore/2.22.1)
@@ -216,29 +380,175 @@ var require_ignore = __commonJS({
216
380
  // 'js*' will not match 'a.js'
217
381
  // 'js/' will not match 'a.js'
218
382
  // 'js' will match 'a.js' and 'a.js/'
219
- (match) => /\/$/.test(match) ? `${match}$` : `${match}(?=$|\\/$)`
383
+ (source) => {
384
+ const last = source[source.length - 1];
385
+ if (!last || last === TRAILING_WILDCARD || last === TRAILING_DOUBLESTAR) {
386
+ return source;
387
+ }
388
+ return last === SLASH ? `${source}$` : `${source}(?=$|\\/$)`;
389
+ }
220
390
  ]
221
391
  ];
222
- var REGEX_REPLACE_TRAILING_WILDCARD = /(^|\\\/)?\\\*$/;
392
+ var REGEX_REPLACE_TRAILING_WILDCARD = /(^|\\\/)?\uE000$/;
223
393
  var MODE_IGNORE = "regex";
224
394
  var MODE_CHECK_IGNORE = "checkRegex";
225
395
  var UNDERSCORE = "_";
226
- var TRAILING_WILD_CARD_REPLACERS = {
227
- [MODE_IGNORE](_, p1) {
228
- const prefix = p1 ? `${p1}[^/]+` : "[^/]*";
229
- return `${prefix}(?=$|\\/$)`;
230
- },
231
- [MODE_CHECK_IGNORE](_, p1) {
232
- const prefix = p1 ? `${p1}[^/]*` : "[^/]*";
233
- return `${prefix}(?=$|\\/$)`;
396
+ var replaceTrailingWildcard = (_, p1) => {
397
+ const prefix = p1 ? `${p1}[^/]+` : "[^/]*";
398
+ return `${prefix}(?=$|\\/$)`;
399
+ };
400
+ var REGEX_REPLACE_TRAILING_DOUBLESTAR = /\uE001$/;
401
+ var replaceTrailingDoublestar = () => ".+(?=$|\\/$)";
402
+ var WILDCARD = "[^\\/]*";
403
+ var separatorAfter = (run, at2) => {
404
+ let separator = EMPTY;
405
+ for (let index = at2 + 1; index < run.length && !run[index].wildcard; index++) {
406
+ separator += run[index].single;
407
+ }
408
+ return separator;
409
+ };
410
+ var pinWildcards = (source) => {
411
+ if (source.indexOf(WILDCARD) < 0) {
412
+ return source;
413
+ }
414
+ const tokens = [];
415
+ const { length } = source;
416
+ let index = 0;
417
+ while (index < length) {
418
+ const char = source[index];
419
+ if (source.startsWith(WILDCARD, index)) {
420
+ tokens.push({ wildcard: true });
421
+ index += WILDCARD.length;
422
+ } else if (char === "[") {
423
+ let end = index + 1;
424
+ if (source[end] === "^") {
425
+ end++;
426
+ }
427
+ if (source[end] === "]") {
428
+ end++;
429
+ }
430
+ while (end < length && source[end] !== "]") {
431
+ end += source[end] === ESCAPE ? 2 : 1;
432
+ }
433
+ end++;
434
+ tokens.push({ single: source.slice(index, end) });
435
+ index = end;
436
+ } else if (char === ESCAPE) {
437
+ tokens.push({ single: source.slice(index, index + 2) });
438
+ index += 2;
439
+ } else if (char === "(") {
440
+ let depth = 0;
441
+ let end = index;
442
+ do {
443
+ if (source[end] === ESCAPE) {
444
+ end++;
445
+ } else if (source[end] === "(") {
446
+ depth++;
447
+ } else if (source[end] === ")") {
448
+ depth--;
449
+ }
450
+ end++;
451
+ } while (end < length && depth > 0);
452
+ if ("*+?".indexOf(source[end]) >= 0) {
453
+ end++;
454
+ }
455
+ tokens.push({ boundary: source.slice(index, end) });
456
+ index = end;
457
+ } else if (char === "^" || char === "$") {
458
+ tokens.push({ boundary: char });
459
+ index++;
460
+ } else {
461
+ tokens.push({ single: char });
462
+ index++;
463
+ }
234
464
  }
465
+ let out = EMPTY;
466
+ let run = [];
467
+ const flush = () => {
468
+ let lastWildcard;
469
+ run.forEach((token, at2) => {
470
+ if (token.wildcard) {
471
+ lastWildcard = at2;
472
+ }
473
+ });
474
+ run.forEach((token, at2) => {
475
+ if (!token.wildcard) {
476
+ out += token.single;
477
+ return;
478
+ }
479
+ out += at2 === lastWildcard ? WILDCARD : `(?:(?!${separatorAfter(run, at2)})[^\\/])*`;
480
+ });
481
+ run = [];
482
+ };
483
+ tokens.forEach((token) => {
484
+ if (token.boundary === void 0) {
485
+ run.push(token);
486
+ return;
487
+ }
488
+ flush();
489
+ out += token.boundary;
490
+ });
491
+ flush();
492
+ return out;
493
+ };
494
+ var makeRegexPrefix = (pattern) => {
495
+ const { source, sources: sources2 } = extractBrackets(pattern);
496
+ const replaced = REPLACERS.reduce(
497
+ // A pass whose matcher finds nothing hands back the very string it was
498
+ // given, so asking first costs a search and saves a rewrite. Ten of the
499
+ // fifteen passes never fire for a typical .gitignore line, and between
500
+ // them they were 45% of this chain.
501
+ (prev, [matcher, replacer, required]) => {
502
+ if (matcher === DIRECT) {
503
+ return replacer(prev, pattern);
504
+ }
505
+ if (required !== UNDEFINED && prev.indexOf(required) < 0) {
506
+ return prev;
507
+ }
508
+ return matcher.test(prev) ? prev.replace(matcher, replacer.bind(pattern)) : prev;
509
+ },
510
+ source
511
+ );
512
+ return sources2.length ? replaced.replace(
513
+ REGEX_RESTORE_PLACEHOLDER,
514
+ (match, index) => sources2[index]
515
+ ) : replaced;
516
+ };
517
+ var checkSourceOf = (body, prefix) => {
518
+ if (body[body.length - 1] === SLASH) {
519
+ prefix = makeRegexPrefix(body.slice(0, -1));
520
+ }
521
+ const head = prefix.slice(0, -1);
522
+ const last = prefix[prefix.length - 1];
523
+ return last === TRAILING_WILDCARD ? `${head}$` : last === TRAILING_DOUBLESTAR ? `${head}.*$` : NEVER_MATCH;
524
+ };
525
+ var matchesBasename = (body) => {
526
+ const index = body.indexOf(SLASH);
527
+ return index < 0 || index === body.length - 1;
528
+ };
529
+ var basenameOf = (path) => {
530
+ const end = path.length - 1;
531
+ const index = path.lastIndexOf(
532
+ SLASH,
533
+ path[end] === SLASH ? end - 1 : end
534
+ );
535
+ return index < 0 ? path : path.slice(index + 1);
536
+ };
537
+ var parentOf = (path) => {
538
+ if (path.charCodeAt(0) === SLASH_CODE || path.indexOf(DOUBLE_SLASH) >= 0) {
539
+ const slices = path.split(SLASH).filter(Boolean);
540
+ slices.pop();
541
+ return slices.length ? slices.join(SLASH) + SLASH : EMPTY;
542
+ }
543
+ const end = path.length - 1;
544
+ const cut = path.lastIndexOf(
545
+ SLASH,
546
+ path.charCodeAt(end) === SLASH_CODE ? end - 1 : end
547
+ );
548
+ return cut < 0 ? EMPTY : path.slice(0, cut + 1);
235
549
  };
236
- var makeRegexPrefix = (pattern) => REPLACERS.reduce(
237
- (prev, [matcher, replacer]) => prev.replace(matcher, replacer.bind(pattern)),
238
- pattern
239
- );
240
550
  var isString2 = (subject) => typeof subject === "string";
241
- var checkPattern = (pattern) => pattern && isString2(pattern) && !REGEX_TEST_BLANK_LINE.test(pattern) && !REGEX_INVALID_TRAILING_BACKSLASH.test(pattern) && pattern.indexOf("#") !== 0;
551
+ var checkPattern = (pattern) => pattern && isString2(pattern) && !REGEX_INVALID_TRAILING_BACKSLASH.test(pattern);
242
552
  var splitPattern = (pattern) => pattern.split(REGEX_SPLITALL_CRLF).filter(Boolean);
243
553
  var IgnoreRule = class {
244
554
  constructor(pattern, mark, body, ignoreCase, negative, prefix) {
@@ -249,6 +559,14 @@ var require_ignore = __commonJS({
249
559
  define(this, "ignoreCase", ignoreCase);
250
560
  define(this, "regexPrefix", prefix);
251
561
  }
562
+ // Worked out on first use and kept behind an own property, the way `regex`
563
+ // caches itself in `_regex`. Deciding it in the constructor instead would
564
+ // add a fourth `defineProperty` to every rule ever built, which cost 4% of
565
+ // every compile -- including the compiles of rules that are never matched
566
+ // against anything.
567
+ get _basenameOnly() {
568
+ return define(this, "_basenameOnly", matchesBasename(this.body));
569
+ }
252
570
  get regex() {
253
571
  const key = UNDERSCORE + MODE_IGNORE;
254
572
  if (this[key]) {
@@ -264,24 +582,51 @@ var require_ignore = __commonJS({
264
582
  return this._make(MODE_CHECK_IGNORE, key);
265
583
  }
266
584
  _make(mode, key) {
267
- const str = this.regexPrefix.replace(
268
- REGEX_REPLACE_TRAILING_WILDCARD,
269
- // It does not need to bind pattern
270
- TRAILING_WILD_CARD_REPLACERS[mode]
585
+ const str = pinWildcards(
586
+ mode === MODE_IGNORE ? this.regexPrefix.replace(REGEX_REPLACE_TRAILING_WILDCARD, replaceTrailingWildcard).replace(REGEX_REPLACE_TRAILING_DOUBLESTAR, replaceTrailingDoublestar) : checkSourceOf(this.body, this.regexPrefix)
271
587
  );
272
588
  const regex = this.ignoreCase ? new RegExp(str, "i") : new RegExp(str);
273
589
  return define(this, key, regex);
274
590
  }
275
591
  };
592
+ var isLineEnd = (char) => char === "\r" || char === "\n";
593
+ var trimEnd = (body) => {
594
+ let end = body.length;
595
+ while (end && isLineEnd(body[end - 1])) {
596
+ end--;
597
+ }
598
+ const lineEnd = end;
599
+ while (end && body[end - 1] === SPACE) {
600
+ end--;
601
+ }
602
+ if (end === lineEnd) {
603
+ return body.slice(0, end);
604
+ }
605
+ let backslashes = 0;
606
+ while (backslashes < end && body[end - backslashes - 1] === ESCAPE) {
607
+ backslashes++;
608
+ }
609
+ return backslashes % 2 ? body.slice(0, end - 1) + SPACE : body.slice(0, end);
610
+ };
276
611
  var createRule = ({
277
612
  pattern,
278
613
  mark
279
614
  }, ignoreCase) => {
615
+ let body = pattern[0] === BOM ? pattern.slice(1) : pattern;
616
+ if (body[0] === "#") {
617
+ return;
618
+ }
280
619
  let negative = false;
281
- let body = pattern;
282
- if (body.indexOf("!") === 0) {
620
+ if (body[0] === "!") {
283
621
  negative = true;
284
- body = body.substr(1);
622
+ body = body.slice(1);
623
+ }
624
+ const last = body[body.length - 1];
625
+ if (last === SPACE || last === "\r" || last === "\n") {
626
+ body = trimEnd(body);
627
+ }
628
+ if (!body) {
629
+ return;
285
630
  }
286
631
  body = body.replace(REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION, "!").replace(REGEX_REPLACE_LEADING_EXCAPED_HASH, "#");
287
632
  const regexPrefix = makeRegexPrefix(body);
@@ -298,10 +643,12 @@ var require_ignore = __commonJS({
298
643
  constructor(ignoreCase) {
299
644
  this._ignoreCase = ignoreCase;
300
645
  this._rules = [];
646
+ this._basenameCount = 0;
301
647
  }
302
648
  _add(pattern) {
303
649
  if (pattern && pattern[KEY_IGNORE]) {
304
650
  this._rules = this._rules.concat(pattern._rules._rules);
651
+ this._basenameCount += pattern._rules._basenameCount;
305
652
  this._added = true;
306
653
  return;
307
654
  }
@@ -310,10 +657,13 @@ var require_ignore = __commonJS({
310
657
  pattern
311
658
  };
312
659
  }
313
- if (checkPattern(pattern.pattern)) {
314
- const rule = createRule(pattern, this._ignoreCase);
660
+ const rule = checkPattern(pattern.pattern) && createRule(pattern, this._ignoreCase);
661
+ if (rule) {
315
662
  this._added = true;
316
663
  this._rules.push(rule);
664
+ if (matchesBasename(rule.body)) {
665
+ this._basenameCount++;
666
+ }
317
667
  }
318
668
  }
319
669
  // @param {Array<string> | string | Ignore} pattern
@@ -322,8 +672,39 @@ var require_ignore = __commonJS({
322
672
  makeArray(
323
673
  isString2(pattern) ? splitPattern(pattern) : pattern
324
674
  ).forEach(this._add, this);
675
+ if (this._added) {
676
+ this._literalRules = UNDEFINED;
677
+ }
325
678
  return this._added;
326
679
  }
680
+ // Match the literal 'abc/' for `checkIgnore`, last rule wins. Only a rule
681
+ // ending in a wildcard can match it (see `checkSourceOf`), so the rest
682
+ // are left out once, rather than tested or compiled for every path.
683
+ testLiteral(path) {
684
+ const rules = this._literalRules || (this._literalRules = this._rules.filter(
685
+ ({ body }) => body[body.length - (body[body.length - 1] === SLASH ? 2 : 1)] === "*"
686
+ ));
687
+ let ignored = false;
688
+ let unignored = false;
689
+ let matchedRule;
690
+ for (let index = rules.length - 1; index >= 0; index--) {
691
+ const rule = rules[index];
692
+ if (rule.checkRegex.test(path)) {
693
+ ignored = !rule.negative;
694
+ unignored = rule.negative;
695
+ matchedRule = rule.negative ? UNDEFINED : rule;
696
+ break;
697
+ }
698
+ }
699
+ const ret = {
700
+ ignored,
701
+ unignored
702
+ };
703
+ if (matchedRule) {
704
+ ret.rule = matchedRule;
705
+ }
706
+ return ret;
707
+ }
327
708
  // Test one single path without recursively checking parent directories
328
709
  //
329
710
  // - checkUnignored `boolean` whether should check if the path is unignored,
@@ -335,19 +716,22 @@ var require_ignore = __commonJS({
335
716
  let ignored = false;
336
717
  let unignored = false;
337
718
  let matchedRule;
338
- this._rules.forEach((rule) => {
719
+ const rules = this._rules;
720
+ const { length } = rules;
721
+ const shortcut = this._basenameCount * 2 >= length;
722
+ const basename = shortcut ? basenameOf(path) : path;
723
+ for (let index = 0; index < length; index++) {
724
+ const rule = rules[index];
339
725
  const { negative } = rule;
340
- if (unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored) {
341
- return;
342
- }
343
- const matched = rule[mode].test(path);
344
- if (!matched) {
345
- return;
726
+ const skip = unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored;
727
+ if (!skip && rule[mode].test(
728
+ shortcut && rule._basenameOnly ? basename : path
729
+ )) {
730
+ ignored = !negative;
731
+ unignored = negative;
732
+ matchedRule = negative ? UNDEFINED : rule;
346
733
  }
347
- ignored = !negative;
348
- unignored = negative;
349
- matchedRule = negative ? UNDEFINED : rule;
350
- });
734
+ }
351
735
  const ret = {
352
736
  ignored,
353
737
  unignored
@@ -380,7 +764,26 @@ var require_ignore = __commonJS({
380
764
  }
381
765
  return true;
382
766
  };
383
- var isNotRelative = (path) => REGEX_TEST_INVALID_PATH.test(path);
767
+ var isNotRelative = (path) => {
768
+ const first = path.charCodeAt(0);
769
+ if (first === SLASH_CODE) {
770
+ return true;
771
+ }
772
+ if (first !== DOT_CODE) {
773
+ return false;
774
+ }
775
+ if (path.length === 1) {
776
+ return true;
777
+ }
778
+ const second = path.charCodeAt(1);
779
+ if (second === SLASH_CODE) {
780
+ return true;
781
+ }
782
+ if (second !== DOT_CODE) {
783
+ return false;
784
+ }
785
+ return path.length === 2 || path.charCodeAt(2) === SLASH_CODE;
786
+ };
384
787
  checkPath.isNotRelative = isNotRelative;
385
788
  checkPath.convert = (p) => p;
386
789
  var Ignore = class {
@@ -409,52 +812,33 @@ var require_ignore = __commonJS({
409
812
  return this.add(pattern);
410
813
  }
411
814
  // @returns {TestResult}
412
- _test(originalPath, cache, checkUnignored, slices) {
815
+ _test(originalPath, cache, checkUnignored) {
413
816
  const path = originalPath && checkPath.convert(originalPath);
414
817
  checkPath(
415
818
  path,
416
819
  originalPath,
417
820
  this._strictPathCheck ? throwError : RETURN_FALSE
418
821
  );
419
- return this._t(path, cache, checkUnignored, slices);
822
+ return this._t(path, cache, checkUnignored);
420
823
  }
421
824
  checkIgnore(path) {
422
- if (!REGEX_TEST_TRAILING_SLASH.test(path)) {
825
+ if (path.charCodeAt(path.length - 1) !== SLASH_CODE) {
423
826
  return this.test(path);
424
827
  }
425
- const slices = path.split(SLASH).filter(Boolean);
426
- slices.pop();
427
- if (slices.length) {
428
- const parent = this._t(
429
- slices.join(SLASH) + SLASH,
430
- this._testCache,
431
- true,
432
- slices
433
- );
434
- if (parent.ignored) {
435
- return parent;
436
- }
828
+ const dir = this._t(path, this._testCache, true);
829
+ if (dir.ignored) {
830
+ return dir;
437
831
  }
438
- return this._rules.test(path, false, MODE_CHECK_IGNORE);
832
+ const literal3 = this._rules.testLiteral(path);
833
+ return literal3.ignored || literal3.unignored ? literal3 : dir;
439
834
  }
440
- _t(path, cache, checkUnignored, slices) {
835
+ _t(path, cache, checkUnignored) {
441
836
  if (path in cache) {
442
837
  return cache[path];
443
838
  }
444
- if (!slices) {
445
- slices = path.split(SLASH).filter(Boolean);
446
- }
447
- slices.pop();
448
- if (!slices.length) {
449
- return cache[path] = this._rules.test(path, checkUnignored, MODE_IGNORE);
450
- }
451
- const parent = this._t(
452
- slices.join(SLASH) + SLASH,
453
- cache,
454
- checkUnignored,
455
- slices
456
- );
457
- return cache[path] = parent.ignored ? parent : this._rules.test(path, checkUnignored, MODE_IGNORE);
839
+ const parentPath = parentOf(path);
840
+ const parent = parentPath ? this._t(parentPath, cache, checkUnignored) : UNDEFINED;
841
+ return cache[path] = parent && parent.ignored ? parent : this._rules.test(path, checkUnignored, MODE_IGNORE);
458
842
  }
459
843
  ignores(path) {
460
844
  return this._test(path, this._ignoreCache, false).ignored;
@@ -48492,21 +48876,9 @@ function _addIssue(context, label, dataset, config$1, other) {
48492
48876
  if (dataset.issues) dataset.issues.push(issue);
48493
48877
  else dataset.issues = [issue];
48494
48878
  }
48495
- var _standardCache = /* @__PURE__ */ new WeakMap();
48496
48879
  // @__NO_SIDE_EFFECTS__
48497
- function _getStandardProps(context) {
48498
- let cached = _standardCache.get(context);
48499
- if (!cached) {
48500
- cached = {
48501
- version: 1,
48502
- vendor: "valibot",
48503
- validate(value$1) {
48504
- return context["~run"]({ value: value$1 }, /* @__PURE__ */ getGlobalConfig());
48505
- }
48506
- };
48507
- _standardCache.set(context, cached);
48508
- }
48509
- return cached;
48880
+ function _isSameValueZero(value1, value2) {
48881
+ return value1 === value2 || Number.isNaN(value1) && Number.isNaN(value2);
48510
48882
  }
48511
48883
  // @__NO_SIDE_EFFECTS__
48512
48884
  function _isValidObjectKey(object$1, key) {
@@ -48518,6 +48890,14 @@ function _joinExpects(values$1, separator) {
48518
48890
  if (list.length > 1) return `(${list.join(` ${separator} `)})`;
48519
48891
  return list[0] ?? "never";
48520
48892
  }
48893
+ function _standardSchema(schema) {
48894
+ schema["~standard"] = {
48895
+ version: 1,
48896
+ vendor: "valibot",
48897
+ validate: (value$1) => schema["~run"]({ value: value$1 }, /* @__PURE__ */ getGlobalConfig())
48898
+ };
48899
+ return schema;
48900
+ }
48521
48901
  var ValiError = class extends Error {
48522
48902
  /**
48523
48903
  * Creates a Valibot error with useful information.
@@ -48717,7 +49097,7 @@ function getDefault(schema, dataset, config$1) {
48717
49097
  }
48718
49098
  // @__NO_SIDE_EFFECTS__
48719
49099
  function array(item, message$1) {
48720
- return {
49100
+ return _standardSchema({
48721
49101
  kind: "schema",
48722
49102
  type: "array",
48723
49103
  reference: array,
@@ -48725,9 +49105,6 @@ function array(item, message$1) {
48725
49105
  async: false,
48726
49106
  item,
48727
49107
  message: message$1,
48728
- get "~standard"() {
48729
- return /* @__PURE__ */ _getStandardProps(this);
48730
- },
48731
49108
  "~run"(dataset, config$1) {
48732
49109
  const input = dataset.value;
48733
49110
  if (Array.isArray(input)) {
@@ -48761,30 +49138,27 @@ function array(item, message$1) {
48761
49138
  } else _addIssue(this, "type", dataset, config$1);
48762
49139
  return dataset;
48763
49140
  }
48764
- };
49141
+ });
48765
49142
  }
48766
49143
  // @__NO_SIDE_EFFECTS__
48767
49144
  function boolean2(message$1) {
48768
- return {
49145
+ return _standardSchema({
48769
49146
  kind: "schema",
48770
49147
  type: "boolean",
48771
49148
  reference: boolean2,
48772
49149
  expects: "boolean",
48773
49150
  async: false,
48774
49151
  message: message$1,
48775
- get "~standard"() {
48776
- return /* @__PURE__ */ _getStandardProps(this);
48777
- },
48778
49152
  "~run"(dataset, config$1) {
48779
49153
  if (typeof dataset.value === "boolean") dataset.typed = true;
48780
49154
  else _addIssue(this, "type", dataset, config$1);
48781
49155
  return dataset;
48782
49156
  }
48783
- };
49157
+ });
48784
49158
  }
48785
49159
  // @__NO_SIDE_EFFECTS__
48786
49160
  function custom(check$1, message$1) {
48787
- return {
49161
+ return _standardSchema({
48788
49162
  kind: "schema",
48789
49163
  type: "custom",
48790
49164
  reference: custom,
@@ -48792,19 +49166,16 @@ function custom(check$1, message$1) {
48792
49166
  async: false,
48793
49167
  check: check$1,
48794
49168
  message: message$1,
48795
- get "~standard"() {
48796
- return /* @__PURE__ */ _getStandardProps(this);
48797
- },
48798
49169
  "~run"(dataset, config$1) {
48799
49170
  if (this.check(dataset.value)) dataset.typed = true;
48800
49171
  else _addIssue(this, "type", dataset, config$1);
48801
49172
  return dataset;
48802
49173
  }
48803
- };
49174
+ });
48804
49175
  }
48805
49176
  // @__NO_SIDE_EFFECTS__
48806
49177
  function exactOptional(wrapped, default_) {
48807
- return {
49178
+ return _standardSchema({
48808
49179
  kind: "schema",
48809
49180
  type: "exact_optional",
48810
49181
  reference: exactOptional,
@@ -48812,34 +49183,28 @@ function exactOptional(wrapped, default_) {
48812
49183
  async: false,
48813
49184
  wrapped,
48814
49185
  default: default_,
48815
- get "~standard"() {
48816
- return /* @__PURE__ */ _getStandardProps(this);
48817
- },
48818
49186
  "~run"(dataset, config$1) {
48819
49187
  return this.wrapped["~run"](dataset, config$1);
48820
49188
  }
48821
- };
49189
+ });
48822
49190
  }
48823
49191
  // @__NO_SIDE_EFFECTS__
48824
49192
  function lazy(getter) {
48825
- return {
49193
+ return _standardSchema({
48826
49194
  kind: "schema",
48827
49195
  type: "lazy",
48828
49196
  reference: lazy,
48829
49197
  expects: "unknown",
48830
49198
  async: false,
48831
49199
  getter,
48832
- get "~standard"() {
48833
- return /* @__PURE__ */ _getStandardProps(this);
48834
- },
48835
49200
  "~run"(dataset, config$1) {
48836
49201
  return this.getter(dataset.value)["~run"](dataset, config$1);
48837
49202
  }
48838
- };
49203
+ });
48839
49204
  }
48840
49205
  // @__NO_SIDE_EFFECTS__
48841
49206
  function literal2(literal_, message$1) {
48842
- return {
49207
+ return _standardSchema({
48843
49208
  kind: "schema",
48844
49209
  type: "literal",
48845
49210
  reference: literal2,
@@ -48847,37 +49212,31 @@ function literal2(literal_, message$1) {
48847
49212
  async: false,
48848
49213
  literal: literal_,
48849
49214
  message: message$1,
48850
- get "~standard"() {
48851
- return /* @__PURE__ */ _getStandardProps(this);
48852
- },
48853
49215
  "~run"(dataset, config$1) {
48854
- if (dataset.value === this.literal) dataset.typed = true;
49216
+ if (/* @__PURE__ */ _isSameValueZero(dataset.value, this.literal)) dataset.typed = true;
48855
49217
  else _addIssue(this, "type", dataset, config$1);
48856
49218
  return dataset;
48857
49219
  }
48858
- };
49220
+ });
48859
49221
  }
48860
49222
  // @__NO_SIDE_EFFECTS__
48861
49223
  function never(message$1) {
48862
- return {
49224
+ return _standardSchema({
48863
49225
  kind: "schema",
48864
49226
  type: "never",
48865
49227
  reference: never,
48866
49228
  expects: "never",
48867
49229
  async: false,
48868
49230
  message: message$1,
48869
- get "~standard"() {
48870
- return /* @__PURE__ */ _getStandardProps(this);
48871
- },
48872
49231
  "~run"(dataset, config$1) {
48873
49232
  _addIssue(this, "type", dataset, config$1);
48874
49233
  return dataset;
48875
49234
  }
48876
- };
49235
+ });
48877
49236
  }
48878
49237
  // @__NO_SIDE_EFFECTS__
48879
49238
  function nullable(wrapped, default_) {
48880
- return {
49239
+ return _standardSchema({
48881
49240
  kind: "schema",
48882
49241
  type: "nullable",
48883
49242
  reference: nullable,
@@ -48885,9 +49244,6 @@ function nullable(wrapped, default_) {
48885
49244
  async: false,
48886
49245
  wrapped,
48887
49246
  default: default_,
48888
- get "~standard"() {
48889
- return /* @__PURE__ */ _getStandardProps(this);
48890
- },
48891
49247
  "~run"(dataset, config$1) {
48892
49248
  if (dataset.value === null) {
48893
49249
  if (this.default !== void 0) dataset.value = /* @__PURE__ */ getDefault(this, dataset, config$1);
@@ -48898,30 +49254,27 @@ function nullable(wrapped, default_) {
48898
49254
  }
48899
49255
  return this.wrapped["~run"](dataset, config$1);
48900
49256
  }
48901
- };
49257
+ });
48902
49258
  }
48903
49259
  // @__NO_SIDE_EFFECTS__
48904
49260
  function number(message$1) {
48905
- return {
49261
+ return _standardSchema({
48906
49262
  kind: "schema",
48907
49263
  type: "number",
48908
49264
  reference: number,
48909
49265
  expects: "number",
48910
49266
  async: false,
48911
49267
  message: message$1,
48912
- get "~standard"() {
48913
- return /* @__PURE__ */ _getStandardProps(this);
48914
- },
48915
49268
  "~run"(dataset, config$1) {
48916
49269
  if (typeof dataset.value === "number" && !isNaN(dataset.value)) dataset.typed = true;
48917
49270
  else _addIssue(this, "type", dataset, config$1);
48918
49271
  return dataset;
48919
49272
  }
48920
- };
49273
+ });
48921
49274
  }
48922
49275
  // @__NO_SIDE_EFFECTS__
48923
49276
  function optional(wrapped, default_) {
48924
- return {
49277
+ return _standardSchema({
48925
49278
  kind: "schema",
48926
49279
  type: "optional",
48927
49280
  reference: optional,
@@ -48929,9 +49282,6 @@ function optional(wrapped, default_) {
48929
49282
  async: false,
48930
49283
  wrapped,
48931
49284
  default: default_,
48932
- get "~standard"() {
48933
- return /* @__PURE__ */ _getStandardProps(this);
48934
- },
48935
49285
  "~run"(dataset, config$1) {
48936
49286
  if (dataset.value === void 0) {
48937
49287
  if (this.default !== void 0) dataset.value = /* @__PURE__ */ getDefault(this, dataset, config$1);
@@ -48942,11 +49292,11 @@ function optional(wrapped, default_) {
48942
49292
  }
48943
49293
  return this.wrapped["~run"](dataset, config$1);
48944
49294
  }
48945
- };
49295
+ });
48946
49296
  }
48947
49297
  // @__NO_SIDE_EFFECTS__
48948
49298
  function picklist(options, message$1) {
48949
- return {
49299
+ return _standardSchema({
48950
49300
  kind: "schema",
48951
49301
  type: "picklist",
48952
49302
  reference: picklist,
@@ -48954,19 +49304,16 @@ function picklist(options, message$1) {
48954
49304
  async: false,
48955
49305
  options,
48956
49306
  message: message$1,
48957
- get "~standard"() {
48958
- return /* @__PURE__ */ _getStandardProps(this);
48959
- },
48960
49307
  "~run"(dataset, config$1) {
48961
49308
  if (this.options.includes(dataset.value)) dataset.typed = true;
48962
49309
  else _addIssue(this, "type", dataset, config$1);
48963
49310
  return dataset;
48964
49311
  }
48965
- };
49312
+ });
48966
49313
  }
48967
49314
  // @__NO_SIDE_EFFECTS__
48968
49315
  function record3(key, value$1, message$1) {
48969
- return {
49316
+ return _standardSchema({
48970
49317
  kind: "schema",
48971
49318
  type: "record",
48972
49319
  reference: record3,
@@ -48975,9 +49322,6 @@ function record3(key, value$1, message$1) {
48975
49322
  key,
48976
49323
  value: value$1,
48977
49324
  message: message$1,
48978
- get "~standard"() {
48979
- return /* @__PURE__ */ _getStandardProps(this);
48980
- },
48981
49325
  "~run"(dataset, config$1) {
48982
49326
  const input = dataset.value;
48983
49327
  if (input && typeof input === "object") {
@@ -49030,11 +49374,11 @@ function record3(key, value$1, message$1) {
49030
49374
  } else _addIssue(this, "type", dataset, config$1);
49031
49375
  return dataset;
49032
49376
  }
49033
- };
49377
+ });
49034
49378
  }
49035
49379
  // @__NO_SIDE_EFFECTS__
49036
49380
  function strictObject(entries$1, message$1) {
49037
- return {
49381
+ return _standardSchema({
49038
49382
  kind: "schema",
49039
49383
  type: "strict_object",
49040
49384
  reference: strictObject,
@@ -49042,9 +49386,6 @@ function strictObject(entries$1, message$1) {
49042
49386
  async: false,
49043
49387
  entries: entries$1,
49044
49388
  message: message$1,
49045
- get "~standard"() {
49046
- return /* @__PURE__ */ _getStandardProps(this);
49047
- },
49048
49389
  "~run"(dataset, config$1) {
49049
49390
  const input = dataset.value;
49050
49391
  if (input && typeof input === "object") {
@@ -49093,7 +49434,7 @@ function strictObject(entries$1, message$1) {
49093
49434
  }
49094
49435
  }
49095
49436
  if (!dataset.issues || !config$1.abortEarly) {
49096
- for (const key in input) if (!(key in this.entries)) {
49437
+ for (const key in input) if (!Object.prototype.hasOwnProperty.call(this.entries, key)) {
49097
49438
  _addIssue(this, "key", dataset, config$1, {
49098
49439
  input: key,
49099
49440
  expected: "never",
@@ -49111,26 +49452,23 @@ function strictObject(entries$1, message$1) {
49111
49452
  } else _addIssue(this, "type", dataset, config$1);
49112
49453
  return dataset;
49113
49454
  }
49114
- };
49455
+ });
49115
49456
  }
49116
49457
  // @__NO_SIDE_EFFECTS__
49117
49458
  function string2(message$1) {
49118
- return {
49459
+ return _standardSchema({
49119
49460
  kind: "schema",
49120
49461
  type: "string",
49121
49462
  reference: string2,
49122
49463
  expects: "string",
49123
49464
  async: false,
49124
49465
  message: message$1,
49125
- get "~standard"() {
49126
- return /* @__PURE__ */ _getStandardProps(this);
49127
- },
49128
49466
  "~run"(dataset, config$1) {
49129
49467
  if (typeof dataset.value === "string") dataset.typed = true;
49130
49468
  else _addIssue(this, "type", dataset, config$1);
49131
49469
  return dataset;
49132
49470
  }
49133
- };
49471
+ });
49134
49472
  }
49135
49473
  // @__NO_SIDE_EFFECTS__
49136
49474
  function _subIssues(datasets) {
@@ -49141,7 +49479,7 @@ function _subIssues(datasets) {
49141
49479
  }
49142
49480
  // @__NO_SIDE_EFFECTS__
49143
49481
  function union(options, message$1) {
49144
- return {
49482
+ return _standardSchema({
49145
49483
  kind: "schema",
49146
49484
  type: "union",
49147
49485
  reference: union,
@@ -49149,9 +49487,6 @@ function union(options, message$1) {
49149
49487
  async: false,
49150
49488
  options,
49151
49489
  message: message$1,
49152
- get "~standard"() {
49153
- return /* @__PURE__ */ _getStandardProps(this);
49154
- },
49155
49490
  "~run"(dataset, config$1) {
49156
49491
  let validDataset;
49157
49492
  let typedDatasets;
@@ -49176,11 +49511,11 @@ function union(options, message$1) {
49176
49511
  else _addIssue(this, "type", dataset, config$1, { issues: /* @__PURE__ */ _subIssues(untypedDatasets) });
49177
49512
  return dataset;
49178
49513
  }
49179
- };
49514
+ });
49180
49515
  }
49181
49516
  // @__NO_SIDE_EFFECTS__
49182
49517
  function variant(key, options, message$1) {
49183
- return {
49518
+ return _standardSchema({
49184
49519
  kind: "schema",
49185
49520
  type: "variant",
49186
49521
  reference: variant,
@@ -49189,9 +49524,6 @@ function variant(key, options, message$1) {
49189
49524
  key,
49190
49525
  options,
49191
49526
  message: message$1,
49192
- get "~standard"() {
49193
- return /* @__PURE__ */ _getStandardProps(this);
49194
- },
49195
49527
  "~run"(dataset, config$1) {
49196
49528
  const input = dataset.value;
49197
49529
  if (input && typeof input === "object") {
@@ -49246,7 +49578,7 @@ function variant(key, options, message$1) {
49246
49578
  } else _addIssue(this, "type", dataset, config$1);
49247
49579
  return dataset;
49248
49580
  }
49249
- };
49581
+ });
49250
49582
  }
49251
49583
  function parse2(schema, input, config$1) {
49252
49584
  const dataset = schema["~run"]({ value: input }, /* @__PURE__ */ getGlobalConfig(config$1));
@@ -49255,12 +49587,9 @@ function parse2(schema, input, config$1) {
49255
49587
  }
49256
49588
  // @__NO_SIDE_EFFECTS__
49257
49589
  function pipe(...pipe$1) {
49258
- return {
49590
+ return _standardSchema({
49259
49591
  ...pipe$1[0],
49260
49592
  pipe: pipe$1,
49261
- get "~standard"() {
49262
- return /* @__PURE__ */ _getStandardProps(this);
49263
- },
49264
49593
  "~run"(dataset, config$1) {
49265
49594
  for (const item of pipe$1) if (item.kind !== "metadata") {
49266
49595
  if (dataset.issues && (item.kind === "schema" || item.kind === "transformation")) {
@@ -49271,7 +49600,7 @@ function pipe(...pipe$1) {
49271
49600
  }
49272
49601
  return dataset;
49273
49602
  }
49274
- };
49603
+ });
49275
49604
  }
49276
49605
 
49277
49606
  // ../packages/manifest/src/schema-member.ts