File tree Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -168,18 +168,16 @@ function hasTag(head: HeadConfig[], tag: HeadConfig) {
168
168
)
169
169
}
170
170
171
- export function mergeHead ( current : HeadConfig [ ] , ...incoming : HeadConfig [ ] [ ] ) {
172
- return incoming
173
- . filter ( ( el ) => Array . isArray ( el ) && el . length > 0 )
171
+ // Merge head tags, overwrite duplicate meta tags in ascending precedence
172
+ export function mergeHead ( ...heads : HeadConfig [ ] [ ] ) {
173
+ return heads
174
+ . filter ( Array . isArray )
174
175
. flat ( 1 )
175
176
. reverse ( )
176
- . reduce (
177
- ( merged , tag ) => {
178
- if ( ! hasTag ( merged , tag ) ) merged . push ( tag )
179
- return merged
180
- } ,
181
- [ ...current ]
182
- )
177
+ . reduce ( ( merged , tag ) => {
178
+ if ( ! hasTag ( merged , tag ) ) merged . push ( tag )
179
+ return merged
180
+ } , [ ] ) as HeadConfig [ ]
183
181
}
184
182
185
183
// https://github.com/rollup/rollup/blob/fec513270c6ac350072425cc045db367656c623b/src/utils/sanitizeFileName.ts
You can’t perform that action at this time.
0 commit comments