{"id":18613283,"url":"https://github.com/cirbuk/resolver","last_synced_at":"2026-04-30T13:33:01.847Z","repository":{"id":35133972,"uuid":"200894517","full_name":"cirbuk/resolver","owner":"cirbuk","description":"Resolve marked up JavaScript object/array/string against a data object.","archived":false,"fork":false,"pushed_at":"2024-10-01T06:04:55.000Z","size":573,"stargazers_count":0,"open_issues_count":9,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-08-08T18:47:58.203Z","etag":null,"topics":["json","json-template","mapping-tools","transformer"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cirbuk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-08-06T17:19:10.000Z","updated_at":"2024-10-01T06:00:52.000Z","dependencies_parsed_at":"2024-11-07T03:22:45.569Z","dependency_job_id":"6158e84d-802c-4bca-b34f-e204e535eadc","html_url":"https://github.com/cirbuk/resolver","commit_stats":{"total_commits":57,"total_committers":4,"mean_commits":14.25,"dds":0.543859649122807,"last_synced_commit":"e0d07e74cd971fdff245016d85fbb13396cf040a"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/cirbuk/resolver","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cirbuk%2Fresolver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cirbuk%2Fresolver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cirbuk%2Fresolver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cirbuk%2Fresolver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cirbuk","download_url":"https://codeload.github.com/cirbuk/resolver/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cirbuk%2Fresolver/sbom","scorecard":{"id":283086,"data":{"date":"2025-08-11","repo":{"name":"github.com/cirbuk/resolver","commit":"9e1eafdbe121f8199bd9e7e59dad2176ff686f66"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":0,"reason":"Found 0/15 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 17 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"34 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-qrpm-p2h7-hrv2","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-hwj9-h5mp-3pm3","Warn: Project is vulnerable to: GHSA-566m-qj78-rww5","Warn: Project is vulnerable to: GHSA-7fh5-64p2-3v2j","Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm","Warn: Project is vulnerable to: GHSA-33vh-7x8q-mg35","Warn: Project is vulnerable to: GHSA-79xf-67r4-q2jj","Warn: Project is vulnerable to: GHSA-9pcf-h8q9-63f6","Warn: Project is vulnerable to: GHSA-hcg3-56jf-x4vh","Warn: Project is vulnerable to: GHSA-hrpq-r399-whgw","Warn: Project is vulnerable to: GHSA-rjqq-98f6-6j3r","Warn: Project is vulnerable to: GHSA-mjxr-4v3x-q3m4","Warn: Project is vulnerable to: GHSA-cgfm-xwp7-2cvr","Warn: Project is vulnerable to: GHSA-rm97-x556-q36h","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-17T16:27:02.507Z","repository_id":35133972,"created_at":"2025-08-17T16:27:02.507Z","updated_at":"2025-08-17T16:27:02.507Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32466333,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"ssl_error","status_checked_at":"2026-04-30T13:12:06.837Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["json","json-template","mapping-tools","transformer"],"created_at":"2024-11-07T03:21:13.484Z","updated_at":"2026-04-30T13:33:01.818Z","avatar_url":"https://github.com/cirbuk.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @kubric/resolver [![Featured on Openbase](https://badges.openbase.com/js/featured/@kubric/resolver.svg?token=m+Bkj60K0yPw2QwDOfri1OEKW5h9Bb7/46p+sopfaec=)](https://openbase.com/js/@kubric/resolver?utm_source=embedded\u0026amp;utm_medium=badge\u0026amp;utm_campaign=rate-badge)\n\nResolver is capable of resolving any marked up JavaScript object/array/string against a data object.\n\n## Installation\n\n```JavaScript\nnpm install @kubric/resolver\n```\n\nor\n\n```JavaScript\nyarn add @kubric/resolver\n```\n\n## Usage\n\n``` JavaScript\nimport Resolver from \"@kubric/resolver\"\n\n//Data JSON\nconst data = {\n  isFormData: false,\n  appName: 'an_app',\n  email: [{\n    id: 'abc@gmail.com',\n  }],\n  mapValue: {\n    data: {\n      name: \"tester\",\n      id: 1234\n    }\n  },\n};\n\n//Template JSON\nconst template = {\n  method: 'post',\n  isFormData: '{{isFormData}}',\n  userId: 'userid_{{mapValue.data.id}}',\n  data: {\n    userid: '{{email.0.id}}',\n    app_name: '{{appName}}',\n  },\n  extraData: '{{mapValue.data}}'\n};\n\nconst resolver = new Resolver();\nconst resolvedData = resolver.resolve(template, data);\n\n// resolvedData will be\n// {\n//   method: 'post',\n//   isFormData: false,\n//   userId: 'userid_1234',\n//   data: {\n//     userid: 'abc@gmail.com',\n//     app_name: 'an_app'\n//   },\n//   extraData: {\n//     name: \"tester\",\n//     id: 1234\n//   }\n// }\n```\n\n## Default values\n\nDefault values can be provided in the markup, to support the case when the mapping path results in an `undefined` when resolved against the data\n\n``` JavaScript\nimport Resolver from \"@kubric/resolver\"\n\n//Data JSON\nconst data = {};\n\n//Template JSON\nconst template = {\n  method: 'post',\n  isFormData: '{{isFormData|false}}',\n  userId: 'userid_{{mapValue.data.id|1234}}',\n  data: {\n    userid: '{{email.0.id|abc@gmail.com}}',\n    app_name: '{{appName|an_app}}',\n  }\n};\n\nconst resolver = new Resolver();\nconst resolvedData = resolver.resolve(template, data);\n\n// resolvedData will be\n// {\n//   method: 'post',\n//   isFormData: 'false',\n//   userId: 'userid_1234',\n//   data: {\n//     userid: 'abc@gmail.com',\n//     app_name: 'an_app'\n//   }\n// }\n```\n\n## Type conversion\n\nBy default, the resolver always resolve to whatever type is returned from the data. This behavior can be altered by forcing a type conversion. The following 7 types are supported - `number`, `object`, `array`, `string`, `boolean` and `null`.\n\n```JavaScript\nimport Resolver from \"@kubric/resolver\"\n\n//Data JSON\nconst data = {\n  once: 1,\n  numberstring: \"3\",\n  number: 4,\n  stringnumber: 10,\n  booleanstring: \"test\",\n  boolean: true,\n  array: [1],\n  object: {\n    one: 1\n  },\n  objectstring: '{\"four\":4}',\n  null: 5\n};\n\n//Template JSON\nconst template = {\n  //{{data.once|5}} = 1 resolved from data. Default value \"5\" is ignored\n  //{{data.twice|2}} = \"2\" resolved from default value.\n  withinstring: \"replacing within string once {{data.once|5}} and twice {{data.twice|2}}\",\n\n  //{{data.notypedefault|5}} = \"5\" resolved from default value\n  notypedefault: \"{{data.notypedefault|5}}\",\n\n  //{{data.numberstring||number}} = 3 resolved from data.numberstring(\"3\") and\n  //converted to number(3)\n  numberstring: \"{{data.numberstring||number}}\",\n\n  //{{data.number||number}} = 4 resolved from data.number(4) and converted to\n  //number(4)\n  number: \"{{data.number||number}}\",\n\n  //{{data.numberdefault|5|number}} = 5 resolved from defaultValue(\"5\") and\n  //converted to number(5)\n  numberdefault: \"{{data.numberdefault|5|number}}\",\n\n  //{{data.stringnumber||string}} = \"10\" resolved from data.stringnumber(10) and\n  //converted to string(\"10\")\n  stringnumber: \"{{data.stringnumber||string}}\",\n\n  //{{data.stringdefault|test|string}} = \"test\" resolved from default value(\"test\")\n  stringdefault: \"{{data.stringdefault|test|string}}\",\n\n  //boolean type resolves to true for boolean true and string \"true\". It resolve\n  //to false for everything else\n  //{{data.booldefault|test|boolean}} = false resolved from default value(\"test\").\n  booldefault: \"{{data.booldefault|test|boolean}}\",\n\n  //{{data.boolfalsedefault|true|boolean}} = true resolved from default value\n  //(\"true\").\n  booltruedefault: \"{{data.boolfalsedefault|true|boolean}}\",\n\n  //{{data.booleanstring||boolean}} = false resolved from data.booleanstring\n  //(\"test\").\n  booleanstring: \"{{data.booleanstring||boolean}}\",\n\n  //{{data.boolean||boolean}} = true resolved from data.boolean(true).\n  boolean: \"{{data.boolean||boolean}}\",\n\n  //{{data.array|[2,3]|array}} = [1] resolved from data.array([1])\n  array: \"{{data.array|[2,3]|array}}\",\n\n  //{{data.defaultarray|[2,3]|array}} = [2,3] resolved from default value(\"[2,3]\")\n  //and converted to array([2,3])\n  defaultarray: \"{{data.defaultarray|[2,3]|array}}\",\n\n  //{{data.defaultarray|[2,3]}} = \"[2,3]\" resolved from default value(\"[2,3]\")\n  arraystring: \"{{data.defaultarray|[2,3]}}\",\n\n  //{{data.object|{\"two\": 2, \"three\": 3}|object}} = {\"one\":1} resolved from\n  //data.object({\"one\":1})\n  object: '{{data.object|{\"two\": 2, \"three\": 3}|object}}',\n\n  //{{data.defaultobject|{\"two\": 2, \"three\": 3}|object}} = {\"two\":2,\"three\":3}\n  //resolved from default value('{\"two\": 2, \"three\": 3}') and converted to object\n  //({\"two\": 2, \"three\": 3})\n  defaultobject: '{{data.defaultobject|{\"two\": 2, \"three\": 3}|object}}',\n\n  //{{data.defaultobject|{\"two\": 2, \"three\": 3}}} = '{\"two\": 2, \"three\": 3}'\n  //resolved from default value('{\"two\": 2, \"three\": 3}')\n  defaultobjectstring: '{{data.defaultobject|{\"two\": 2, \"three\": 3}}}',\n\n  //{{data.objectstring||object}} = {\"four\": 4} resolved from data.objectstring\n  //('{\"four\": 4}') and converted to object({\"four\": 4})\n  objectstring: '{{data.objectstring||object}}',\n\n  //null is a special type. If the type is null and the mapping results in an\n  //undefined value, the mapping resolved to null\n  //{{data.nulldefault||null}} = null as data.nulldefault returns undefined\n  nulldefault: '{{data.nulldefault||null}}',\n\n  //{{data.null||null}} = 5 resolved from data.null(5)\n  null: '{{data.null||null}}',\n};\n\nconst resolver = new Resolver();\nconst resolvedData = resolver.resolve(template, data);\n\n// resolvedData will be\n// {\n//   withinstring: \"replacing within string once 1 and twice 2\",\n//   notypedefault: \"5\",\n//   numberstring: 3,\n//   number: 4,\n//   numberdefault: 5,\n//   stringnumber: \"10\",\n//   stringdefault: \"test\",\n//   booldefault: false,\n//   booltruedefault: true,\n//   booleanstring: false,\n//   boolean: true,\n//   array: [1],\n//   defaultarray: [2, 3],\n//   arraystring: \"[2,3]\",\n//   defaultobjectstring: '{\"two\": 2, \"three\": 3}',\n//   defaultobject: {\n//     two: 2,\n//     three: 3\n//   },\n//   object: {\n//     one: 1\n//   },\n//   objectstring: {\n//     four: 4\n//   },\n//   nulldefault: null,\n//   null: 5\n// }\n```\n\n## Transformers\n\nTransformers can be defined in the template when extracted data need to be transformed before being applied.\n\nIn the template if any of the properties have as its value, an object with just the 2 properties `_mapping` and `_transformer` where `_transformer` is a function, then the resolver will resolve the mapping string from the data object and get the value resolved by passing it to the transformer function.\n\n``` JavaScript\nimport Resolver from \"@kubric/resolver\"\n\nconst data = {\n  isFormData: false,\n};\n\nconst template = {\n  method: 'post',\n  isFormData: {\n    //resolves to false\n    _mapping: \"{{isFormData}}\",\n\n    //The value false resolved using the _mapping is passed to the function. The\n    //value that the function returns will become the value of isFormData\n    _transformer(value) {\n      return value === false ? \"This is a false value\" : \"This is a true value\";\n    }\n  }\n};\n\nconst resolver = new Resolver();\nconst resolvedData = resolver.resolve(template, data);\n\n// resolvedData will be\n// {\n//   isFormData: 'This is a false value',\n// }\n```\n\nTransformers can be defined in 3 places\n\n1. mapping: This transformer affects only the mapping for which it is defined. eg. The transformer defined in the above code. A mapping transformer, if defined will always be called.\n2. `resolve()` function call: When `resolve()` is called, a `transformer` function can be passed in the `options`(see [resolve()](#resolver.resolve())). This transformer will be called for every mapping in the template, other than the mappings that have a transformer already defined.\n3. `new Resolver()`: When a resolver instance is created, a transformer can b e passed in the `options`(see [options](#options)). This transformer will be called for all mappings for all calls to the `resolve()` function.\n\nRules for transformer invocation are as follows\n\n1. Only one transformer will be called for a mapping\n2. Order of precedence of if transformers have been defined in multiple levels - mapping \u003e `resolve()` \u003e `new Resolver()`\n\n## Mappers\n\nThe resolver's default behavior is to try and replace everything between `{{` and `}}` with values from the data json. `mappers` can be used to define other markup operators.\n\n```JavaScript\nimport Resolver from \"@kubric/resolver\"\nimport math from \"math-expression-evaluator\";\n\nconst data = {\n  val1: \"1\",\n  val2: \"2\",\n  val3: \"3\",\n  val4: \"4\",\n};\n\nconst evaluators = {\n  // \"data\" is the data that has been passed for resolution to the resolve() \n  // call\n  math: (match, formula, data) =\u003e {\n    try {\n      return +math.eval(formula);\n    } catch (ex) {\n      return match;\n    }\n  }\n};\n\nconst template = {\n  //Multiple mappings are used inside a string here. So the values returned by\n  //the evaluator will be replaced into the string. The final value here will\n  //be the string \"3 and 7\"\n  calculatedStringValue: \"[[{{val1}} + {{val2}}]] and [[{{val3}} + {{val4}}]]\",\n  \n  //The entire string is one mapping. So value returned by the evaluator will be\n  //assigned as such. The final value here will be the number 5\n  calculatedNumberValue: \"[[{{val1}} + {{val4}}]]\"\n};\n\n//Anything that is enclosed within [[ and ]] will be passed to the math evaluator\nconst resolver = new Resolver({\n  //Anything enclosed between [[ and ]] will be sent to the math evaluator\n  mappers: [\n    [/\\[\\[(.+?)]]/g, evaluators.math]\n  ]\n});\n\nconst resolvedData = resolver.resolve(template, data);\n// resolvedData will be\n// {\n//     calculatedStringValue: '3 and 7',\n//     calculatedNumberValue: 5\n// }\n```\n\n\u003e `mappers` take effect only after standard mappings(mappings between `{{` and `}}`) are resolved and the transformer pipeline has been executed. The standard mapping operator cannot be overridden using custom mappers.\n\n## Nested mapping\n\n``` JavaScript\nimport Resolver from \"@kubric/resolver\"\n\n//Data JSON\nconst data = {\n  property: \"value\",\n  index: {\n    value: \"2\",\n    value1: 0\n  },\n  array: [\"one\", \"two\", [\"3\"]]\n};\n\n//Template JSON\nconst template = {\n  string: \"This is a string that has been resolved from a \" +\n    \"{{array.{{index.{{property}}||number}}.{{index.value1}}||number}} level nested mapping\"\n};\n\nconst resolver = new Resolver();\nconst resolvedData = resolver.resolve(template, data);\n\n// resolvedData will be\n// {\n//   string: \"This is a string that has been resolved from a 3 level nested mapping\"\n// }\n// {{property}} - Resolves to \"value\" and the mapping becomes {{array.{{index.value||number}}.{{index.value1}}||number}}\n// {{index.value||number}} - Resolves to 2 and the mapping becomes {{array.2.{{index.value1}}||number}}\n// {{index.value1}} - Resolves to 0 and the mapping becomes {{array.2.0||number}}\n// {{array.2.0||number}} - Resolves to 3\n```\n\n## API\n\n### new Resolver(options)\n\nCreates a new Resolver instance\n\n#### options\n\n`options` should be an object with the following properties\n\nProperty | Description | Remarks\n---------|-------------|----------\nreplaceUndefinedWith | If a mapping path does not exist or is marked as `undefined` in the data json, the value of that mapping is taken to be `undefined`. `replaceUndefinedWith` can be used to replace such missing mappings with a custom value. | optional\nignoreUndefined | If `true`, mappings that do not exist or returns `undefined` from the data json will be ignored and left as is without resolving them. | optional \u003cbr/\u003e\u003cbr/\u003e Default value: `false`.\ntransformer| Resolver instance level transformer can be defined here | optional \u003cbr/\u003e\u003cbr/\u003e See [Transformers](#Transformers)\nmappers | Used to define custom markup operators and their behavior | optional \u003cbr/\u003e\u003cbr/\u003e Refer [mappers](#mappers)\ndelimiter | Sets the delimiter pattern that is used to delimit between mapping, default value and type in a mapping string. | optional \u003cbr/\u003e\u003cbr/\u003e Default value: `|`\nfields | It accepts an object with string properties `mapping` and `transformer` whose values will replace `_mapping` and `_transformer` as the keywords while defining a transformer for a single mapping. | optional \u003cbr/\u003e\u003cbr/\u003e Defaults to `{ mapping: \"_mapping\", tranformer: \"_transformer\" }`\noverrideDefault | If `true`, will override the default resolver behavior i.e. it will avoid resolving content between `{{}}` and will rely entirely on the mappers for resolution. | optional \u003cbr/\u003e\u003cbr/\u003e Default value: `false`\n\n### resolver.resolve(template, data, options)\n\nProperty | Description | Remarks\n---------|-------------|----------\ntemplate | JS object/string/array that needs to be resolved against `data` | required\ndata | JSON object against which the `template` will be resolved | optional\noptions.transformer | If defined, this function will be called to transform the value of every mapping defined in `template` except if there is an exclusive transformer defined for a mapping | optional \u003cbr/\u003e\u003cbr/\u003e See [Transformers](#Transformers)\noptions.mappers | If defined, will override the `mappers` defined at an instance level for that invocation of the `resolve()` function | optional \u003cbr/\u003e\u003cbr/\u003e Refer [mappers](#mappers)\noptions.overrideDefault | If defined, will override the `overrideDefault` defined at an instance level for that invocation of the `resolve()` function | optional \u003cbr/\u003e\u003cbr/\u003e Refer [options](#options)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcirbuk%2Fresolver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcirbuk%2Fresolver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcirbuk%2Fresolver/lists"}