This commit is contained in:
John Letey
2020-06-08 16:39:52 +01:00
commit 433bbae4f1
337 changed files with 21687 additions and 0 deletions

30
src/to-svg.js Normal file
View File

@@ -0,0 +1,30 @@
import icons from './icons';
/**
* Create an SVG string.
* @deprecated
* @param {string} name
* @param {Object} attrs
* @returns {string}
*/
function toSvg(name, attrs = {}) {
console.warn(
'feather.toSvg() is deprecated. Please use feather.icons[name].toSvg() instead.',
);
if (!name) {
throw new Error('The required `key` (icon name) parameter is missing.');
}
if (!icons[name]) {
throw new Error(
`No icon matching '${
name
}'. See the complete list of icons at https://feathericons.com`,
);
}
return icons[name].toSvg(attrs);
}
export default toSvg;