spread-paths
v1.0.0
Published
![]( https://img.alicdn.com/imgextra/i1/583325539/O1CN01jnhKkB1qmuPZ4B6pG_!!583325539.jpg)
Downloads
2
Readme
spread-paths.js
字符串转换,将有使用[]
符号合并的path路径展开
安装
npm i -s spread-paths
使用
const spreadPaths = require("spread-paths");
spreadPaths("a.b, c.d.e"); //"a.b,c.d.e"
spreadPaths("a.b[c,e]"); //"a.b.c,a.b.e"
spreadPaths("a.b[c,e[f,g]]"); //"a.b.c,a.b.e.f,a.b.e.g"
注意
spreadPaths({});//报错:必须是字符串
spreadPaths("a[b]]");//报错:方括号未闭合
spreadPaths("a[b,c]e");//报错:不支持分支后再合并写法