1 Star 0 Fork 1

Yaohaixiao / icons.js

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
getSymbolPath.js 508 Bytes
一键复制 编辑 原始数据 按行查看 历史
import isString from './utils/isString'
import getSymbol from './getSymbol'
const getSymbolPath = (name, iconSet = 'icon') => {
const pattern = /<symbol(([\s\S])*?)>(.*?)<\/symbol>/
const inner = getSymbol(name, iconSet)
let matches = []
let symbol = ''
if (!isString(name)) {
return ''
}
symbol = inner || (pattern.test(name) ? name : '')
if (symbol) {
matches = symbol.match(pattern)
}
return symbol ? matches[3] : ''
}
export default getSymbolPath
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/yaohaixiao/icons.js.git
git@gitee.com:yaohaixiao/icons.js.git
yaohaixiao
icons.js
icons.js
main

搜索帮助

344bd9b3 5694891 D2dac590 5694891