Socket
Socket
Sign inDemoInstall

fetch-base64

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fetch-base64 - npm Package Compare versions

Comparing version 0.2.0 to 0.3.0

2

index.js

@@ -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'));
});
});
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc