Skip to content

Commit e02d7e3

Browse files
feat: split on semicolons (;) instead of commas (,) to avoid srcset parser confusion
1 parent 763cc3b commit e02d7e3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/util.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export const cartesian = (...a: any[]) => a.reduce((a, b) => a.flatMap(d => b.ma
66

77
export function buildDirectiveOptions(src: URL): DirectiveOptions[] {
88
return Array.from(src.searchParams.entries())
9-
.map<[string, string[]]>(([key, value]) => [key, value.split(',')])
9+
.map<[string, string[]]>(([key, value]) => [key, value.split(';')])
1010
.map(([key, values]) => values.map(v => ({ [key]: v })))
1111
.reduce((prev, cur) => prev.length ? cartesian(prev, cur) : cur, [])
1212
.map((options: Record<string, any>[]) => Array.isArray(options) ? Object.assign({}, ...options) : options)

0 commit comments

Comments
 (0)