mirror of
https://github.com/iconify/iconify.git
synced 2025-01-07 15:44:05 +00:00
Make default provider an optional parameter when converting icon name in utils
This commit is contained in:
parent
dee8562c7f
commit
992e02d896
4
packages/utils/package-lock.json
generated
4
packages/utils/package-lock.json
generated
@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@iconify/utils",
|
"name": "@iconify/utils",
|
||||||
"version": "1.0.2",
|
"version": "1.0.3",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@iconify/utils",
|
"name": "@iconify/utils",
|
||||||
"version": "1.0.2",
|
"version": "1.0.3",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@iconify/types": "^1.0.6"
|
"@iconify/types": "^1.0.6"
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
"name": "@iconify/utils",
|
"name": "@iconify/utils",
|
||||||
"description": "Common functions for working with Iconify icon sets used by various packages.",
|
"description": "Common functions for working with Iconify icon sets used by various packages.",
|
||||||
"author": "Vjacheslav Trushkin",
|
"author": "Vjacheslav Trushkin",
|
||||||
"version": "1.0.2",
|
"version": "1.0.3",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"bugs": "https://github.com/iconify/iconify/issues",
|
"bugs": "https://github.com/iconify/iconify/issues",
|
||||||
"homepage": "https://iconify.design/",
|
"homepage": "https://iconify.design/",
|
||||||
|
@ -20,9 +20,9 @@ export type IconifyIconSource = Omit<IconifyIconName, 'name'>;
|
|||||||
export const stringToIcon = (
|
export const stringToIcon = (
|
||||||
value: string,
|
value: string,
|
||||||
validate?: boolean,
|
validate?: boolean,
|
||||||
allowSimpleName?: boolean
|
allowSimpleName?: boolean,
|
||||||
|
provider = ''
|
||||||
): IconifyIconName | null => {
|
): IconifyIconName | null => {
|
||||||
let provider = '';
|
|
||||||
const colonSeparated = value.split(':');
|
const colonSeparated = value.split(':');
|
||||||
|
|
||||||
// Check for provider with correct '@' at start
|
// Check for provider with correct '@' at start
|
||||||
|
Loading…
Reference in New Issue
Block a user