pouchdb-binary-utils
Advanced tools
Comparing version 6.0.7 to 6.1.0
@@ -5,2 +5,8 @@ 'use strict'; | ||
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } | ||
var bufferFrom = _interopDefault(require('buffer-from')); | ||
// ponyfill for Node <6 | ||
function thisAtob(str) { | ||
@@ -17,8 +23,10 @@ var base64 = new Buffer(str, 'base64'); | ||
function thisBtoa(str) { | ||
return new Buffer(str, 'binary').toString('base64'); | ||
return bufferFrom(str, 'binary').toString('base64'); | ||
} | ||
// ponyfill for Node <6 | ||
function typedBuffer(binString, buffType, type) { | ||
// buffType is either 'binary' or 'base64' | ||
var buff = new Buffer(binString, buffType); | ||
var buff = bufferFrom(binString, buffType); | ||
buff.type = type; // non-standard, but used for consistency with the browser | ||
@@ -25,0 +33,0 @@ return buff; |
{ | ||
"name": "pouchdb-binary-utils", | ||
"version": "6.0.7", | ||
"version": "6.1.0", | ||
"description": "PouchDB utilities for operating on binary strings and Buffers/Blobs.", | ||
@@ -25,3 +25,5 @@ "main": "./lib/index.js", | ||
}, | ||
"dependencies": {} | ||
"dependencies": { | ||
"buffer-from": "0.1.1" | ||
} | ||
} |
@@ -0,1 +1,3 @@ | ||
import bufferFrom from 'buffer-from'; // ponyfill for Node <6 | ||
function thisAtob(str) { | ||
@@ -12,3 +14,3 @@ var base64 = new Buffer(str, 'base64'); | ||
function thisBtoa(str) { | ||
return new Buffer(str, 'binary').toString('base64'); | ||
return bufferFrom(str, 'binary').toString('base64'); | ||
} | ||
@@ -19,2 +21,2 @@ | ||
thisBtoa as btoa | ||
}; | ||
}; |
@@ -0,4 +1,6 @@ | ||
import bufferFrom from 'buffer-from'; // ponyfill for Node <6 | ||
function typedBuffer(binString, buffType, type) { | ||
// buffType is either 'binary' or 'base64' | ||
var buff = new Buffer(binString, buffType); | ||
var buff = bufferFrom(binString, buffType); | ||
buff.type = type; // non-standard, but used for consistency with the browser | ||
@@ -5,0 +7,0 @@ return buff; |
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
27931
418
1
+ Addedbuffer-from@0.1.1
+ Addedattempt-x@1.1.3(transitive)
+ Addedbuffer-from@0.1.1(transitive)
+ Addedcached-constructors-x@1.0.2(transitive)
+ Addedhas-own-property-x@3.2.0(transitive)
+ Addedhas-symbol-support-x@1.4.2(transitive)
+ Addedhas-symbols@1.0.3(transitive)
+ Addedhas-to-string-tag-x@1.4.1(transitive)
+ Addedhas-tostringtag@1.0.2(transitive)
+ Addedinfinity-x@1.0.2(transitive)
+ Addedis-array-buffer-x@1.7.0(transitive)
+ Addedis-date-object@1.0.5(transitive)
+ Addedis-falsey-x@1.0.3(transitive)
+ Addedis-finite-x@3.0.4(transitive)
+ Addedis-function-x@3.3.0(transitive)
+ Addedis-index-x@1.1.0(transitive)
+ Addedis-nan-x@1.0.3(transitive)
+ Addedis-nil-x@1.4.2(transitive)
+ Addedis-object-like-x@1.7.1(transitive)
+ Addedis-primitive@2.0.03.0.1(transitive)
+ Addedis-string@1.0.7(transitive)
+ Addedis-symbol@1.0.4(transitive)
+ Addedlodash.isnull@3.0.0(transitive)
+ Addedmath-clamp-x@1.2.0(transitive)
+ Addedmath-sign-x@3.0.0(transitive)
+ Addedmax-safe-integer@1.0.1(transitive)
+ Addednan-x@1.0.2(transitive)
+ Addednormalize-space-x@3.0.0(transitive)
+ Addedobject-get-own-property-descriptor-x@3.2.0(transitive)
+ Addedparse-int-x@2.0.0(transitive)
+ Addedproperty-is-enumerable-x@1.1.0(transitive)
+ Addedreplace-comments-x@2.0.0(transitive)
+ Addedrequire-coercible-to-string-x@1.0.2(transitive)
+ Addedrequire-object-coercible-x@1.4.3(transitive)
+ Addedto-boolean-x@1.0.3(transitive)
+ Addedto-integer-x@3.0.0(transitive)
+ Addedto-number-x@2.0.0(transitive)
+ Addedto-object-x@1.5.0(transitive)
+ Addedto-primitive-x@1.1.0(transitive)
+ Addedto-property-key-x@2.0.2(transitive)
+ Addedto-string-symbols-supported-x@1.0.2(transitive)
+ Addedto-string-tag-x@1.4.3(transitive)
+ Addedto-string-x@1.4.5(transitive)
+ Addedtrim-left-x@3.0.0(transitive)
+ Addedtrim-right-x@3.0.0(transitive)
+ Addedtrim-x@3.0.0(transitive)
+ Addedvalidate.io-undefined@1.0.3(transitive)
+ Addedwhite-space-x@3.0.1(transitive)