Bring back old libraries

This commit is contained in:
Eric Fennis
2020-08-19 20:03:38 +02:00
parent d6b50f942a
commit 41b9d7637d
48 changed files with 0 additions and 1326 deletions
-29
View File
@@ -1,29 +0,0 @@
import replaceElement from './replaceElement';
import icons from './icons';
/*
Main library entry
*/
export default ({ icons = {}, nameAttr = 'data-feather', attrs = {} }) => {
if (!Object.values(icons).length) {
throw new Error(
"Please provide an icons object.\nIf you want to use all the icons you can import it like:\n `import featherity, { icons } from 'featherity';\nfeather({icons});`",
);
}
if (typeof document === 'undefined') {
throw new Error('`feather.replace()` only works in a browser environment.');
}
const elementsToReplace = document.querySelectorAll(`[${nameAttr}]`);
Array.from(elementsToReplace).forEach(element =>
replaceElement(element, { nameAttr, icons, attrs }),
);
};
/*
Icons exports.
*/
export * from './icons';
export { icons };