UNPKG
@opentiny/tiny-toolkit-docs
Version:
alpha (1.0.11-alpha.0)
latest (1.0.10)
1.0.11-alpha.0
1.0.10
1.0.10-alpha.0
1.0.9
1.0.9-alpha.0
1.0.8
这里对你的套件进行简单描述, 比如适用哪些场景,使用了什么技术, 有什么特点
github.com/opentiny/tiny-cli
opentiny/tiny-cli
@opentiny/tiny-toolkit-docs
/
template
/
vue
/
tiny-uno
/
variants
/
prefix.js
9 lines
(8 loc)
•
292 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
// 这是一个特殊的变体。 当用户需要使用缀时,传入前缀,返回一个变体函数
export
default
prefix =>
matcher
=>
{
if
(!matcher.
startsWith
(prefix))
return
'nomatch'
;
return
{
matcher
: matcher.
slice
(prefix.
length
),
selector
:
s
=>
`
${s}
`
, }; };