Skip to content

Improve perf by changing ~standard implementation#1534

Open
fabian-hiller wants to merge 2 commits into
mainfrom
standard-schema-perf
Open

Improve perf by changing ~standard implementation#1534
fabian-hiller wants to merge 2 commits into
mainfrom
standard-schema-perf

Conversation

@fabian-hiller

@fabian-hiller fabian-hiller commented Jul 8, 2026

Copy link
Copy Markdown
Member

Improve schema init performance: eager ~standard assignment

Replaces the lazy get '~standard'() accessor on every schema factory with eager assignment of the Standard Schema props as a plain data property (_addStandardProp), removing _getStandardProps and its _standardCache WeakMap.

Why: the getter made schema construction slow on every build — an accessor in an object literal disables V8's fast-literal path, and pipe()'s spread of pipe[0] invoked the getter (plus a WeakMap get/set) on each call, all to produce a value only read when someone actually uses Standard Schema. Allocating the props eagerly is cheaper than installing an accessor.

Changes:

  • New _addStandardProp util; _getStandardProps + WeakMap removed.
  • 71 schema factories wrap their literal in _addStandardProp(...).
  • 14 spread-based methods (pipe, omit, partial, fallback, …) re-wrap their result — required for correctness, since a spread copies the source's validate binding. Regression tests added (e.g. pipe(string(), maxLength(3))['~standard'].validate('too long') must fail).

Compat: no public API change; ~standard stays an own enumerable property (now writable data instead of a getter).

Results: ~3× faster construction locally (~6.8 → ~2.1 µs); bundle 85.32 → 82.80 kB. Lint + full suite (3065 tests) pass.

Summary by CodeRabbit

  • New Features

    • Standard schema validation is now consistently available across built-in schemas and schema modifiers.
    • Validation metadata is attached eagerly and remains stable when accessed repeatedly.
    • Standard validation works correctly with pipelines, transformations, partial schemas, omitted fields, and required fields.
  • Bug Fixes

    • Improved validation results and issue reporting for composed and transformed schemas.

Copilot AI review requested due to automatic review settings July 8, 2026 21:26
@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jul 8, 2026
@fabian-hiller fabian-hiller self-assigned this Jul 8, 2026
@dosubot dosubot Bot added enhancement New feature or request performance Its performance related labels Jul 8, 2026
@fabian-hiller fabian-hiller added performance Its performance related and removed performance Its performance related enhancement New feature or request labels Jul 8, 2026
@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

Introduces _standardSchema to eagerly attach ~standard metadata and validation, removes _getStandardProps, and migrates schema factories and schema-wrapping methods to the new helper. Adds tests covering standard validation, caching, destructured validators, transformed schemas, and nested issue paths.

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: improving performance by changing the ~standard implementation.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 8, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
valibot-website abca1c4 Commit Preview URL

Branch Preview URL
Jul 18 2026, 06:27 PM

@pkg-pr-new

pkg-pr-new Bot commented Jul 8, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/valibot@1534

commit: abca1c4

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7cd4bdbcd9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread library/src/utils/index.ts Outdated
@@ -1,10 +1,10 @@
export * from './_addIssue/index.ts';
export * from './_addStandardProp/index.ts';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep the documented Standard helper available

Replacing the _getStandardProps export breaks the documented advanced custom-schema flow: website/src/routes/guides/(advanced)/extend-valibot/index.mdx still tells users to call v._getStandardProps(this) and explicitly says _getStandardProps is exported for advanced use, while internal-architecture also shows the old getter pattern. After this export swap, anyone following those examples gets a missing export from valibot; either keep a compatibility export or update the docs/examples in the same change.

Useful? React with 👍 / 👎.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

1 issue found across 97 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="library/src/utils/index.ts">

<violation number="1" location="library/src/utils/index.ts:2">
P2: Removing the `_getStandardProps` export is a breaking change for users following the documented advanced custom-schema guides. The [Extend Valibot](https://valibot.dev/guides/extend-valibot/) guide explicitly tells users to call `v._getStandardProps(this)` in custom schema factories, and the [Internal Architecture](https://valibot.dev/guides/internal-architecture/) guide shows the same pattern. After this change, anyone following those examples will get a missing export error at runtime.

Consider either keeping a deprecated compatibility re-export (e.g., `export { _addStandardProp as _getStandardProps }` with adjusted semantics, or a thin wrapper) or updating the website documentation in the same PR so the guides stay consistent with the library's public surface.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread library/src/utils/index.ts Outdated
@@ -1,10 +1,10 @@
export * from './_addIssue/index.ts';
export * from './_addStandardProp/index.ts';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: Removing the _getStandardProps export is a breaking change for users following the documented advanced custom-schema guides. The Extend Valibot guide explicitly tells users to call v._getStandardProps(this) in custom schema factories, and the Internal Architecture guide shows the same pattern. After this change, anyone following those examples will get a missing export error at runtime.

Consider either keeping a deprecated compatibility re-export (e.g., export { _addStandardProp as _getStandardProps } with adjusted semantics, or a thin wrapper) or updating the website documentation in the same PR so the guides stay consistent with the library's public surface.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At library/src/utils/index.ts, line 2:

<comment>Removing the `_getStandardProps` export is a breaking change for users following the documented advanced custom-schema guides. The [Extend Valibot](https://valibot.dev/guides/extend-valibot/) guide explicitly tells users to call `v._getStandardProps(this)` in custom schema factories, and the [Internal Architecture](https://valibot.dev/guides/internal-architecture/) guide shows the same pattern. After this change, anyone following those examples will get a missing export error at runtime.

Consider either keeping a deprecated compatibility re-export (e.g., `export { _addStandardProp as _getStandardProps }` with adjusted semantics, or a thin wrapper) or updating the website documentation in the same PR so the guides stay consistent with the library's public surface.</comment>

<file context>
@@ -1,10 +1,10 @@
 export * from './_addIssue/index.ts';
+export * from './_addStandardProp/index.ts';
 export * from './_cloneDataset/index.ts';
 export * from './_formatCase/index.ts';
</file context>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 improves Valibot schema construction performance by replacing the lazy get '~standard'() accessor (and its _getStandardProps WeakMap cache) with an eager, plain data-property assignment via the new internal _addStandardProp utility. It updates schema factories and spread-based methods to ensure schema['~standard'].validate continues to validate against the newly created schema object after spreads/copies.

Changes:

  • Introduces library/src/utils/_addStandardProp and exports it from library/src/utils/index.ts.
  • Removes _getStandardProps (and the _standardCache WeakMap) and replaces lazy ~standard getters across schema factories with _addStandardProp(...).
  • Re-wraps spread-based method results (e.g. pipe, fallback, omit, partial, required, cache, config, message) and adds regression tests to ensure ~standard.validate targets the correct schema.

Reviewed changes

Copilot reviewed 97 out of 97 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
library/src/utils/index.ts Exports the new _addStandardProp utility and stops exporting _getStandardProps.
library/src/utils/_getStandardProps/index.ts Removed export barrel for _getStandardProps (deprecated path).
library/src/utils/_getStandardProps/_getStandardProps.ts Removes lazy ~standard props generator and WeakMap cache.
library/src/utils/_addStandardProp/index.ts Adds export barrel for _addStandardProp.
library/src/utils/_addStandardProp/_addStandardProp.ts New internal helper to eagerly attach ~standard as a data property.
library/src/utils/_addStandardProp/_addStandardProp.test.ts Updates runtime tests to validate eager ~standard behavior and repeated access identity.
library/src/utils/_addStandardProp/_addStandardProp.test-d.ts Updates type tests to validate ~standard inference through pipe(...).
library/src/schemas/any/any.ts Wraps schema literal in _addStandardProp(...) instead of a ~standard getter.
library/src/schemas/unknown/unknown.ts Wraps schema literal in _addStandardProp(...) instead of a ~standard getter.
library/src/schemas/void/void.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/schemas/undefined/undefined.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/schemas/null/null.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/schemas/boolean/boolean.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/schemas/bigint/bigint.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/schemas/blob/blob.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/schemas/date/date.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/schemas/file/file.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/schemas/function/function.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/schemas/instance/instance.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/schemas/lazy/lazy.ts Wraps schema literal in _addStandardProp(...) (removes ~standard getter).
library/src/schemas/lazy/lazyAsync.ts Wraps schema literal in _addStandardProp(...) (removes ~standard getter).
library/src/schemas/literal/literal.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/schemas/nan/nan.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/schemas/number/number.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/schemas/picklist/picklist.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/schemas/promise/promise.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/schemas/string/string.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/schemas/symbol/symbol.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/schemas/enum/enum.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/schemas/array/array.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/schemas/array/arrayAsync.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/schemas/custom/custom.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/schemas/custom/customAsync.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/schemas/exactOptional/exactOptional.ts Wraps schema literal in _addStandardProp(...) (removes ~standard getter).
library/src/schemas/exactOptional/exactOptionalAsync.ts Wraps schema literal in _addStandardProp(...) (removes ~standard getter).
library/src/schemas/intersect/intersect.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/schemas/intersect/intersectAsync.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/schemas/looseObject/looseObject.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/schemas/looseObject/looseObjectAsync.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/schemas/looseTuple/looseTuple.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/schemas/looseTuple/looseTupleAsync.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/schemas/map/map.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/schemas/map/mapAsync.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/schemas/nonNullable/nonNullable.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/schemas/nonNullable/nonNullableAsync.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/schemas/nonNullish/nonNullish.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/schemas/nonNullish/nonNullishAsync.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/schemas/nonOptional/nonOptional.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/schemas/nonOptional/nonOptionalAsync.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/schemas/nullable/nullable.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/schemas/nullable/nullableAsync.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/schemas/nullish/nullish.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/schemas/nullish/nullishAsync.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/schemas/object/object.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/schemas/object/objectAsync.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/schemas/objectWithRest/objectWithRest.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/schemas/objectWithRest/objectWithRestAsync.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/schemas/optional/optional.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/schemas/optional/optionalAsync.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/schemas/record/record.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/schemas/record/recordAsync.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/schemas/set/set.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/schemas/set/setAsync.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/schemas/strictObject/strictObject.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/schemas/strictObject/strictObjectAsync.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/schemas/strictTuple/strictTuple.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/schemas/strictTuple/strictTupleAsync.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/schemas/tuple/tuple.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/schemas/tuple/tupleAsync.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/schemas/tupleWithRest/tupleWithRest.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/schemas/tupleWithRest/tupleWithRestAsync.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/schemas/undefinedable/undefinedable.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/schemas/undefinedable/undefinedableAsync.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/schemas/union/union.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/schemas/union/unionAsync.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/schemas/variant/variant.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/schemas/variant/variantAsync.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/schemas/never/never.ts Wraps schema literal in _addStandardProp(...) and updates ~run typing.
library/src/methods/cache/cache.ts Re-wraps spread result with _addStandardProp(...) to refresh ~standard.validate binding.
library/src/methods/cache/cacheAsync.ts Re-wraps spread result with _addStandardProp(...) to refresh ~standard.validate binding.
library/src/methods/config/config.ts Re-wraps spread result with _addStandardProp(...) to refresh ~standard.validate binding.
library/src/methods/message/message.ts Re-wraps spread result with _addStandardProp(...) to refresh ~standard.validate binding.
library/src/methods/fallback/fallback.ts Re-wraps spread result with _addStandardProp(...) to refresh ~standard.validate binding.
library/src/methods/fallback/fallbackAsync.ts Re-wraps spread result with _addStandardProp(...) to refresh ~standard.validate binding.
library/src/methods/omit/omit.ts Re-wraps spread result with _addStandardProp(...) to refresh ~standard.validate binding.
library/src/methods/omit/omit.test.ts Adds regression test ensuring ~standard.validate reflects omitted entries.
library/src/methods/partial/partial.ts Re-wraps spread result with _addStandardProp(...) to refresh ~standard.validate binding.
library/src/methods/partial/partialAsync.ts Re-wraps spread result with _addStandardProp(...) to refresh ~standard.validate binding.
library/src/methods/partial/partial.test.ts Adds regression test ensuring ~standard.validate reflects partial entries.
library/src/methods/pick/pick.ts Re-wraps spread result with _addStandardProp(...) to refresh ~standard.validate binding.
library/src/methods/pipe/pipe.ts Re-wraps piped schema with _addStandardProp(...) and adds ~standard regression tests.
library/src/methods/pipe/pipe.test.ts Adds regression tests for ~standard.validate correctness and destructuring safety.
library/src/methods/pipe/pipeAsync.ts Re-wraps piped async schema with _addStandardProp(...) and adds ~standard regression tests.
library/src/methods/pipe/pipeAsync.test.ts Adds regression tests for async ~standard.validate correctness.
library/src/methods/required/required.ts Re-wraps spread result with _addStandardProp(...) to refresh ~standard.validate binding.
library/src/methods/required/requiredAsync.ts Re-wraps spread result with _addStandardProp(...) to refresh ~standard.validate binding.
library/src/methods/required/required.test.ts Adds regression test ensuring ~standard.validate reflects required entries.

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

});
});

