spread-paths

1.0.0 • Public • Published

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");//报错:不支持分支后再合并写法
 
 

Readme

Keywords

none

Package Sidebar

Install

npm i spread-paths

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

33.2 kB

Total Files

12

Last publish

Collaborators

  • tangoboy