{string} option.separater
The after method can specify Filter to process results after divide.
after方法可在divide后指定Filter对分裂后的results进行处理
The before method can specify Filter to process the original result before divide.
before方法可在divide前指定Filter对原始result进行处理
Handle is invoke method of Middleware. Result is the data to be processed. GatherCallback is a callback for processing. GatherCallback accepts Result | undefined.
handle是Middleware类被调用时使用的方法, result为待处理Result类型, 如果传入值为string类型, 会自动转为["undefined", string] GatherCallback为处理完毕时的回调
The next method is same as the nextEach method when accepts Middleware However it provides a simple way by using Finisher Type.
next方法同nextEach方法可以接受一个Middleware, 或者next可以接受Finisher类类型作为一种简写方式
The nextEach method accepts a Middleware to handle each result.
nextEach方法接受一个Middleware处理每个result
The nextList method accepts {[index:string]: Middleware} / Middleware[], and each Middleware handles the result corresponding to its index.
nextList方法接受一个索引对象, 每个Middleware处理对应其index对应的result
The nextList method accepts Middleware array, and each Middleware processes result corresponding to index.
nextList方法接受Middleware数组, 每个Middleware处理对应index的result
Split(extends Divider) can split the string by separator, and then wrap the each result element into Result<index:string, element: string> for the next step
Split(继承Divider) 能够通过分隔符切分字符串, 并将结果数组元素逐一 包装成Result<index:string, element: string>供下一步处理
const txt = "www.typescript.com"; const Regexp = new Regexp({separater: "."}).next(Gather); json.handle(["url", txt], (result) => { console.log(result); }); // ["0", "www"] ["1", "typescript"] ["2", "com"]