Simple email application for Android. Original source code: https://framagit.org/dystopia-project/simple-email
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
1.3 KiB

  1. ## A JavaScript URI template implementation
  2. This is a simple URI template implementation following the [RFC 6570 URI Template specification](http://tools.ietf.org/html/rfc6570). The implementation supports all levels defined in the specification and is extensively tested.
  3. ## Installation
  4. For use with Node.js you can install it through npm:
  5. $ npm install url-template
  6. If you want to use it in a browser, copy `lib/url-template.js` into your project and use the global `urltemplate` instance. Alternatively you can use [Bower](http://bower.io/) to install this package:
  7. $ bower install url-template
  8. ## Example
  9. var template = require('url-template');
  10. ...
  11. var emailUrl = template.parse('/{email}/{folder}/{id}');
  12. // Returns '/user@domain/test/42'
  13. emailUrl.expand({
  14. email: 'user@domain',
  15. folder: 'test',
  16. id: 42
  17. });
  18. ## A note on error handling and reporting
  19. The RFC states that errors in the templates could optionally be handled and reported to the user. This implementation takes a slightly different approach in that it tries to do a best effort template expansion and leaves erroneous expressions in the returned URI instead of throwing errors. So for example, the incorrect expression `{unclosed` will return `{unclosed` as output. The leaves incorrect URLs to be handled by your URL library of choice.