MCPcopy Create free account
hub / github.com/testing-library/user-event / normalizeFormat

Function normalizeFormat

src/utils/dataTransfer/DataTransfer.ts:77–84  ·  view source on GitHub ↗
(format: string)

Source from the content-addressed store, hash-verified

75// and the shorthands `text` and `url` to be replaced with their MIME types.
76// https://html.spec.whatwg.org/multipage/dnd.html#dom-datatransfer-setdata
77function normalizeFormat(format: string) {
78 const type = toAsciiLowercase(format)
79 return type === 'text'
80 ? 'text/plain'
81 : type === 'url'
82 ? 'text/uri-list'
83 : type
84}
85
86function getTypeMatcher(type: string, exact: boolean) {
87 const [group, sub] = type.split('/')

Callers 3

getDataMethod · 0.85
setDataMethod · 0.85
clearDataMethod · 0.85

Calls 1

toAsciiLowercaseFunction · 0.85

Tested by

no test coverage detected