normalize-shorthands
Advanced tools
Comparing version 0.1.4 to 0.1.5
@@ -110,6 +110,6 @@ | ||
if (file = uri.replace(/^\//, '')) { | ||
// index.js support | ||
// index support | ||
if (file.slice(-1) === '/') file += 'index.' + ext | ||
// must always be this extension! | ||
if (file.slice(-3) !== '.' + ext) file += '.' + ext | ||
if (file.slice(-1 - ext.length) !== '.' + ext) file += '.' + ext | ||
} | ||
@@ -116,0 +116,0 @@ |
{ | ||
"name": "normalize-shorthands", | ||
"description": "shorthand URIs for normalize", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "Jonathan Ong", |
24
test.js
@@ -60,2 +60,15 @@ | ||
// other extensions | ||
;[ | ||
['component/emitter@1', '/github/component/emitter/1/index.css'], | ||
['component/emitter@1/', '/github/component/emitter/1/index.css'], | ||
['component/emitter@1/index', '/github/component/emitter/1/index.css'], | ||
['component/emitter@1/index.css', '/github/component/emitter/1/index.css'], | ||
].forEach(function (pair) { | ||
assert.equal( | ||
shorthand(pair[0], 'css'), | ||
'https://nlz.io' + pair[1], | ||
pair[0] + ' !== ' + pair[1] + ', got ' + shorthand(pair[0], 'css')) | ||
}) | ||
// fragments -> shorthand | ||
@@ -83,13 +96,2 @@ ;[ | ||
// other extensions | ||
assert.equal( | ||
shorthand('component/emitter@1', 'css'), | ||
'https://nlz.io/github/component/emitter/1/index.css') | ||
assert.equal( | ||
shorthand('component/emitter@1/', 'css'), | ||
'https://nlz.io/github/component/emitter/1/index.css') | ||
assert.equal( | ||
shorthand('component/emitter@1/index', 'css'), | ||
'https://nlz.io/github/component/emitter/1/index.css') | ||
console.log('All tests pass!') |
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
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
9846
206