Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
uri-template-lite
Advanced tools
URI Template RFC 6570 expansion and extraction.
// Call `expand` directly
var data = {"domain":"example.com", "user":"fred", "query":"mycelium"}
URI.expand("http://{domain}/~{user}/foo{?query,number}", data)
// Returns http://example.com/~fred/foo?query=mycelium
// ..or use `Template` constructor
var data = {"domain":"example.com", "user":"fred", "query":"mycelium", "number": 3}
var template = new URI.Template("http://{domain}/~{user}/foo{?query,number}")
template.expand(data)
// Returns http://example.com/~fred/foo?query=mycelium&number=3
// Extract variables
template.match("http://example.com/~fred/foo?query=mycelium&number=3")
// Returns {"domain":"example.com", "user":"fred", "query":"mycelium", "number": "3"}
template.match("http://other.com/?query=mycelium")
// Returns null
To use it in the browser, include uri-template.js in your site
<script src=uri-template.js></script>
In node.js: npm install uri-template-lite
var URI = require("uri-template-lite").URI
This implementation 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.
It should work IE6 and up but automated testing is currently broken.
browser-upgrade-lite
package
or other ES5 polyfill.escape
should be patched to remove non-standard 2nd param,
browser-upgrade-lite
does that.GitHub repo | npm package | URI Template RFC 6570 and Tests | Travis CI | Coveralls coverage | [Buy Me A Tea][8]
Copyright (c) 2014-2019 Lauri Rooden <lauri@rooden.ee>
The MIT License
FAQs
URI Template [RFC 6570] expansion and extraction
We found that uri-template-lite demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.