-
Notifications
You must be signed in to change notification settings - Fork 1
feat: preserve OR-group tokens in tags DTO #130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -186,9 +186,9 @@ export class booruQueryValuesPostsDTO extends booruQueriesDTO { | |||||||||||||
| return value | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| return (Array.isArray(value) ? value : [value]).flatMap((tag) => | ||||||||||||||
| typeof tag === 'string' ? tag.trim().split('|') : [tag] | ||||||||||||||
| ) | ||||||||||||||
| return (Array.isArray(value) ? value : [value]) | ||||||||||||||
| .map((tag) => (typeof tag === 'string' ? tag : String(tag))) | ||||||||||||||
| .map((tag) => tag.trim()) | ||||||||||||||
|
Comment on lines
+189
to
+191
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Avoid coercing non-string tags before validation Line 190 converts non-string values with Suggested fix- return (Array.isArray(value) ? value : [value])
- .map((tag) => (typeof tag === 'string' ? tag : String(tag)))
- .map((tag) => tag.trim())
+ return (Array.isArray(value) ? value : [value]).map((tag) =>
+ typeof tag === 'string' ? tag.trim() : tag
+ )📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||
| }) | ||||||||||||||
| @IsOptional() | ||||||||||||||
| readonly tags: IBooruQueryValues['posts']['tags'] | ||||||||||||||
|
|
||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick | 🔵 Trivial
Add a direct regression test for pipe non-splitting
Given this PR removes pipe splitting, add one explicit case to assert
|is preserved within a single tag token.Suggested additional test
📝 Committable suggestion
🤖 Prompt for AI Agents