jaster

``` git clone https://github.com/andersondrosa/jaster.git cd jaster npm install npm test ```

Usage no npm install needed!

<script type="module">
  import jaster from 'https://cdn.skypack.dev/jaster';
</script>

README

Jaster at Master

How To Install

git clone https://github.com/andersondrosa/jaster.git
cd jaster
npm install
npm test

How To Use

const simpleData = {
  foo: { name: "Foo" },
  bar: { name: "Bar" },
  baz: "Should Not Be Parsed"
};

const mappers = {
  // Parse object values to json and make lower
  "object-values-to-json-lower": {
    "[]": "(object) json|lower"
  },
  // Then get just string and lower values and send integrity hash to output
  "lower-values-to-hash": {
    "[]": "(string|lower) hash => /{key}"
  }
};

const jaster = new Jaster({ mappers });

const { data, output } = jaster.map(simpleData, [
  "object-values-to-json-lower",
  "lower-values-to-hash"
]);

console.log(data, output);

Mapped response in self data:

{
  "foo": "{\"name\":\"Foo\"}",
  "bar": "{\"name\":\"Bar\"}"
}

Mapped response into output:

{
  "foo": "5dca85e76989e55ebbdec9e5304832c06a9ead7138b04372c65553003cfd2849",
  "bar": "0c002b1691188b3a7a147af463a399ea83a09dea0f99f0e37c9cb0ece0b6a84e"
}