inital
This commit is contained in:
17
node_modules/data-view-byte-length/.eslintrc
generated
vendored
Normal file
17
node_modules/data-view-byte-length/.eslintrc
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"root": true,
|
||||
|
||||
"extends": "@ljharb",
|
||||
|
||||
"globals": {
|
||||
"DataView": false,
|
||||
},
|
||||
|
||||
"rules": {
|
||||
"new-cap": ["error", {
|
||||
"capIsNewExceptions": [
|
||||
"GetIntrinsic",
|
||||
],
|
||||
}],
|
||||
},
|
||||
}
|
12
node_modules/data-view-byte-length/.github/FUNDING.yml
generated
vendored
Normal file
12
node_modules/data-view-byte-length/.github/FUNDING.yml
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: [ljharb]
|
||||
patreon: # Replace with a single Patreon username
|
||||
open_collective: # Replace with a single Open Collective username
|
||||
ko_fi: # Replace with a single Ko-fi username
|
||||
tidelift: npm/data-view-byte-length
|
||||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||
liberapay: # Replace with a single Liberapay username
|
||||
issuehunt: # Replace with a single IssueHunt username
|
||||
otechie: # Replace with a single Otechie username
|
||||
custom: # Replace with a single custom sponsorship URL
|
13
node_modules/data-view-byte-length/.nycrc
generated
vendored
Normal file
13
node_modules/data-view-byte-length/.nycrc
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"all": true,
|
||||
"check-coverage": false,
|
||||
"reporter": ["text-summary", "text", "html", "json"],
|
||||
"lines": 86,
|
||||
"statements": 85.93,
|
||||
"functions": 82.43,
|
||||
"branches": 76.06,
|
||||
"exclude": [
|
||||
"coverage",
|
||||
"test"
|
||||
]
|
||||
}
|
24
node_modules/data-view-byte-length/CHANGELOG.md
generated
vendored
Normal file
24
node_modules/data-view-byte-length/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
# Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [v1.0.1](https://github.com/ljharb/data-view-byte-length/compare/v1.0.0...v1.0.1) - 2024-03-08
|
||||
|
||||
### Commits
|
||||
|
||||
- [types] use shared tsconfig [`0d5873c`](https://github.com/ljharb/data-view-byte-length/commit/0d5873c9fddd413bacbb3a2c32e7e1a7f1f5bd2c)
|
||||
- [Dev Deps] update `@arethetypeswrong/cli`, `tape` [`13c1eaf`](https://github.com/ljharb/data-view-byte-length/commit/13c1eafea562993c7d15a450e86d2ee7a1aa8299)
|
||||
- [patch] fix function name [`a061e7b`](https://github.com/ljharb/data-view-byte-length/commit/a061e7b457f53bdc39716dacdddbe558ee790745)
|
||||
- [Deps] update `call-bind` [`6603851`](https://github.com/ljharb/data-view-byte-length/commit/6603851eef423c5762841221f97abfdc905c8bde)
|
||||
|
||||
## v1.0.0 - 2024-03-04
|
||||
|
||||
### Commits
|
||||
|
||||
- Initial implementation, tests, readme, types [`79ad058`](https://github.com/ljharb/data-view-byte-length/commit/79ad058a73a4f8425e8ad034211dfc39e643dc86)
|
||||
- Initial commit [`1a11313`](https://github.com/ljharb/data-view-byte-length/commit/1a113138783a815f66fd000a9f9c89fdbe8c98fb)
|
||||
- npm init [`aac0108`](https://github.com/ljharb/data-view-byte-length/commit/aac010820b20b8604d33e5a74b51591f19f553e2)
|
||||
- Only apps should have lockfiles [`cdf1a15`](https://github.com/ljharb/data-view-byte-length/commit/cdf1a15d4c201137982e1e703d56a42582c6d246)
|
21
node_modules/data-view-byte-length/LICENSE
generated
vendored
Normal file
21
node_modules/data-view-byte-length/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2024 Jordan Harband
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
43
node_modules/data-view-byte-length/README.md
generated
vendored
Normal file
43
node_modules/data-view-byte-length/README.md
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
# data-view-byte-length <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
|
||||
|
||||
[![github actions][actions-image]][actions-url]
|
||||
[![coverage][codecov-image]][codecov-url]
|
||||
[![License][license-image]][license-url]
|
||||
[![Downloads][downloads-image]][downloads-url]
|
||||
|
||||
[![npm badge][npm-badge-png]][package-url]
|
||||
|
||||
Get the `byteLength` out of a DataView, robustly.
|
||||
|
||||
This will work in node <= 0.10 and < 0.11.4, where there's no prototype accessor, only a nonconfigurable own property.
|
||||
It will also work in modern engines where `DataView.prototype.byteLength` has been deleted after this module has loaded.
|
||||
|
||||
## Example
|
||||
|
||||
```js
|
||||
const dataViewByteLength = require('data-view-byte-length');
|
||||
const assert = require('assert');
|
||||
|
||||
const ab = new ArrayBuffer(42);
|
||||
const dv = new DataView(ab);
|
||||
assert.equal(dataViewByteLength(dv), 42);
|
||||
```
|
||||
|
||||
## Tests
|
||||
Simply clone the repo, `npm install`, and run `npm test`
|
||||
|
||||
[package-url]: https://npmjs.org/package/data-view-byte-length
|
||||
[npm-version-svg]: https://versionbadg.es/ljharb/data-view-byte-length.svg
|
||||
[deps-svg]: https://david-dm.org/ljharb/data-view-byte-length.svg
|
||||
[deps-url]: https://david-dm.org/ljharb/data-view-byte-length
|
||||
[dev-deps-svg]: https://david-dm.org/ljharb/data-view-byte-length/dev-status.svg
|
||||
[dev-deps-url]: https://david-dm.org/ljharb/data-view-byte-length#info=devDependencies
|
||||
[npm-badge-png]: https://nodei.co/npm/data-view-byte-length.png?downloads=true&stars=true
|
||||
[license-image]: https://img.shields.io/npm/l/data-view-byte-length.svg
|
||||
[license-url]: LICENSE
|
||||
[downloads-image]: https://img.shields.io/npm/dm/data-view-byte-length.svg
|
||||
[downloads-url]: https://npm-stat.com/charts.html?package=data-view-byte-length
|
||||
[codecov-image]: https://codecov.io/gh/ljharb/data-view-byte-length/branch/main/graphs/badge.svg
|
||||
[codecov-url]: https://app.codecov.io/gh/ljharb/data-view-byte-length/
|
||||
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/data-view-byte-length
|
||||
[actions-url]: https://github.com/ljharb/data-view-byte-length/actions
|
4
node_modules/data-view-byte-length/index.d.ts
generated
vendored
Normal file
4
node_modules/data-view-byte-length/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
declare function dataViewByteLength(value: DataView): number;
|
||||
declare function dataViewByteLength(value: unknown): never;
|
||||
|
||||
export = dataViewByteLength;
|
19
node_modules/data-view-byte-length/index.js
generated
vendored
Normal file
19
node_modules/data-view-byte-length/index.js
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
'use strict';
|
||||
|
||||
var $TypeError = require('es-errors/type');
|
||||
|
||||
var callBound = require('call-bind/callBound');
|
||||
|
||||
var $dataViewByteLength = callBound('DataView.prototype.byteLength', true);
|
||||
|
||||
var isDataView = require('is-data-view');
|
||||
|
||||
// node <= 0.10, < 0.11.4 has a nonconfigurable own property instead of a prototype getter
|
||||
/** @type {import('.')} */
|
||||
module.exports = $dataViewByteLength || function byteLength(x) {
|
||||
if (!isDataView(x)) {
|
||||
throw new $TypeError('not a DataView');
|
||||
}
|
||||
|
||||
return x.byteLength;
|
||||
};
|
94
node_modules/data-view-byte-length/package.json
generated
vendored
Normal file
94
node_modules/data-view-byte-length/package.json
generated
vendored
Normal file
@@ -0,0 +1,94 @@
|
||||
{
|
||||
"name": "data-view-byte-length",
|
||||
"version": "1.0.1",
|
||||
"description": "Get the byteLength out of a DataView, robustly.",
|
||||
"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",
|
||||
"prelint": "evalmd README.md",
|
||||
"lint": "eslint --ext=js,mjs .",
|
||||
"postlint": "tsc -p . && attw -P",
|
||||
"pretest": "npm run lint",
|
||||
"tests-only": "nyc tape 'test/**/*.js'",
|
||||
"test": "npm run tests-only",
|
||||
"posttest": "aud --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)\")\""
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/ljharb/data-view-byte-length.git"
|
||||
},
|
||||
"keywords": [
|
||||
"javascript",
|
||||
"ecmascript",
|
||||
"dataview",
|
||||
"data",
|
||||
"view",
|
||||
"byte",
|
||||
"length",
|
||||
"byteLength",
|
||||
"robust"
|
||||
],
|
||||
"author": "Jordan Harband <ljharb@gmail.com>",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/ljharb/data-view-byte-length/issues"
|
||||
},
|
||||
"homepage": "https://github.com/ljharb/data-view-byte-length#readme",
|
||||
"dependencies": {
|
||||
"call-bind": "^1.0.7",
|
||||
"es-errors": "^1.3.0",
|
||||
"is-data-view": "^1.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@arethetypeswrong/cli": "^0.15.1",
|
||||
"@ljharb/eslint-config": "^21.1.0",
|
||||
"@ljharb/tsconfig": "^0.1.1",
|
||||
"@types/call-bind": "^1.0.5",
|
||||
"@types/es-value-fixtures": "^1.4.4",
|
||||
"@types/for-each": "^0.3.3",
|
||||
"@types/object-inspect": "^1.8.4",
|
||||
"@types/tape": "^5.6.4",
|
||||
"aud": "^2.0.4",
|
||||
"auto-changelog": "^2.4.0",
|
||||
"es-value-fixtures": "^1.4.2",
|
||||
"eslint": "=8.8.0",
|
||||
"evalmd": "^0.0.19",
|
||||
"for-each": "^0.3.3",
|
||||
"in-publish": "^2.0.1",
|
||||
"npmignore": "^0.3.1",
|
||||
"nyc": "^10.3.2",
|
||||
"object-inspect": "^1.13.1",
|
||||
"safe-publish-latest": "^2.0.0",
|
||||
"tape": "^5.7.5",
|
||||
"typescript": "next"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"auto-changelog": {
|
||||
"output": "CHANGELOG.md",
|
||||
"template": "keepachangelog",
|
||||
"unreleased": false,
|
||||
"commitLimit": false,
|
||||
"backfillLimit": false,
|
||||
"hideCredit": true
|
||||
},
|
||||
"publishConfig": {
|
||||
"ignore": [
|
||||
".github/workflows"
|
||||
]
|
||||
}
|
||||
}
|
31
node_modules/data-view-byte-length/test/index.js
generated
vendored
Normal file
31
node_modules/data-view-byte-length/test/index.js
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
'use strict';
|
||||
|
||||
var test = require('tape');
|
||||
var forEach = require('for-each');
|
||||
var v = require('es-value-fixtures');
|
||||
var inspect = require('object-inspect');
|
||||
|
||||
var dataViewByteLength = require('../');
|
||||
|
||||
test('dataViewByteLength', function (t) {
|
||||
forEach(
|
||||
// @ts-expect-error TS sucks at [].concat
|
||||
// eslint-disable-next-line no-extra-parens
|
||||
/** @type {[...typeof v.primitives, ...typeof v.objects]} */ ([].concat(v.primitives, v.objects)),
|
||||
function (nonDV) {
|
||||
t['throws'](function () { dataViewByteLength(nonDV); }, TypeError, inspect(nonDV) + ' is not a DataView');
|
||||
}
|
||||
);
|
||||
|
||||
t.test('DataView', { skip: typeof DataView !== 'function' }, function (st) {
|
||||
var ab = new ArrayBuffer(42);
|
||||
var dv = new DataView(ab);
|
||||
|
||||
st.equal(dataViewByteLength(dv), 42, inspect(dv) + ' has the same byteLength as the buffer originally passed to the DataView');
|
||||
st.equal(dataViewByteLength(dv), dv.buffer.byteLength, inspect(dv) + ' has the same byteLength as the buffer’s byteLength of its own buffer property');
|
||||
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.end();
|
||||
});
|
9
node_modules/data-view-byte-length/tsconfig.json
generated
vendored
Normal file
9
node_modules/data-view-byte-length/tsconfig.json
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"extends": "@ljharb/tsconfig",
|
||||
"compilerOptions": {
|
||||
"target": "es2021", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
|
||||
},
|
||||
"exclude": [
|
||||
"coverage",
|
||||
],
|
||||
}
|
Reference in New Issue
Block a user