Skip to content

Commit

Permalink
fix: regex
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackGlory committed Dec 23, 2024
1 parent 7deb7f1 commit 2e7347c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/parse-space-separated-sizes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { ISize } from '@src/types.js'
* @param sizes 例子`32x32`, `32x32 64x64`
*/
export function parseSpaceSeparatedSizes(sizes: string): ISize[] {
if (/^\d+[x|X]\d+(?:\s+\d+[x|X]\d+)*$/.test(sizes)) {
if (/^\d+[xX]\d+(?:\s+\d+[xX]\d+)*$/.test(sizes)) {
const re = /(?<width>\d+)[x|X](?<height>\d+)/g
const matches = sizes.matchAll(re)

Expand Down

0 comments on commit 2e7347c

Please sign in to comment.