magnet-uri
Advanced tools
Comparing version 6.2.0 to 7.0.0
15
index.js
/*! magnet-uri. MIT License. WebTorrent LLC <https://webtorrent.io/opensource> */ | ||
module.exports = magnetURIDecode | ||
module.exports.decode = magnetURIDecode | ||
module.exports.encode = magnetURIEncode | ||
import base32 from 'thirty-two' | ||
import { parse, compose } from 'bep53-range' | ||
const base32 = require('thirty-two') | ||
const bep53Range = require('bep53-range') | ||
/** | ||
@@ -50,3 +46,3 @@ * Parse a magnet URI and return an object of keys/values | ||
// bep53 | ||
if (key === 'so') val = bep53Range.parse(decodeURIComponent(val).split(',')) | ||
if (key === 'so') val = parse(decodeURIComponent(val).split(',')) | ||
@@ -174,3 +170,3 @@ // If there are repeated parameters, return an array of values | ||
}) | ||
if (key === 'so') result += `${key}=${bep53Range.compose(values)}` | ||
if (key === 'so') result += `${key}=${compose(values)}` | ||
}) | ||
@@ -180,1 +176,4 @@ | ||
} | ||
export default magnetURIDecode | ||
export { magnetURIDecode as decode, magnetURIEncode as encode } |
{ | ||
"name": "magnet-uri", | ||
"description": "Parse a magnet URI and return an object of keys/values", | ||
"version": "6.2.0", | ||
"version": "7.0.0", | ||
"author": { | ||
@@ -13,9 +13,12 @@ "name": "WebTorrent LLC", | ||
}, | ||
"type": "module", | ||
"dependencies": { | ||
"bep53-range": "^1.1.0", | ||
"bep53-range": "^2.0.0", | ||
"thirty-two": "^1.0.2" | ||
}, | ||
"devDependencies": { | ||
"@webtorrent/semantic-release-config": "1.0.8", | ||
"semantic-release": "20.1.0", | ||
"standard": "*", | ||
"tape": "^5.2.2" | ||
"tape": "5.6.3" | ||
}, | ||
@@ -47,3 +50,8 @@ "funding": [ | ||
"license": "MIT", | ||
"main": "index.js", | ||
"engines": { | ||
"node": ">=12.20.0" | ||
}, | ||
"exports": { | ||
"import": "./index.js" | ||
}, | ||
"repository": { | ||
@@ -55,3 +63,12 @@ "type": "git", | ||
"test": "standard && tape test/*.js" | ||
}, | ||
"renovate": { | ||
"extends": [ | ||
"github>webtorrent/renovate-config" | ||
], | ||
"rangeStrategy": "bump" | ||
}, | ||
"release": { | ||
"extends": "@webtorrent/semantic-release-config" | ||
} | ||
} |
@@ -29,3 +29,3 @@ # magnet-uri [![ci][ci-image]][ci-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url] | ||
```js | ||
const magnet = require('magnet-uri') | ||
import magnet from 'magnet-uri' | ||
@@ -74,3 +74,3 @@ // "Leaves of Grass" by Walt Whitman | ||
```js | ||
const magnet = require('magnet-uri') | ||
import magnet from 'magnet-uri' | ||
@@ -77,0 +77,0 @@ const uri = magnet.encode({ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12989
5
Yes
4
145
1
+ Addedbep53-range@2.0.0(transitive)
- Removedbep53-range@1.1.1(transitive)
Updatedbep53-range@^2.0.0