@shanzhai/stringify-json-input

A Shanzhai input which "stringifies" a value after retrieving it from an input.

Usage no npm install needed!

<script type="module">
  import shanzhaiStringifyJsonInput from 'https://cdn.skypack.dev/@shanzhai/stringify-json-input';
</script>

README

@shanzhai/stringify-json-input Continuous Integration License FOSSA Status Renovate enabled npm npm type definitions

A Shanzhai input which "stringifies" a value after retrieving it from an input.

Usage

Give an instance of StringifyJsonInput to a Step as an input and it will convert the value returned by its nested Input into a string of JSON.

For example, the following examples are equivalent:

new ExampleStep(
  new StringifyJsonInput(new ConstantInput([1, 2, 3]))
);
new ExampleStep(
  new ConstantInput(`[1,2,3]`])
);

Note that this does not directly use JSON.stringify; it has the following differences:

  • Object key order is always sorted, ascending.
  • Object properties with undefined values are omitted from the string of JSON.

Dependencies

This package has no runtime dependencies.

Peer Dependencies

This package has no runtime peer dependencies (it does not expect any other packages to be installed alongside itself).

License

FOSSA Status