@luxuryescapes/lib-uri-templates

All our routes in a repo for profit

Usage no npm install needed!

<script type="module">
  import luxuryescapesLibUriTemplates from 'https://cdn.skypack.dev/@luxuryescapes/lib-uri-templates';
</script>

README

CircleCI

LE URI Templates Library

Published templates:

const uri = require('lib-uri-templates');
const template = uri.templates.reservation.properties;
// Or legacy API:
// const template = uri.get('properties');

template.rfc6570                              // '/api/properties{?id_salesforce_external,limit,page}'
template.expand({id_salesforce_external: 1})  // '/api/properties?id_salesforce_external=1

Development templates:

const uri = require('lib-uri-templates');
const template = uri.mock('/api/properties{?id_salesforce_external,limit,page}')

template.rfc6570                              // '/api/properties{?id_salesforce_external,limit,page}'
template.expand({id_salesforce_external: 1})  // '/api/properties?id_salesforce_external=1

publish

  1. Merge your branch
  2. Checkout master
  3. Run yarn publish