UNPKG

@nlighten/json-transform-core

Version:

Core types and utilities for handling JSON transformers

53 lines (52 loc) 1.36 kB
[ { "name": "testInlineFunctionSplit - basic split with no delimiter", "given": { "input": "hello world", "definition": "$$split:$" }, "expect": { "equal": ["h", "e", "l", "l", "o", " ", "w", "o", "r", "l", "d"] } }, { "name": "testInlineFunctionSplit - split by single space character", "given": { "input": "hello world", "definition": "$$split(' '):$" }, "expect": { "equal": ["hello", "world"] } }, { "name": "testInlineFunctionSplit - split by 'll'", "given": { "input": "hello world", "definition": "$$split(ll):$" }, "expect": { "equal": ["he", "o world"] } }, { "name": "testInlineFunctionSplit - split by 'll?' (regex pattern)", "given": { "input": "hello world", "definition": "$$split(ll?):$" }, "expect": { "equal": ["he", "o wor", "d"] } }, { "name": "testInlineFunctionSplit - split by 'o' with limit of 2", "given": { "input": "hello world", "definition": "$$split(o,2):$" }, "expect": { "equal": ["hell", " world"] } } ]