Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

typed-array-byte-offset

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

typed-array-byte-offset - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

14

CHANGELOG.md

@@ -8,2 +8,16 @@ # Changelog

## [v1.0.3](https://github.com/inspect-js/typed-array-byte-offset/compare/v1.0.2...v1.0.3) - 2024-11-21
### Fixed
- [Fix] avoid relying on `__proto__` accessor [`#4`](https://github.com/inspect-js/typed-array-byte-offset/issues/4)
### Commits
- [types] use shared config [`10b0823`](https://github.com/inspect-js/typed-array-byte-offset/commit/10b0823ecc13b95920cfa8f27fe61af5678fb67b)
- [actions] split out node 10-20, and 20+ [`11554a9`](https://github.com/inspect-js/typed-array-byte-offset/commit/11554a96ca11b85c7ad87118e1d811bfde2b9f32)
- [Dev Deps] update `@arethetypeswrong/cli`, `@ljharb/eslint-config`, `@types/object-inspect`, `auto-changelog`, `object-inspect`, `tape` [`c39dd06`](https://github.com/inspect-js/typed-array-byte-offset/commit/c39dd06d2868a724463722ff2f416b5c41171140)
- [Tests] run tsc and `@arethetypeswrong/cli` in CI [`0b984aa`](https://github.com/inspect-js/typed-array-byte-offset/commit/0b984aa64c86f4bcb476b716cdd16d67c39b68ca)
- [Tests] replace `aud` with `npm audit` [`512b59d`](https://github.com/inspect-js/typed-array-byte-offset/commit/512b59df0e567592282795bfec331193d828f2fc)
## [v1.0.2](https://github.com/inspect-js/typed-array-byte-offset/compare/v1.0.1...v1.0.2) - 2024-02-20

@@ -10,0 +24,0 @@

7

index.js

@@ -5,2 +5,3 @@ 'use strict';

var callBind = require('call-bind');
var gPO = require('reflect.getprototypeof/polyfill')();

@@ -14,3 +15,2 @@ var typedArrays = require('available-typed-arrays')();

var getters = {};
var hasProto = require('has-proto')();

@@ -30,5 +30,4 @@ var gOPD = require('gopd');

var descriptor = gOPD(Proto, 'byteOffset');
if (!descriptor && hasProto) {
// @ts-expect-error hush, TS, every object has a dunder proto
var superProto = Proto.__proto__; // eslint-disable-line no-proto
if (!descriptor) {
var superProto = gPO(Proto);
// @ts-expect-error TS can't guarantee the callback is invoked sync

@@ -35,0 +34,0 @@ descriptor = gOPD(superProto, 'byteOffset');

{
"name": "typed-array-byte-offset",
"version": "1.0.2",
"version": "1.0.3",
"description": "Robustly get the byte offset of a Typed Array",

@@ -19,5 +19,6 @@ "main": "index.js",

"lint": "eslint --ext=js,mjs .",
"postlint": "tsc -p . && attw -P",
"tests-only": "nyc tape 'test/**/*.js'",
"test": "npm run tests-only",
"posttest": "aud --production",
"posttest": "npx npm@'>=10.2' audit --production",
"version": "auto-changelog && git add CHANGELOG.md",

@@ -65,7 +66,11 @@ "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""

"has-proto": "^1.0.3",
"is-typed-array": "^1.1.13"
"is-typed-array": "^1.1.13",
"reflect.getprototypeof": "^1.0.6"
},
"devDependencies": {
"@ljharb/eslint-config": "^21.1.0",
"@arethetypeswrong/cli": "^0.17.0",
"@ljharb/eslint-config": "^21.1.1",
"@ljharb/tsconfig": "^0.2.0",
"@types/call-bind": "^1.0.5",
"@types/es-abstract": "^1.17.9",
"@types/for-each": "^0.3.3",

@@ -76,6 +81,5 @@ "@types/gopd": "^1.0.3",

"@types/make-generator-function": "^2.0.3",
"@types/object-inspect": "^1.8.4",
"@types/object-inspect": "^1.13.0",
"@types/tape": "^5.6.4",
"aud": "^2.0.4",
"auto-changelog": "^2.4.0",
"auto-changelog": "^2.5.0",
"eslint": "=8.8.0",

@@ -89,7 +93,7 @@ "evalmd": "^0.0.19",

"nyc": "^10.3.2",
"object-inspect": "^1.13.1",
"object-inspect": "^1.13.3",
"possible-typed-array-names": "^1.0.0",
"safe-publish-latest": "^2.0.0",
"tape": "^5.7.5",
"typescript": "^5.4.0-dev.20240219"
"tape": "^5.9.0",
"typescript": "next"
},

@@ -112,5 +116,6 @@ "engines": {

"ignore": [
".github/workflows"
".github/workflows",
"types"
]
}
}

@@ -70,2 +70,3 @@ 'use strict';

if (isCallable(TypedArray)) {
// @ts-expect-error hush, TS, TAs can take an optional byte offset arg
var arr = new TypedArray(buffer, byteOffset);

@@ -72,0 +73,0 @@ t.equal(typedArrayByteOffset(arr), byteOffset, 'new ' + typedArray + '(new ArrayBuffer(' + length + '), ' + byteOffset + ') is typed array of byte offset ' + byteOffset);

{
"compilerOptions": {
/* Visit https://aka.ms/tsconfig to read more about this file */
/* Projects */
/* Language and Environment */
"target": "ESNext", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
"useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
/* Modules */
"module": "commonjs", /* Specify what module code is generated. */
// "rootDir": "./", /* Specify the root folder within your source files. */
// "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
"typeRoots": ["types"], /* Specify multiple folders that act like './node_modules/@types'. */
"resolveJsonModule": true, /* Enable importing .json files. */
// "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */
/* JavaScript Support */
"allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
"checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
"maxNodeModuleJsDepth": 0, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
/* Emit */
"declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
"declarationMap": true, /* Create sourcemaps for d.ts files. */
"noEmit": true, /* Disable emitting files from a compilation. */
/* Interop Constraints */
"allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
/* Type Checking */
"strict": true, /* Enable all strict type-checking options. */
/* Completeness */
//"skipLibCheck": true /* Skip type checking all .d.ts files. */
},
"exclude": [
"coverage"
]
"extends": "@ljharb/tsconfig",
"compilerOptions": {
"target": "ES2021",
"maxNodeModuleJsDepth": 0,
},
"exclude": [
"coverage",
],
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc