feat: Standard Schemaに対応するdowaSchemaを追加 - #14
Merged
Merged
Conversation
zod/valibotなどのバリデーションパイプラインに直接組み込めるよう、 StandardSchemaV1準拠のスキーマを作るdowaSchema()を追加。 冷笑パターンが検出された場合はissuesとして弾く。 - DowaOptionsの検証ロジックをlib/options.tsに切り出し、index.tsとschema.tsで共有 - regexのマッチ処理をlib/regex.tsのmatch()関数に切り出し - @standard-schema/specは型定義のみでビルド後のJSに影響しないためdependenciesに追加 - CONTRIBUTINGの依存関係禁止事項を「あらゆるランタイムで動作すること」を条件とした表現に修正 closes #13
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
issueへの対応ありがとうございます🙇 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
dowaSchema(options?)を追加。zod/valibotなどのバリデーションパイプラインにそのまま組み込めるようになり、スキーマのパースと冷笑検知を別々に行う必要がなくなりますDowaOptionsの検証ロジックをlib/options.tsに、regexのマッチ処理をlib/regex.tsのmatch()に切り出し、index.ts/lib/schema.tsで共有@standard-schema/specは型定義のみでビルド後のJSに影響しないためdependenciesに追加(あらゆるランタイムで動作)zod/valibotをdevDependenciesに追加closes #13
Test plan
npm run typechecknpm test(282 tests, dowaSchemaのzod/valibot相互運用テスト含む)npm run lintnpm run format:checknpm run build