UNPKG

@nlighten/json-transform-core

Version:

Core types and utilities for handling JSON transformers

83 lines (82 loc) 1.77 kB
[ { "name": "inline (no args)", "given": { "input": "hello-world", "definition": "$$substring:$" }, "expect": { "equal": "hello-world" } }, { "name": "inline (no args, parenthesis)", "given": { "input": "hello-world", "definition": "$$substring():$" }, "expect": { "equal": "hello-world" } }, { "name": "inline (5)", "given": { "input": "hello-world", "definition": "$$substring(5):$" }, "expect": { "equal": "-world" } }, { "name": "inline (5,8)", "given": { "input": "hello-world", "definition": "$$substring(5,8):$" }, "expect": { "equal": "-wo" } }, { "name": "inline (-5)", "given": { "input": "hello-world", "definition": "$$substring(-5):$" }, "expect": { "equal": "world" } }, { "name": "inline (5,-5)", "given": { "input": "hello-world", "definition": "$$substring(5,-5):$" }, "expect": { "equal": "-" } }, { "name": "inline (-5,-1)", "given": { "input": "hello-world", "definition": "$$substring(-5,-1):$" }, "expect": { "equal": "worl" } }, { "name": "inline (coercion from number)", "given": { "input": 12345678, "definition": "$$substring(-5,-1):$" }, "expect": { "equal": "4567" } } ]