Skip to content
Myr

common.ts

This file

Path

src/jsx/intrinsic-element/common.ts

23 lines · 650 bytes · TypeScript

Last changed by

Not known.

History of this file

Take it

The walk stopped after 200 commits: lines older than f0b094d point at it.

Merge commit from forkYusuke Wadabefore adoptionf0b094d

lines 1–23why, one step back
1import type { Props } from '../base'
23export const deDupeKeyMap: Record<string, string[]> = {4 title: [],5 script: ['src'],6 style: ['data-href'],7 link: ['href'],8 meta: ['name', 'httpEquiv', 'charset', 'itemProp'],9}1011export const domRenderers: Record<string, Function> = {}1213export const dataPrecedenceAttr = 'data-precedence'1415export const isStylesheetLinkWithPrecedence = (props: Props): boolean =>16 props.rel === 'stylesheet' && 'precedence' in props1718export const shouldDeDupeByKey = (tagName: string, supportSort: boolean): boolean => {19 if (tagName === 'link') {20 return supportSort21 }22 return deDupeKeyMap[tagName].length > 023}