{"name":"typed-array-length","version":"1.0.8","description":"Robustly get the length of a Typed Array","main":"index.js","exports":{".":"./index.js","./package.json":"./package.json"},"types":"./index.d.ts","sideEffects":false,"scripts":{"prepack":"npmignore --auto --commentLines=autogenerated","prepublishOnly":"safe-publish-latest","prepublish":"not-in-publish || npm run prepublishOnly","pretest":"npm run lint","prelint":"evalmd README.md","lint":"eslint .","postlint":"tsc -p . && attw -P","tests-only":"nyc tape 'test/**/*.js'","test:harmony":"nyc node --harmony --es-staging test","test":"npm run tests-only && npm run test:harmony","posttest":"npx npm@'>=10.2' audit --production","version":"auto-changelog && git add CHANGELOG.md","postversion":"auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""},"repository":{"type":"git","url":"git+https://github.com/inspect-js/typed-array-length.git"},"keywords":["typed","array","length","robust","es","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array"],"author":{"name":"Jordan Harband","email":"ljharb@gmail.com"},"funding":{"url":"https://github.com/sponsors/ljharb"},"license":"MIT","bugs":{"url":"https://github.com/inspect-js/typed-array-length/issues"},"homepage":"https://github.com/inspect-js/typed-array-length#readme","devDependencies":{"@arethetypeswrong/cli":"^0.18.2","@ljharb/eslint-config":"^22.2.3","@ljharb/tsconfig":"^0.3.2","@types/call-bind":"^1.0.5","@types/for-each":"^0.3.3","@types/gopd":"^1.0.3","@types/is-callable":"^1.1.2","@types/make-arrow-function":"^1.2.2","@types/make-generator-function":"^2.0.3","@types/object-inspect":"^1.13.0","@types/tape":"^5.8.1","auto-changelog":"^2.5.1","eslint":"^10.4.0","evalmd":"^0.0.19","in-publish":"^2.0.1","is-callable":"^1.2.7","jiti":"^0.0.0","make-arrow-function":"^1.2.0","make-generator-function":"^2.1.0","npmignore":"^0.3.5","nyc":"^10.3.2","object-inspect":"^1.13.4","safe-publish-latest":"^2.0.0","tape":"^5.9.0","typescript":"next"},"auto-changelog":{"output":"CHANGELOG.md","template":"keepachangelog","unreleased":false,"commitLimit":false,"backfillLimit":false,"hideCredit":true},"dependencies":{"call-bind":"^1.0.9","for-each":"^0.3.5","gopd":"^1.2.0","is-typed-array":"^1.1.15","possible-typed-array-names":"^1.1.0","reflect.getprototypeof":"^1.0.10"},"testling":{"files":"test/index.js"},"publishConfig":{"ignore":[".github/workflows","types"]},"engines":{"node":">= 0.4"},"gitHead":"a010b13975273ff20a96947fe51ebf59d4c48cc7","_id":"typed-array-length@1.0.8","_nodeVersion":"26.2.0","_npmVersion":"11.13.0","dist":{"integrity":"sha512-phPGCwqr2+Qo0fwniCE8e4pKnGu/yFb5nD5Y8bf0EEeiI5GklnACYA9GFy/DrAeRrKHXvHn+1SUsOWgJp6RO+g==","shasum":"0b70e982c9e9dafe2def6d6458ff4b3f2d2b6d70","tarball":"http://registry-npm.ywwl.com/typed-array-length/download/typed-array-length-1.0.8.tgz","fileCount":11,"unpackedSize":25852,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIFZTrH/2ymYp6ifCdQgGSvcAMJWNLs0qFpXWSmG4ncXzAiEAilHZVRwOe88GCUicswq56KSGRvi+tW7E17t2cG781JQ="}],"size":8528,"noattachment":false,"key":"/typed-array-length/-/typed-array-length-1.0.8.tgz"},"_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"directories":{},"maintainers":[{"name":"ljharb","email":"ljharb@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/typed-array-length_1.0.8_1779984643579_0.7811178887292867"},"_hasShrinkwrap":false,"readme":"# typed-array-length <sup>[![Version Badge][2]][1]</sup>\n\n[![dependency status][5]][6]\n[![dev dependency status][7]][8]\n[![License][license-image]][license-url]\n[![Downloads][downloads-image]][downloads-url]\n\n[![npm badge][11]][1]\n\nRobustly get the length of a Typed Array, or `false` if it is not a Typed Array. Works cross-realm, in every engine, even if the `length` property is overridden.\n\n## Example\n\n```js\nvar typedArrayLength = require('typed-array-length');\nvar assert = require('assert');\n\nassert.equal(false, typedArrayLength(undefined));\nassert.equal(false, typedArrayLength(null));\nassert.equal(false, typedArrayLength(false));\nassert.equal(false, typedArrayLength(true));\nassert.equal(false, typedArrayLength([]));\nassert.equal(false, typedArrayLength({}));\nassert.equal(false, typedArrayLength(/a/g));\nassert.equal(false, typedArrayLength(new RegExp('a', 'g')));\nassert.equal(false, typedArrayLength(new Date()));\nassert.equal(false, typedArrayLength(42));\nassert.equal(false, typedArrayLength(NaN));\nassert.equal(false, typedArrayLength(Infinity));\nassert.equal(false, typedArrayLength(new Number(42)));\nassert.equal(false, typedArrayLength('foo'));\nassert.equal(false, typedArrayLength(Object('foo')));\nassert.equal(false, typedArrayLength(function () {}));\nassert.equal(false, typedArrayLength(function* () {}));\nassert.equal(false, typedArrayLength(x => x * x));\nassert.equal(false, typedArrayLength([]));\n\nassert.equal(1, typedArrayLength(new Int8Array(1)));\nassert.equal(2, typedArrayLength(new Uint8Array(2)));\nassert.equal(3, typedArrayLength(new Uint8ClampedArray(3)));\nassert.equal(4, typedArrayLength(new Int16Array(4)));\nassert.equal(5, typedArrayLength(new Uint16Array(5)));\nassert.equal(6, typedArrayLength(new Int32Array(6)));\nassert.equal(7, typedArrayLength(new Uint32Array(7)));\nassert.equal(8, typedArrayLength(new Float32Array(8)));\nassert.equal(9, typedArrayLength(new Float64Array(9)));\nassert.equal(10, typedArrayLength(new BigInt64Array(10)));\nassert.equal(11, typedArrayLength(new BigUint64Array(11)));\n```\n\n## Tests\nSimply clone the repo, `npm install`, and run `npm test`\n\n[1]: https://npmjs.org/package/typed-array-length\n[2]: https://versionbadg.es/inspect-js/typed-array-length.svg\n[5]: https://david-dm.org/inspect-js/typed-array-length.svg\n[6]: https://david-dm.org/inspect-js/typed-array-length\n[7]: https://david-dm.org/inspect-js/typed-array-length/dev-status.svg\n[8]: https://david-dm.org/inspect-js/typed-array-length#info=devDependencies\n[11]: https://nodei.co/npm/typed-array-length.png?downloads=true&stars=true\n[license-image]: http://img.shields.io/npm/l/typed-array-length.svg\n[license-url]: LICENSE\n[downloads-image]: http://img.shields.io/npm/dm/typed-array-length.svg\n[downloads-url]: http://npm-stat.com/charts.html?package=typed-array-length\n","publish_time":1779984643722,"_cnpm_publish_time":1779984643722,"dist-tags":{"latest":"1.0.8"}}