is-array-buffer
Advanced tools
Comparing version
@@ -8,2 +8,9 @@ # Changelog | ||
## [v3.0.1](https://github.com/fengyuanchen/is-array-buffer/compare/v3.0.0...v3.0.1) - 2023-01-05 | ||
### Commits | ||
- [Fix] in node 0.8, TAs do not coerce Uint8Arrays to an ArrayBuffer properly [`e488763`](https://github.com/fengyuanchen/is-array-buffer/commit/e48876346f446825dad619e55dcc830ed93f2853) | ||
- [Dev Deps] update `@ljharb/eslint-config`, `aud` [`8eebfa2`](https://github.com/fengyuanchen/is-array-buffer/commit/8eebfa21881f3a9fa5094f8c486f00e496658ea9) | ||
## [v3.0.0](https://github.com/fengyuanchen/is-array-buffer/compare/v2.0.0...v3.0.0) - 2023-01-04 | ||
@@ -10,0 +17,0 @@ |
@@ -6,2 +6,3 @@ 'use strict'; | ||
var GetIntrinsic = require('get-intrinsic'); | ||
var isTypedArray = require('is-typed-array'); | ||
@@ -36,3 +37,3 @@ var $ArrayBuffer = GetIntrinsic('ArrayBuffer', true); | ||
try { | ||
return (new $Float32Array(obj)).buffer === obj; | ||
return (new $Float32Array(obj)).buffer === obj && !isTypedArray(obj); | ||
} catch (e) { | ||
@@ -39,0 +40,0 @@ return false; |
{ | ||
"name": "is-array-buffer", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "Is this value a JS ArrayBuffer?", | ||
@@ -45,5 +45,6 @@ "main": "index.js", | ||
"devDependencies": { | ||
"@ljharb/eslint-config": "^21.0.0", | ||
"aud": "^2.0.1", | ||
"@ljharb/eslint-config": "^21.0.1", | ||
"aud": "^2.0.2", | ||
"auto-changelog": "^2.4.0", | ||
"available-typed-arrays": "^1.0.5", | ||
"es-value-fixtures": "^1.4.2", | ||
@@ -70,3 +71,4 @@ "eslint": "=8.8.0", | ||
"call-bind": "^1.0.2", | ||
"get-intrinsic": "^1.1.3" | ||
"get-intrinsic": "^1.1.3", | ||
"is-typed-array": "^1.1.10" | ||
}, | ||
@@ -73,0 +75,0 @@ "publishConfig": { |
@@ -7,2 +7,3 @@ 'use strict'; | ||
var v = require('es-value-fixtures'); | ||
var availableTypedArrays = require('available-typed-arrays')(); | ||
@@ -30,3 +31,13 @@ var isArrayBuffer = require('..'); | ||
t.test('Typed Arrays', { skip: availableTypedArrays.length === 0 }, function (st) { | ||
forEach(availableTypedArrays, function (TypedArray) { | ||
var ta = new global[TypedArray](0); | ||
st.equal(isArrayBuffer(ta.buffer), true, inspect(ta.buffer) + ', the TA\'s buffer, is an ArrayBuffer'); | ||
st.equal(isArrayBuffer(ta), false, inspect(ta) + ' is not an ArrayBuffer'); | ||
}); | ||
st.end(); | ||
}); | ||
t.end(); | ||
}); |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
11085
10.49%70
16.67%0
-100%3
50%13
8.33%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added