fetch-base64
Advanced tools
Comparing version 0.2.0 to 0.3.0
@@ -63,3 +63,3 @@ 'use strict'; | ||
isRemote: uriMatcher.isRemote, | ||
isLocal: () => !uriMatcher.isRemote(), | ||
isLocal: uriMatcher.isLocal, | ||
}; |
@@ -5,9 +5,16 @@ 'use strict'; | ||
function isRemote(path) { | ||
if (!path) { | ||
throw new Error('Required parameter path missing'); | ||
} | ||
return !!path.match(remoteRegex); | ||
} | ||
function isLocal(path) { | ||
return !isRemote(path); | ||
} | ||
module.exports = { | ||
isRemote: (path) => { | ||
if (!path) { | ||
throw new Error('Required parameter path missing'); | ||
} | ||
return !!path.match(remoteRegex); | ||
}, | ||
isRemote, | ||
isLocal, | ||
}; |
{ | ||
"name": "fetch-base64", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"dependencies": { | ||
@@ -5,0 +5,0 @@ "mime-db": { |
{ | ||
"name": "fetch-base64", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"description": "A node package to retrieve fetch local or remote images in base64 encoding.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -45,2 +45,8 @@ 'use strict'; | ||
}); | ||
describe('isLocal()', () => { | ||
it('should return the opposite of isRemote() for the same path', () => { | ||
assert.equal(uriMatcher.isRemote('nonRemote'), !uriMatcher.isLocal('nonRemote')); | ||
assert.equal(!uriMatcher.isRemote('http://remote.com'), uriMatcher.isLocal('http://remote.com')); | ||
}); | ||
}); | ||
}); |
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
23007
428