test('should validate against the partialed entries via "~standard"', () => {
Comment on lines +3121 to +3124
} as unknown as Omit<
SchemaWithPipeAsync<readonly [TSchema, ...TItems]>,
'~standard'
>);
Comment on lines +112 to +115
} as unknown as Omit<
SchemaWithFallbackAsync<TSchema, TFallback>,
'~standard'
>);
@fabian-hiller
fabian-hiller requested a review from yslpn July 18, 2026 18:19
@fabian-hiller fabian-hiller added this to the v1.5 milestone Jul 18, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
library/src/methods/message/message.ts (1)

24-29: 🎯 Functional Correctness | 🔴 Critical | 🏗️ Heavy lift

Preserve the this context when delegating to the underlying schema's ~run method.

Currently, message() overrides the ~run method by calling schema['~run'](...). This drops the this context and hard-binds execution to the original schema object.

If a user applies a structural modifier (like required(), partial(), pick(), or omit()) after message(), the modifier creates a new schema with updated properties (e.g., modified entries). However, during validation, the wrapper's ~run executes the original schema's ~run bound to the original object. This causes the underlying schema to access the original entries and completely ignore the structural modifications, leading to silent validation bypasses.

To fix this, delegate the call using .call(this, ...) so that schemas like object or array correctly access the modified properties (like this.entries or this.item) from the outer schema instance. (Note: Consider reviewing other wrappers like fallback or config to ensure they also preserve the this context if they share this pattern).

