typed-array-byte-offset
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -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 @@ |
@@ -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", | ||
], | ||
} |
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
18114
7
26
160
+ Addedarray-buffer-byte-length@1.0.1(transitive)
+ Addedarraybuffer.prototype.slice@1.0.3(transitive)
+ Addeddata-view-buffer@1.0.1(transitive)
+ Addeddata-view-byte-length@1.0.1(transitive)
+ Addeddata-view-byte-offset@1.0.0(transitive)
+ Addeddefine-properties@1.2.1(transitive)
+ Addedes-abstract@1.23.5(transitive)
+ Addedes-object-atoms@1.0.0(transitive)
+ Addedes-set-tostringtag@2.0.3(transitive)
+ Addedes-to-primitive@1.2.1(transitive)
+ Addedfunction.prototype.name@1.1.6(transitive)
+ Addedfunctions-have-names@1.2.3(transitive)
+ Addedget-symbol-description@1.0.2(transitive)
+ Addedglobalthis@1.0.4(transitive)
+ Addedhas-bigints@1.0.2(transitive)
+ Addedinternal-slot@1.0.7(transitive)
+ Addedis-array-buffer@3.0.4(transitive)
+ Addedis-async-function@2.0.0(transitive)
+ Addedis-bigint@1.0.4(transitive)
+ Addedis-boolean-object@1.1.2(transitive)
+ Addedis-data-view@1.0.1(transitive)
+ Addedis-date-object@1.0.5(transitive)
+ Addedis-finalizationregistry@1.1.0(transitive)
+ Addedis-generator-function@1.0.10(transitive)
+ Addedis-map@2.0.3(transitive)
+ Addedis-negative-zero@2.0.3(transitive)
+ Addedis-number-object@1.0.7(transitive)
+ Addedis-regex@1.1.4(transitive)
+ Addedis-set@2.0.3(transitive)
+ Addedis-shared-array-buffer@1.0.3(transitive)
+ Addedis-string@1.0.7(transitive)
+ Addedis-symbol@1.0.4(transitive)
+ Addedis-weakmap@2.0.2(transitive)
+ Addedis-weakref@1.0.2(transitive)
+ Addedis-weakset@2.0.3(transitive)
+ Addedisarray@2.0.5(transitive)
+ Addedobject-inspect@1.13.3(transitive)
+ Addedobject-keys@1.1.1(transitive)
+ Addedobject.assign@4.1.5(transitive)
+ Addedreflect.getprototypeof@1.0.7(transitive)
+ Addedregexp.prototype.flags@1.5.3(transitive)
+ Addedsafe-array-concat@1.1.2(transitive)
+ Addedsafe-regex-test@1.0.3(transitive)
+ Addedset-function-name@2.0.2(transitive)
+ Addedside-channel@1.0.6(transitive)
+ Addedstring.prototype.trim@1.2.9(transitive)
+ Addedstring.prototype.trimend@1.0.8(transitive)
+ Addedstring.prototype.trimstart@1.0.8(transitive)
+ Addedtyped-array-buffer@1.0.2(transitive)
+ Addedtyped-array-byte-length@1.0.1(transitive)
+ Addedtyped-array-length@1.0.7(transitive)
+ Addedunbox-primitive@1.0.2(transitive)
+ Addedwhich-boxed-primitive@1.0.2(transitive)
+ Addedwhich-builtin-type@1.2.0(transitive)
+ Addedwhich-collection@1.0.2(transitive)