spotify-uri
Advanced tools
Comparing version 0.1.1 to 1.0.0
@@ -5,3 +5,3 @@ { | ||
"description": "Parse the various Spotify URI formats into Objects and back", | ||
"version": "0.1.0", | ||
"version": "1.0.0", | ||
"keywords": [ | ||
@@ -8,0 +8,0 @@ "spotify", |
@@ -0,7 +1,19 @@ | ||
1.0.0 / 2014-11-05 | ||
================== | ||
* use decodeURIComponent() instead of unescape() to decode parts (#3, stefanduberg) | ||
* add .travis.yml file | ||
* test: add two test cases with "special characters" | ||
* test: remove browser mocha tests | ||
* test: set up Travis-CI + Saucelabs cloud testing | ||
* README: add Saucelabs badge | ||
* README: use svg Travis-CI badge | ||
0.1.1 / 2013-09-13 | ||
================== | ||
- formatURI: fix the "starred" playlist case (#1) | ||
- formatURI: fix the user "playlist" case (#1) | ||
- formatURI: fix the "local" file case (#1) | ||
* formatURI: fix the "starred" playlist case (#1) | ||
* formatURI: fix the user "playlist" case (#1) | ||
* formatURI: fix the "local" file case (#1) | ||
@@ -11,6 +23,6 @@ 0.1.0 / 2013-06-01 | ||
- Add `formatURI()` function | ||
- Add `formatOpenURL()` function | ||
- Add `formatPlayURL()` function | ||
- Add `formatEmbedURL()` function | ||
* Add `formatURI()` function | ||
* Add `formatOpenURL()` function | ||
* Add `formatPlayURL()` function | ||
* Add `formatEmbedURL()` function | ||
@@ -20,3 +32,3 @@ 0.0.1 / 2013-05-25 | ||
- Initial release | ||
- Only a `parse()` function so far... | ||
* Initial release | ||
* Only a `parse()` function so far... |
{ | ||
"name": "spotify-uri", | ||
"version": "0.1.1", | ||
"version": "1.0.0", | ||
"description": "Parse the various Spotify URI formats into Objects and back", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "mocha --reporter spec test/test.js" | ||
"test": "make test" | ||
}, | ||
@@ -28,4 +28,5 @@ "repository": { | ||
"devDependencies": { | ||
"mocha": "~1.10.0" | ||
"mocha": "~1.10.0", | ||
"zuul": "~1.13.0" | ||
} | ||
} |
@@ -83,3 +83,3 @@ | ||
function decode (str) { | ||
return unescape(str).replace(/\+/g, ' '); | ||
return decodeURIComponent(str).replace(/\+/g, ' '); | ||
} |
@@ -5,2 +5,6 @@ spotify-uri | ||
[![Sauce Test Status](https://saucelabs.com/browser-matrix/spotify-uri.svg)](https://saucelabs.com/u/spotify-uri) | ||
[![Build Status](https://travis-ci.org/TooTallNate/spotify-uri.svg?branch=master)](https://travis-ci.org/TooTallNate/spotify-uri) | ||
Spotify URIs get passed around in a variety of flavors. This module parses them | ||
@@ -13,3 +17,3 @@ into a JavaScript object so you can work with the further. You can also convert | ||
Install for node.js using `npm`: | ||
Install for node.js or browserify using `npm`: | ||
@@ -16,0 +20,0 @@ ``` bash |
@@ -7,12 +7,4 @@ | ||
var assert = require('assert'); | ||
var parse; | ||
var parse = require('../'); | ||
try { | ||
// component | ||
parse = require('spotify-uri'); | ||
} catch (e) { | ||
// node.js | ||
parse = require('../'); | ||
} | ||
var formatURI = parse.formatURI; | ||
@@ -51,4 +43,16 @@ var formatOpenURL = parse.formatOpenURL; | ||
assert('search' == obj.type); | ||
assert('artist:häxor' == obj.query); | ||
assert('artist:häxor' == obj.query); | ||
}); | ||
it('should parse "encoded special characters" in URLs', function () { | ||
var url = 'http://open.spotify.com/user/hitradio%c3%b63'; | ||
var obj = parse(url); | ||
assert('user', obj.type); | ||
assert('hitradioö3', obj.user); | ||
}); | ||
it('should parse "special characters" in URLs', function () { | ||
var url = 'http://open.spotify.com/user/hitradioö63'; | ||
var obj = parse(url); | ||
assert('user', obj.type); | ||
assert('hitradioö3', obj.user); | ||
}); | ||
it('should parse "user" URLs', function () { | ||
@@ -135,4 +139,16 @@ var url = 'http://open.spotify.com/user/tootallnate'; | ||
assert('search' == obj.type); | ||
assert('artist:häxor' == obj.query); | ||
assert('artist:häxor' == obj.query); | ||
}); | ||
it('should parse "encoded special characters" in URIs', function () { | ||
var url = 'spotify:user:hitradio%c3%b63'; | ||
var obj = parse(url); | ||
assert('user', obj.type); | ||
assert('hitradioö3', obj.user); | ||
}); | ||
it('should parse "special characters" in URIs', function () { | ||
var url = 'spotify:user:hitradioö63'; | ||
var obj = parse(url); | ||
assert('user', obj.type); | ||
assert('hitradioö3', obj.user); | ||
}); | ||
it('should parse combined "search"', function () { | ||
@@ -139,0 +155,0 @@ var uri = 'spotify:search:genre:hip-hop+year:1980-1989'; |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1
130
0
24877
2
14
519
1