🐛 Proposed fix
-    '~run'(dataset, config) {
-      return schema['~run'](dataset, { ...config, message: message_ });
+    '~run'(this: any, dataset, config) {
+      return schema['~run'].call(this, dataset, { ...config, message: message_ });
     },
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@library/src/methods/message/message.ts` around lines 24 - 29, Update the
`~run` override inside `message()` to invoke the underlying `schema['~run']`
with `this` bound to the outer schema instance, while preserving the merged
message configuration. This ensures structural modifiers applied after
`message()` use updated properties such as entries or item.
🧹 Nitpick comments (1)
library/src/methods/omit/omit.ts (1)

482-487: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Fix typographical error.

Correct Rerturn to Return.

💡 Proposed fix
-  // Rerturn modified copy of schema
+  // Return modified copy of schema
   // `@ts-expect-error`
   return _standardSchema<SchemaWithOmit<TSchema, TKeys>>({
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@library/src/methods/omit/omit.ts` around lines 482 - 487, Correct the typo in
the comment immediately above the _standardSchema call, changing “Rerturn” to
“Return” without modifying the surrounding implementation.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@library/src/methods/message/message.ts`:
- Around line 24-29: Update the `~run` override inside `message()` to invoke the
underlying `schema['~run']` with `this` bound to the outer schema instance,
while preserving the merged message configuration. This ensures structural
modifiers applied after `message()` use updated properties such as entries or
item.

---

Nitpick comments:
In `@library/src/methods/omit/omit.ts`:
- Around line 482-487: Correct the typo in the comment immediately above the
_standardSchema call, changing “Rerturn” to “Return” without modifying the
surrounding implementation.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 35d3610d-4e27-467a-bd42-ecf4de74b386

📥 Commits

Reviewing files that changed from the base of the PR and between 7cd4bdb and abca1c4.

📒 Files selected for processing (90)
  • library/src/methods/cache/cache.ts
  • library/src/methods/cache/cacheAsync.ts
  • library/src/methods/config/config.ts
  • library/src/methods/fallback/fallback.ts
  • library/src/methods/fallback/fallbackAsync.ts
  • library/src/methods/message/message.ts
  • library/src/methods/omit/omit.ts
  • library/src/methods/partial/partial.ts
  • library/src/methods/partial/partialAsync.ts
  • library/src/methods/pick/pick.ts
  • library/src/methods/pipe/pipe.ts
  • library/src/methods/pipe/pipeAsync.ts
  • library/src/methods/required/required.ts
  • library/src/methods/required/requiredAsync.ts
  • library/src/schemas/any/any.ts
  • library/src/schemas/array/array.ts
  • library/src/schemas/array/arrayAsync.ts
  • library/src/schemas/bigint/bigint.ts
  • library/src/schemas/blob/blob.ts
  • library/src/schemas/boolean/boolean.ts
  • library/src/schemas/custom/custom.ts
  • library/src/schemas/custom/customAsync.ts
  • library/src/schemas/date/date.ts
  • library/src/schemas/enum/enum.ts
  • library/src/schemas/exactOptional/exactOptional.ts
  • library/src/schemas/exactOptional/exactOptionalAsync.ts
  • library/src/schemas/file/file.ts
  • library/src/schemas/function/function.ts
  • library/src/schemas/instance/instance.ts
  • library/src/schemas/intersect/intersect.ts
  • library/src/schemas/intersect/intersectAsync.ts
  • library/src/schemas/lazy/lazy.ts
  • library/src/schemas/lazy/lazyAsync.ts
  • library/src/schemas/literal/literal.ts
  • library/src/schemas/looseObject/looseObject.ts
  • library/src/schemas/looseObject/looseObjectAsync.ts
  • library/src/schemas/looseTuple/looseTuple.ts
  • library/src/schemas/looseTuple/looseTupleAsync.ts
  • library/src/schemas/map/map.ts
  • library/src/schemas/map/mapAsync.ts
  • library/src/schemas/nan/nan.ts
  • library/src/schemas/never/never.ts
  • library/src/schemas/nonNullable/nonNullable.ts
  • library/src/schemas/nonNullable/nonNullableAsync.ts
  • library/src/schemas/nonNullish/nonNullish.ts
  • library/src/schemas/nonNullish/nonNullishAsync.ts
  • library/src/schemas/nonOptional/nonOptional.ts
  • library/src/schemas/nonOptional/nonOptionalAsync.ts
  • library/src/schemas/null/null.ts
  • library/src/schemas/nullable/nullable.ts
  • library/src/schemas/nullable/nullableAsync.ts
  • library/src/schemas/nullish/nullish.ts
  • library/src/schemas/nullish/nullishAsync.ts
  • library/src/schemas/number/number.ts
  • library/src/schemas/object/object.ts
  • library/src/schemas/object/objectAsync.ts
  • library/src/schemas/objectWithRest/objectWithRest.ts
  • library/src/schemas/objectWithRest/objectWithRestAsync.ts
  • library/src/schemas/optional/optional.ts
  • library/src/schemas/optional/optionalAsync.ts
  • library/src/schemas/picklist/picklist.ts
  • library/src/schemas/promise/promise.ts
  • library/src/schemas/record/record.ts
  • library/src/schemas/record/recordAsync.ts
  • library/src/schemas/set/set.ts
  • library/src/schemas/set/setAsync.ts
  • library/src/schemas/strictObject/strictObject.ts
  • library/src/schemas/strictObject/strictObjectAsync.ts
  • library/src/schemas/strictTuple/strictTuple.ts
  • library/src/schemas/strictTuple/strictTupleAsync.ts
  • library/src/schemas/string/string.ts
  • library/src/schemas/symbol/symbol.ts
  • library/src/schemas/tuple/tuple.ts
  • library/src/schemas/tuple/tupleAsync.ts
  • library/src/schemas/tupleWithRest/tupleWithRest.ts
  • library/src/schemas/tupleWithRest/tupleWithRestAsync.ts
  • library/src/schemas/undefined/undefined.ts
  • library/src/schemas/undefinedable/undefinedable.ts
  • library/src/schemas/undefinedable/undefinedableAsync.ts
  • library/src/schemas/union/union.ts
  • library/src/schemas/union/unionAsync.ts
  • library/src/schemas/unknown/unknown.ts
  • library/src/schemas/variant/variant.ts
  • library/src/schemas/variant/variantAsync.ts
  • library/src/schemas/void/void.ts
  • library/src/utils/_standardSchema/_standardSchema.test-d.ts
  • library/src/utils/_standardSchema/_standardSchema.test.ts
  • library/src/utils/_standardSchema/_standardSchema.ts
  • library/src/utils/_standardSchema/index.ts
  • library/src/utils/index.ts
🚧 Files skipped from review as they are similar to previous changes (17)
  • library/src/methods/config/config.ts
  • library/src/schemas/date/date.ts
  • library/src/schemas/nullable/nullable.ts
  • library/src/methods/fallback/fallbackAsync.ts
  • library/src/schemas/optional/optionalAsync.ts
  • library/src/schemas/bigint/bigint.ts
  • library/src/methods/pick/pick.ts
  • library/src/schemas/objectWithRest/objectWithRest.ts
  • library/src/schemas/promise/promise.ts
  • library/src/schemas/nonOptional/nonOptional.ts
  • library/src/methods/required/requiredAsync.ts
  • library/src/schemas/enum/enum.ts
  • library/src/schemas/never/never.ts
  • library/src/schemas/string/string.ts
  • library/src/schemas/tupleWithRest/tupleWithRestAsync.ts
  • library/src/schemas/symbol/symbol.ts
  • library/src/schemas/strictObject/strictObjectAsync.ts

Comment thread library/src/utils/_standardSchema/_standardSchema.ts
BaseSchema<unknown, unknown, BaseIssue<unknown>>,
ErrorMessage<ArrayIssue> | undefined
>
>({

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Redundant explicit generic argument _standardSchema<...>(...), repeated in ~90 places and duplicating the function's return type annotation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance Its performance related size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants