{"_id":"typed-array-byte-offset@1.0.5","bugs":{"url":"https://github.com/inspect-js/typed-array-byte-offset/issues"},"dist":{"shasum":"c076d6a0db563933154b3c442204b614bf0d7b15","tarball":"http://registry-npm.ywwl.com/typed-array-byte-offset/download/typed-array-byte-offset-1.0.5.tgz","integrity":"sha512-0FHJvLPqZ7KJzp17O13jfsAjsqazgrxBu2zEK95PmUz8lv2+GjRuxUInCr2Rk9Dms3ihN21zJ929ZO43yJ95QQ==","fileCount":11,"unpackedSize":21464,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDe0V7oF+e98akHAoWJzAin9jR0sirC9L38+cG37Oy9xwIgCLkMYMk5zX14fY44HRZUPu30dwgMLYfnBcforaMZesc="}],"size":7136,"noattachment":false,"key":"/typed-array-byte-offset/-/typed-array-byte-offset-1.0.5.tgz"},"main":"index.js","name":"typed-array-byte-offset","types":"./index.d.ts","author":{"name":"Jordan Harband","email":"ljharb@gmail.com"},"engines":{"node":">= 0.4"},"exports":{".":"./index.js","./package.json":"./package.json"},"funding":{"url":"https://github.com/sponsors/ljharb"},"gitHead":"8a6722008695eaa2497519907e0bfc783be26c9d","license":"MIT","scripts":{"lint":"eslint .","test":"npm run tests-only","prelint":"evalmd README.md","prepack":"npmignore --auto --commentLines=autogenerated","pretest":"npm run lint","version":"auto-changelog && git add CHANGELOG.md","postlint":"tsc -p . && attw -P","posttest":"npx npm@'>=10.2' audit --production","prepublish":"not-in-publish || npm run prepublishOnly","tests-only":"nyc tape 'test/**/*.js'","postversion":"auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"","dependencies":"node -p \"process.env.npm_command\" | npx \"dt-clean@^1.2.2\" --auto","prepublishOnly":"safe-publish-latest"},"version":"1.0.5","_npmUser":{"name":"ljharb","email":"ljharb@gmail.com","approver":{"name":"ljharb","email":"ljharb@gmail.com"}},"homepage":"https://github.com/inspect-js/typed-array-byte-offset#readme","keywords":["typed","array","byteOffset","byte","offset","robust","es","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"],"testling":{"files":"test/index.js"},"repository":{"url":"git+https://github.com/inspect-js/typed-array-byte-offset.git","type":"git"},"_npmVersion":"11.19.1","description":"Robustly get the byte offset of a Typed Array","directories":{},"maintainers":[{"name":"ljharb","email":"ljharb@gmail.com"}],"sideEffects":false,"_nodeVersion":"26.9.0","dependencies":{"gopd":"^1.2.0","for-each":"^0.3.5","call-bind":"^1.0.9","is-typed-array":"^1.1.15","available-typed-arrays":"^1.0.7","reflect.getprototypeof":"^1.0.10"},"publishConfig":{"ignore":[".github/workflows","types"]},"auto-changelog":{"output":"CHANGELOG.md","template":"keepachangelog","hideCredit":true,"unreleased":false,"commitLimit":false,"backfillLimit":false},"devDependencies":{"nyc":"^10.3.2","jiti":"^0.0.0","tape":"^5.10.2","eslint":"^10.10.0","evalmd":"^0.0.22","npmignore":"^0.3.5","in-publish":"^2.0.1","typescript":"next","@types/node":"^24.13.5","is-callable":"^1.2.7","auto-changelog":"^2.6.1","object-inspect":"^1.13.4","@ljharb/tsconfig":"^0.3.2","@types/call-bind":"^1.0.5","@types/is-callable":"^1.1.2","make-arrow-function":"^1.2.0","safe-publish-latest":"^2.0.0","@arethetypeswrong/cli":"^0.18.5","@ljharb/eslint-config":"^22.2.4","@types/object-inspect":"^1.13.0","make-generator-function":"^2.1.0","@types/make-arrow-function":"^1.2.2","possible-typed-array-names":"^1.1.0","@types/make-generator-function":"^2.0.3"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/typed-array-byte-offset_1.0.5_1789624817955_0.5923973590068954"},"_hasShrinkwrap":false,"readme":"# typed-array-byte-offset <sup>[![Version Badge][npm-version-svg]][package-url]</sup>\n\n[![github actions][actions-image]][actions-url]\n[![coverage][codecov-image]][codecov-url]\n[![License][license-image]][license-url]\n[![Downloads][downloads-image]][downloads-url]\n\n[![npm badge][npm-badge-png]][package-url]\n\nRobustly get the byte offset of a Typed Array, or `false` if it is not a Typed Array. Works cross-realm, in every engine, even if the `byteOffset` property is overridden.\n\n## Example\n\n```js\nvar typedArrayByteOffset = require('typed-array-byte-offset');\nvar assert = require('assert');\n\nassert.equal(false, typedArrayByteOffset(undefined));\nassert.equal(false, typedArrayByteOffset(null));\nassert.equal(false, typedArrayByteOffset(false));\nassert.equal(false, typedArrayByteOffset(true));\nassert.equal(false, typedArrayByteOffset([]));\nassert.equal(false, typedArrayByteOffset({}));\nassert.equal(false, typedArrayByteOffset(/a/g));\nassert.equal(false, typedArrayByteOffset(new RegExp('a', 'g')));\nassert.equal(false, typedArrayByteOffset(new Date()));\nassert.equal(false, typedArrayByteOffset(42));\nassert.equal(false, typedArrayByteOffset(NaN));\nassert.equal(false, typedArrayByteOffset(Infinity));\nassert.equal(false, typedArrayByteOffset(new Number(42)));\nassert.equal(false, typedArrayByteOffset('foo'));\nassert.equal(false, typedArrayByteOffset(Object('foo')));\nassert.equal(false, typedArrayByteOffset(function () {}));\nassert.equal(false, typedArrayByteOffset(function* () {}));\nassert.equal(false, typedArrayByteOffset(x => x * x));\nassert.equal(false, typedArrayByteOffset([]));\n\nconst buffer = new ArrayBuffer(32);\n\nassert.equal(8, typedArrayByteOffset(new Int8Array(buffer, 8)));\nassert.equal(8, typedArrayByteOffset(new Uint8Array(buffer, 8)));\nassert.equal(8, typedArrayByteOffset(new Uint8ClampedArray(buffer, 8)));\nassert.equal(4, typedArrayByteOffset(new Int16Array(buffer, 4)));\nassert.equal(4, typedArrayByteOffset(new Uint16Array(buffer, 4)));\nassert.equal(8, typedArrayByteOffset(new Int32Array(buffer, 8)));\nassert.equal(8, typedArrayByteOffset(new Uint32Array(buffer, 8)));\nassert.equal(16, typedArrayByteOffset(new Float32Array(buffer, 16)));\nassert.equal(16, typedArrayByteOffset(new Float64Array(buffer, 16)));\nassert.equal(16, typedArrayByteOffset(new BigInt64Array(buffer, 16)));\nassert.equal(16, typedArrayByteOffset(new BigUint64Array(buffer, 16)));\n```\n\n## Tests\nSimply clone the repo, `npm install`, and run `npm test`\n\n[package-url]: https://npmjs.org/package/typed-array-byte-offset\n[npm-version-svg]: https://versionbadg.es/inspect-js/typed-array-byte-offset.svg\n[deps-svg]: https://david-dm.org/inspect-js/typed-array-byte-offset.svg\n[deps-url]: https://david-dm.org/inspect-js/typed-array-byte-offset\n[dev-deps-svg]: https://david-dm.org/inspect-js/typed-array-byte-offset/dev-status.svg\n[dev-deps-url]: https://david-dm.org/inspect-js/typed-array-byte-offset#info=devDependencies\n[npm-badge-png]: https://nodei.co/npm/typed-array-byte-offset.png?downloads=true&stars=true\n[license-image]: https://img.shields.io/npm/l/typed-array-byte-offset.svg\n[license-url]: LICENSE\n[downloads-image]: https://img.shields.io/npm/dm/typed-array-byte-offset.svg\n[downloads-url]: https://npm-stat.com/charts.html?package=typed-array-byte-offset\n[codecov-image]: https://codecov.io/gh/inspect-js/typed-array-byte-offset/branch/main/graphs/badge.svg\n[codecov-url]: https://app.codecov.io/gh/inspect-js/typed-array-byte-offset/\n[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/typed-array-byte-offset\n[actions-url]: https://github.com/inspect-js/typed-array-byte-offset/actions\n","publish_time":1789624818062,"_cnpm_publish_time":1789624818062,"dist-tags":{"latest":"1.0.5"}}