Comparing version 0.0.4 to 0.0.5
@@ -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; |
{ | ||
"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); | ||
}); |
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
65
45
7351
9