Comparing version 1.3.1 to 1.4.0
@@ -33,2 +33,11 @@ const ascii = require('./lib/ascii') | ||
function isEncoding (encoding) { | ||
try { | ||
codecFor(encoding) | ||
return true | ||
} catch { | ||
return false | ||
} | ||
} | ||
function alloc (size, fill, encoding) { | ||
@@ -311,2 +320,3 @@ const buffer = new Uint8Array(size) | ||
isBuffer, | ||
isEncoding, | ||
alloc, | ||
@@ -313,0 +323,0 @@ allocUnsafe, |
@@ -5,2 +5,6 @@ function isBuffer (value) { | ||
function isEncoding (encoding) { | ||
return Buffer.isEncoding(encoding) | ||
} | ||
function alloc (size, fill, encoding) { | ||
@@ -73,2 +77,3 @@ return Buffer.alloc(size, fill, encoding) | ||
isBuffer, | ||
isEncoding, | ||
alloc, | ||
@@ -75,0 +80,0 @@ allocUnsafe, |
{ | ||
"name": "b4a", | ||
"version": "1.3.1", | ||
"version": "1.4.0", | ||
"description": "Bridging the gap between buffers and typed arrays", | ||
"main": "index.js", | ||
"files": [ | ||
"browser.js", | ||
"index.js", | ||
"lib" | ||
], | ||
"browser": { | ||
@@ -7,0 +12,0 @@ "./index.js": "./browser.js" |
@@ -19,2 +19,6 @@ # Buffer for Array | ||
#### `b4a.isEncoding(encoding)` | ||
See https://nodejs.org/api/buffer.html#static-method-bufferisencodingencoding | ||
#### `b4a.alloc(size[, fill[, encoding]])` | ||
@@ -86,3 +90,3 @@ | ||
Convert a buffer to its canonical representation. In Node.js, the canonical representation is a `Buffer`. In the browser, the canonical reprensetation is a `Uint8Array`. | ||
Convert a buffer to its canonical representation. In Node.js, the canonical representation is a `Buffer`. In the browser, the canonical representation is a `Uint8Array`. | ||
@@ -89,0 +93,0 @@ #### `b4a.toString([encoding[, start[, end]]])` |
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
102
20741
10
592