forked from WebReflection/hyperHTML
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove all polyfills and updates dependencies
BREAKING CHANGES: Drop IE, Edge legacy and old browsers which are not support ES2015+ features
- Loading branch information
1 parent
a78549e
commit c20464d
Showing
23 changed files
with
3,897 additions
and
4,852 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
.DS_Store | ||
.nyc_output | ||
node_modules/ | ||
coverage/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,31 @@ | ||
'use strict'; | ||
const {isArray} = Array; | ||
|
||
exports.isArray = isArray; | ||
|
||
const { | ||
createDocumentFragment, | ||
createElement, | ||
createElementNS, | ||
} = new Proxy({}, { | ||
get: (_, method) => document[method].bind(document) | ||
}); | ||
|
||
const createHTML = html => { | ||
const template = createElement('template'); | ||
template.innerHTML = html; | ||
return template.content; | ||
}; | ||
|
||
let xml; | ||
const createSVG = svg => { | ||
if (!xml) xml = createElementNS('http://www.w3.org/2000/svg', 'svg'); | ||
xml.innerHTML = svg; | ||
const content = createDocumentFragment(); | ||
content.append(...xml.childNodes); | ||
return content; | ||
}; | ||
|
||
const createContent = (text, type) => type == 'svg' ? | ||
createSVG(text) : createHTML(text); | ||
exports.createContent = createContent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
const {isArray} = Array; | ||
|
||
export {isArray}; | ||
|
||
const { | ||
createDocumentFragment, | ||
createElement, | ||
createElementNS, | ||
} = new Proxy({}, { | ||
get: (_, method) => document[method].bind(document) | ||
}); | ||
|
||
const createHTML = html => { | ||
const template = createElement('template'); | ||
template.innerHTML = html; | ||
return template.content; | ||
}; | ||
|
||
let xml; | ||
const createSVG = svg => { | ||
if (!xml) xml = createElementNS('http://www.w3.org/2000/svg', 'svg'); | ||
xml.innerHTML = svg; | ||
const content = createDocumentFragment(); | ||
content.append(...xml.childNodes); | ||
return content; | ||
}; | ||
|
||
export const createContent = (text, type) => type == 'svg' ? | ||
createSVG(text) : createHTML(text); |
Oops, something went wrong.