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.
npm install uri-template-lite
var UriTemplate = require("uri-template-lite")
// Call `expand` directly
var data = {"domain":"example.com", "user":"fred", "query":"mycelium"}
UriTemplate.expand("http://{domain}/~{user}/foo{?query,number}", data)
// Returns http://example.com/~fred/foo?query=mycelium
// ..or use `Template` constructor
var template = new UriTemplate("http://{domain}/~{user}/foo{?query,number}")
template.expand({"domain":"example.com", "user":"fred", "query":"mycelium", "number": 3})
// 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
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 |
Coveralls coverage
Buy Me A Tea
Copyright (c) 2014-2022 Lauri Rooden <lauri@rooden.ee>
The MIT License
FAQs
URI Template [RFC 6570] expansion and extraction
The npm package uri-template-lite receives a total of 0 weekly downloads. As such, uri-template-lite popularity was classified as not popular.
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.