Skip to content

fix issue with toNestErrors.ts#848

Merged
bluebill1049 merged 2 commits into
masterfrom
fix-toNestErrors
May 18, 2026
Merged

fix issue with toNestErrors.ts#848
bluebill1049 merged 2 commits into
masterfrom
fix-toNestErrors

Conversation

@bluebill1049
Copy link
Copy Markdown
Member

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes toNestErrors handling for field names that contain regex metacharacters by escaping normalized field names before building the field-array detection regex.

Changes:

  • Adds regex escaping after bracket normalization in toNestErrors.
  • Adds a regression test ensuring metacharacter-containing names do not throw SyntaxError.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/toNestErrors.ts Safely escapes field names before embedding them in the field-array regex.
src/__tests__/toNestErrors.ts Adds coverage for field names containing regex metacharacters.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 18, 2026

Size Change: +86 B (+0.14%)

Total Size: 61.2 kB

📦 View Changed
Filename Size Change
dist/resolvers.js 497 B +22 B (+4.63%) 🔍
dist/resolvers.mjs 506 B +21 B (+4.33%)
dist/resolvers.module.js 506 B +21 B (+4.33%)
dist/resolvers.umd.js 586 B +22 B (+3.9%)
ℹ️ View Unchanged
Filename Size
ajv/dist/ajv.js 709 B
ajv/dist/ajv.mjs 659 B
ajv/dist/ajv.modern.mjs 616 B
ajv/dist/ajv.module.js 659 B
ajv/dist/ajv.umd.js 824 B
arktype/dist/arktype.js 675 B
arktype/dist/arktype.mjs 687 B
arktype/dist/arktype.modern.mjs 628 B
arktype/dist/arktype.module.js 687 B
arktype/dist/arktype.umd.js 756 B
ata-validator/dist/ata-validator.js 533 B
ata-validator/dist/ata-validator.mjs 551 B
ata-validator/dist/ata-validator.modern.mjs 512 B
ata-validator/dist/ata-validator.module.js 551 B
ata-validator/dist/ata-validator.umd.js 645 B
class-validator/dist/class-validator.js 538 B
class-validator/dist/class-validator.mjs 559 B
class-validator/dist/class-validator.modern.mjs 511 B
class-validator/dist/class-validator.module.js 559 B
class-validator/dist/class-validator.umd.js 637 B
computed-types/dist/computed-types.js 385 B
computed-types/dist/computed-types.mjs 400 B
computed-types/dist/computed-types.modern.mjs 340 B
computed-types/dist/computed-types.module.js 400 B
computed-types/dist/computed-types.umd.js 476 B
effect-ts/dist/effect-ts.js 536 B
effect-ts/dist/effect-ts.mjs 554 B
effect-ts/dist/effect-ts.modern.mjs 537 B
effect-ts/dist/effect-ts.module.js 554 B
effect-ts/dist/effect-ts.umd.js 652 B
fluentvalidation-ts/dist/fluentvalidation-ts.js 487 B
fluentvalidation-ts/dist/fluentvalidation-ts.mjs 505 B
fluentvalidation-ts/dist/fluentvalidation-ts.modern.mjs 434 B
fluentvalidation-ts/dist/fluentvalidation-ts.module.js 505 B
fluentvalidation-ts/dist/fluentvalidation-ts.umd.js 575 B
io-ts/dist/io-ts.js 1.27 kB
io-ts/dist/io-ts.mjs 1.15 kB
io-ts/dist/io-ts.modern.mjs 1.12 kB
io-ts/dist/io-ts.module.js 1.15 kB
io-ts/dist/io-ts.umd.js 1.39 kB
joi/dist/joi.js 590 B
joi/dist/joi.mjs 606 B
joi/dist/joi.modern.mjs 490 B
joi/dist/joi.module.js 606 B
joi/dist/joi.umd.js 694 B
nope/dist/nope.js 346 B
nope/dist/nope.mjs 363 B
nope/dist/nope.modern.mjs 330 B
nope/dist/nope.module.js 363 B
nope/dist/nope.umd.js 432 B
standard-schema/dist/standard-schema.js 609 B
standard-schema/dist/standard-schema.mjs 627 B
standard-schema/dist/standard-schema.modern.mjs 570 B
standard-schema/dist/standard-schema.module.js 627 B
standard-schema/dist/standard-schema.umd.js 708 B
superstruct/dist/superstruct.js 339 B
superstruct/dist/superstruct.mjs 353 B
superstruct/dist/superstruct.modern.mjs 342 B
superstruct/dist/superstruct.module.js 353 B
superstruct/dist/superstruct.umd.js 437 B
typanion/dist/typanion.js 329 B
typanion/dist/typanion.mjs 345 B
typanion/dist/typanion.modern.mjs 325 B
typanion/dist/typanion.module.js 345 B
typanion/dist/typanion.umd.js 425 B
typebox/dist/typebox.js 501 B
typebox/dist/typebox.mjs 517 B
typebox/dist/typebox.modern.mjs 494 B
typebox/dist/typebox.module.js 517 B
typebox/dist/typebox.umd.js 618 B
typeschema/dist/typeschema.js 526 B
typeschema/dist/typeschema.mjs 542 B
typeschema/dist/typeschema.modern.mjs 492 B
typeschema/dist/typeschema.module.js 542 B
typeschema/dist/typeschema.umd.js 630 B
valibot/dist/valibot.js 477 B
valibot/dist/valibot.mjs 492 B
valibot/dist/valibot.modern.mjs 452 B
valibot/dist/valibot.module.js 492 B
valibot/dist/valibot.umd.js 586 B
vest/dist/vest.js 479 B
vest/dist/vest.mjs 443 B
vest/dist/vest.modern.mjs 390 B
vest/dist/vest.module.js 443 B
vest/dist/vest.umd.js 568 B
vine/dist/vine.js 543 B
vine/dist/vine.mjs 553 B
vine/dist/vine.modern.mjs 484 B
vine/dist/vine.module.js 553 B
vine/dist/vine.umd.js 650 B
yup/dist/yup.js 626 B
yup/dist/yup.mjs 639 B
yup/dist/yup.modern.mjs 579 B
yup/dist/yup.module.js 639 B
yup/dist/yup.umd.js 728 B
zod/dist/zod.js 1.16 kB
zod/dist/zod.mjs 1.04 kB
zod/dist/zod.modern.mjs 955 B
zod/dist/zod.module.js 1.04 kB
zod/dist/zod.umd.js 1.24 kB

compressed-size-action

@bluebill1049 bluebill1049 merged commit 5e5b610 into master May 18, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants