Skip to content

matchIconName

This constant is part of Iconify Utils package.

Constant matchIconName is used to validate all parts of icon name.

The only exception is provider. API provider can be empty, so additional check for empty provider is needed.

This constant is used by validateIconName().

Usage

tsimport { matchIconName } from '@iconify/utils';

function checkIcon(name: string): boolean {
   return !!name.match(matchIconName);
}

console.log(checkIcon('test-icon') ? 'passed' : 'failed');

Released under the Apache 2.0 License.