@hello-pangea/dnd
Version:
Beautiful and accessible drag and drop for lists with React
39 lines (29 loc) • 795 B
text/typescript
import { warning } from '../../dev-warning';
const suffix = `
We expect a html5 doctype:
This is to ensure consistent browser layout and measurement
More information: https://github.com/hello-pangea/dnd/blob/main/docs/guides/doctype.md
`;
export default (doc: Document) => {
const doctype: DocumentType | null = doc.doctype;
if (!doctype) {
warning(`
No found.
${suffix}
`);
return;
}
if (doctype.name.toLowerCase() !== 'html') {
warning(`
Unexpected found: (${doctype.name})
${suffix}
`);
}
if (doctype.publicId !== '') {
warning(`
Unexpected publicId found: (${doctype.publicId})
A html5 doctype does not have a publicId
${suffix}
`);
}
};