Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

is-base64

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-base64 - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

3

is-base64.js

@@ -8,2 +8,5 @@ (function(root) {

}
if (opts.hasOwnProperty('allowBlank') && !opts.allowBlank && v === '') {
return false
}

@@ -10,0 +13,0 @@ var regex = /^(data:\w+\/[a-zA-Z\+\-\.]+;base64,)?(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/gi;

2

package.json
{
"name": "is-base64",
"version": "0.0.4",
"version": "0.0.5",
"description": "Predicate that returns true if base64 string.",

@@ -5,0 +5,0 @@ "main": "is-base64.js",

@@ -30,2 +30,3 @@ # is-base64

console.log(isBase64('')); // true
console.log(isBase64('', {allowBlank: false})); // false
```

@@ -32,0 +33,0 @@

@@ -5,6 +5,4 @@ var test = require('tape');

test('isBase64', function (t) {
t.plan(18);
t.plan(19);
t.equal(isBase64(''), true);
var pngString = 'iVBORw0KGgoAAAANSUhEUgAABQAAAALQAQMAAAD1s08VAAAAA1BMVEX/AAAZ4gk3AAAAh0lEQVR42u3BMQEAAADCoPVPbQlPoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB4GsTfAAGc95RKAAAAAElFTkSuQmCC';

@@ -40,2 +38,4 @@ var pngStringWithMime = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABQAAAALQAQMAAAD1s08VAAAAA1BMVEX/AAAZ4gk3AAAAh0lEQVR42u3BMQEAAADCoPVPbQlPoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB4GsTfAAGc95RKAAAAAElFTkSuQmCC';

t.equal(isBase64('uuLMhh==', {paddingRequired: true}), true);
t.equal(isBase64(''), true);
t.equal(isBase64('', {allowBlank: false}), false);
});
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