meteor-node-stubs 1.2.20 → 1.2.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/node_modules/@meteorjs/browserify-sign/node_modules/isarray/README.md +60 -0
- package/node_modules/@meteorjs/browserify-sign/node_modules/isarray/index.js +5 -0
- package/node_modules/@meteorjs/browserify-sign/node_modules/isarray/package.json +45 -0
- package/node_modules/isarray/LICENSE +21 -0
- package/node_modules/isarray/README.md +8 -30
- package/node_modules/isarray/package.json +4 -1
- package/node_modules/pbkdf2/node_modules/create-hash/.npmignore +1 -0
- package/node_modules/pbkdf2/node_modules/create-hash/.travis.yml +15 -0
- package/node_modules/pbkdf2/node_modules/create-hash/browser.js +52 -0
- package/node_modules/pbkdf2/node_modules/create-hash/index.js +1 -0
- package/node_modules/pbkdf2/node_modules/create-hash/make-hash.js +30 -0
- package/node_modules/pbkdf2/node_modules/create-hash/md5.js +151 -0
- package/node_modules/pbkdf2/node_modules/create-hash/package.json +37 -0
- package/node_modules/pbkdf2/node_modules/create-hash/readme.md +19 -0
- package/node_modules/pbkdf2/node_modules/create-hash/test.js +40 -0
- package/node_modules/pbkdf2/node_modules/hash-base/README.md +38 -0
- package/node_modules/pbkdf2/node_modules/hash-base/index.js +83 -0
- package/node_modules/pbkdf2/node_modules/hash-base/package.json +37 -0
- package/node_modules/pbkdf2/node_modules/ripemd160/CHANGELOG.md +72 -0
- package/node_modules/pbkdf2/node_modules/ripemd160/LICENSE.md +21 -0
- package/node_modules/pbkdf2/node_modules/ripemd160/README.md +27 -0
- package/node_modules/pbkdf2/node_modules/ripemd160/index.js +291 -0
- package/node_modules/pbkdf2/node_modules/ripemd160/package.json +37 -0
- package/node_modules/to-buffer/.eslintrc +16 -0
- package/node_modules/to-buffer/.github/FUNDING.yml +12 -0
- package/node_modules/to-buffer/.nycrc +9 -0
- package/node_modules/to-buffer/CHANGELOG.md +72 -0
- package/node_modules/to-buffer/LICENSE +21 -0
- package/node_modules/to-buffer/README.md +44 -0
- package/node_modules/to-buffer/index.js +109 -0
- package/node_modules/to-buffer/package.json +60 -0
- package/node_modules/typed-array-buffer/.eslintrc +13 -0
- package/node_modules/typed-array-buffer/.github/FUNDING.yml +12 -0
- package/node_modules/typed-array-buffer/.nycrc +13 -0
- package/node_modules/typed-array-buffer/CHANGELOG.md +50 -0
- package/node_modules/typed-array-buffer/LICENSE +21 -0
- package/node_modules/typed-array-buffer/README.md +42 -0
- package/node_modules/typed-array-buffer/index.d.ts +9 -0
- package/node_modules/typed-array-buffer/index.js +19 -0
- package/node_modules/typed-array-buffer/package.json +82 -0
- package/node_modules/typed-array-buffer/test/index.js +23 -0
- package/node_modules/typed-array-buffer/tsconfig.json +9 -0
- package/package.json +1 -1
- /package/node_modules/{isarray → @meteorjs/browserify-sign/node_modules/isarray}/.npmignore +0 -0
- /package/node_modules/{isarray → @meteorjs/browserify-sign/node_modules/isarray}/.travis.yml +0 -0
- /package/node_modules/{isarray → @meteorjs/browserify-sign/node_modules/isarray}/Makefile +0 -0
- /package/node_modules/{isarray → @meteorjs/browserify-sign/node_modules/isarray}/component.json +0 -0
- /package/node_modules/{isarray → @meteorjs/browserify-sign/node_modules/isarray}/test.js +0 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [v1.2.1](https://github.com/browserify/to-buffer/compare/v1.2.0...v1.2.1) - 2025-06-19
|
|
9
|
+
|
|
10
|
+
### Commits
|
|
11
|
+
|
|
12
|
+
- [Fix] handle non-Uint8Arrays in node < 3 [`7f8a881`](https://github.com/browserify/to-buffer/commit/7f8a881929133935f8e15ffd60d6dbbc513b2c5f)
|
|
13
|
+
- [Tests] add coverage [`286c96a`](https://github.com/browserify/to-buffer/commit/286c96a52cfeee14a2ba974d78071bdd667e9360)
|
|
14
|
+
- [Fix] provide a fallback for engines without `ArrayBuffer.isView` [`e336166`](https://github.com/browserify/to-buffer/commit/e336166b8f4bf13860bafa191ee1ec53fca2e331)
|
|
15
|
+
- [Fix] correct error message [`b45247e`](https://github.com/browserify/to-buffer/commit/b45247ed337fb44b2c8d74a14e8f86d985119fb9)
|
|
16
|
+
|
|
17
|
+
## [v1.2.0](https://github.com/browserify/to-buffer/compare/v1.1.1...v1.2.0) - 2025-06-17
|
|
18
|
+
|
|
19
|
+
### Commits
|
|
20
|
+
|
|
21
|
+
- [New] replace with implementation from cipher-base [`970adb5`](https://github.com/browserify/to-buffer/commit/970adb5523efdaa13f5ecb82967fc9f617865549)
|
|
22
|
+
- [Tests] migrate from travis to GHA [`8084393`](https://github.com/browserify/to-buffer/commit/808439337ca9ac3dbb8399079aaa2a4cb738627c)
|
|
23
|
+
- [eslint] fix whitespace [`a62e651`](https://github.com/browserify/to-buffer/commit/a62e651b661adf98c17e9e486b55bb8ff0ffb8c9)
|
|
24
|
+
- [eslint] fix semicolon usage [`4d85c63`](https://github.com/browserify/to-buffer/commit/4d85c6318c72feae8d19037937154f9b99ba266f)
|
|
25
|
+
- [meta] add `auto-changelog` [`aa0279c`](https://github.com/browserify/to-buffer/commit/aa0279c5199ca7fe39acfb950a4c824e97f06232)
|
|
26
|
+
- [readme] update URLs, add badges [`ff77d90`](https://github.com/browserify/to-buffer/commit/ff77d90b89de7b02538ecb2d6a89da086093bed8)
|
|
27
|
+
- [lint] switch to eslint [`e45f467`](https://github.com/browserify/to-buffer/commit/e45f467c7229e632cd3c10fc02895ba4d3204bbe)
|
|
28
|
+
- [Fix] validate that arrays contain valid byte values [`c2fb75e`](https://github.com/browserify/to-buffer/commit/c2fb75edf2fb113d58599e990f86574b4dfa62d8)
|
|
29
|
+
- [Fix] restore previous implementation Array behavior [`cb93b75`](https://github.com/browserify/to-buffer/commit/cb93b75a79caa9897f6c29ecde91f4ae35f704fe)
|
|
30
|
+
- [Tests] add nyc for coverage [`ab7026e`](https://github.com/browserify/to-buffer/commit/ab7026e36e3716c8101229f426e7f4571e55794b)
|
|
31
|
+
- [Refactor] use `safe-buffer`.from instead of `buffer-from` [`8e01307`](https://github.com/browserify/to-buffer/commit/8e01307191245044469e47695c5c2675b85e84e9)
|
|
32
|
+
- [Fix] Replace Buffer.from with `buffer-from` [`d652e54`](https://github.com/browserify/to-buffer/commit/d652e54e2396a47358a553c447e0f338b4c2dc67)
|
|
33
|
+
- [Tests] use `deepEqual` over `same` alias [`66a5548`](https://github.com/browserify/to-buffer/commit/66a55480258011bb5d81c5aad1360468f418d0b4)
|
|
34
|
+
- [meta] add `npmignore` [`90ce602`](https://github.com/browserify/to-buffer/commit/90ce6023737d50521aff44d87063db1e3f7e352a)
|
|
35
|
+
- [Tests] move into a test dir, update tape [`08aea81`](https://github.com/browserify/to-buffer/commit/08aea81b61b90d1fcb7e9275b5b0ba718531d9a8)
|
|
36
|
+
- Only apps should have lockfiles [`16ccceb`](https://github.com/browserify/to-buffer/commit/16ccceb23f350be16e80111188c90a3492916f5d)
|
|
37
|
+
- [Tests] add coverage [`d2cba2e`](https://github.com/browserify/to-buffer/commit/d2cba2ec76ed43c83e2a7a91f58fa7640aeb61e9)
|
|
38
|
+
- [meta] update description [`2cf2a20`](https://github.com/browserify/to-buffer/commit/2cf2a200a31f9543d2e8a24b5ea0e8bd843166c3)
|
|
39
|
+
- [Fix] add `safe-buffer`, missing from 970adb5 [`d9a0dea`](https://github.com/browserify/to-buffer/commit/d9a0dead7c638d188f8b48cdf2b5fd6cfa886071)
|
|
40
|
+
- [meta] temporarily limit support to node v0.10 [`8dca458`](https://github.com/browserify/to-buffer/commit/8dca458bd9a2c6b84d6e3a1996e41b242fe1c49a)
|
|
41
|
+
- [meta] add missing `engines.node` [`35bdfcb`](https://github.com/browserify/to-buffer/commit/35bdfcb3a71dfbd5b35d35250c9dac19c99f4197)
|
|
42
|
+
- [Dev Deps] add missing peer dep [`220143f`](https://github.com/browserify/to-buffer/commit/220143f1f6e47154380c27a2d88ce300104007fa)
|
|
43
|
+
- [meta] add `sideEffects` flag [`cd37473`](https://github.com/browserify/to-buffer/commit/cd374738d24b22b029862b3c27b9e247d4e62daf)
|
|
44
|
+
|
|
45
|
+
## [v1.1.1](https://github.com/browserify/to-buffer/compare/v1.1.0...v1.1.1) - 2018-04-26
|
|
46
|
+
|
|
47
|
+
### Commits
|
|
48
|
+
|
|
49
|
+
- use Buffer.from when avail [`eebe20e`](https://github.com/browserify/to-buffer/commit/eebe20e0603e2c6a542b00316f1661741fdf1124)
|
|
50
|
+
|
|
51
|
+
## [v1.1.0](https://github.com/browserify/to-buffer/compare/v1.0.1...v1.1.0) - 2017-04-12
|
|
52
|
+
|
|
53
|
+
### Merged
|
|
54
|
+
|
|
55
|
+
- Fix typo [`#2`](https://github.com/browserify/to-buffer/pull/2)
|
|
56
|
+
|
|
57
|
+
### Commits
|
|
58
|
+
|
|
59
|
+
- support arrays as well [`ef98c82`](https://github.com/browserify/to-buffer/commit/ef98c82791d71601077577e84c4614ec2d05f086)
|
|
60
|
+
|
|
61
|
+
## [v1.0.1](https://github.com/browserify/to-buffer/compare/v1.0.0...v1.0.1) - 2016-02-15
|
|
62
|
+
|
|
63
|
+
### Commits
|
|
64
|
+
|
|
65
|
+
- fix desc [`7d50a7c`](https://github.com/browserify/to-buffer/commit/7d50a7c69c3eef77448893744ada16601c44af6a)
|
|
66
|
+
|
|
67
|
+
## v1.0.0 - 2016-02-15
|
|
68
|
+
|
|
69
|
+
### Commits
|
|
70
|
+
|
|
71
|
+
- first commit [`8361941`](https://github.com/browserify/to-buffer/commit/8361941d7acb3b82c732ecd10bdb047da5af2028)
|
|
72
|
+
- add travis [`de911b5`](https://github.com/browserify/to-buffer/commit/de911b5364558561d84b4ec9e43c6a0fe1c8e904)
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2016 Mathias Buus
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# to-buffer <sup>[![Version Badge][2]][1]</sup>
|
|
2
|
+
|
|
3
|
+
Pass in a string, array, Buffer, Data View, or Uint8Array, and get a Buffer back.
|
|
4
|
+
|
|
5
|
+
[![github actions][actions-image]][actions-url]
|
|
6
|
+
[![coverage][codecov-image]][codecov-url]
|
|
7
|
+
[![dependency status][5]][6]
|
|
8
|
+
[![dev dependency status][7]][8]
|
|
9
|
+
[![License][license-image]][license-url]
|
|
10
|
+
[![Downloads][downloads-image]][downloads-url]
|
|
11
|
+
|
|
12
|
+
[![npm badge][11]][1]
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
npm install to-buffer
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
``` js
|
|
22
|
+
var toBuffer = require('to-buffer');
|
|
23
|
+
|
|
24
|
+
console.log(toBuffer('hi')); // <Buffer 68 69>
|
|
25
|
+
console.log(toBuffer(Buffer('hi'))); // <Buffer 68 69>
|
|
26
|
+
console.log(toBuffer('6869', 'hex')); // <Buffer 68 69>
|
|
27
|
+
console.log(toBuffer(43)); // throws
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
[1]: https://npmjs.org/package/to-buffer
|
|
31
|
+
[2]: https://versionbadg.es/browserify/to-buffer.svg
|
|
32
|
+
[5]: https://david-dm.org/browserify/to-buffer.svg
|
|
33
|
+
[6]: https://david-dm.org/browserify/to-buffer
|
|
34
|
+
[7]: https://david-dm.org/browserify/to-buffer/dev-status.svg
|
|
35
|
+
[8]: https://david-dm.org/browserify/to-buffer#info=devDependencies
|
|
36
|
+
[11]: https://nodei.co/npm/to-buffer.png?downloads=true&stars=true
|
|
37
|
+
[license-image]: https://img.shields.io/npm/l/to-buffer.svg
|
|
38
|
+
[license-url]: LICENSE
|
|
39
|
+
[downloads-image]: https://img.shields.io/npm/dm/to-buffer.svg
|
|
40
|
+
[downloads-url]: https://npm-stat.com/charts.html?package=to-buffer
|
|
41
|
+
[codecov-image]: https://codecov.io/gh/browserify/to-buffer/branch/main/graphs/badge.svg
|
|
42
|
+
[codecov-url]: https://app.codecov.io/gh/browserify/to-buffer/
|
|
43
|
+
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/browserify/to-buffer
|
|
44
|
+
[actions-url]: https://github.com/browserify/to-buffer/actions
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var Buffer = require('safe-buffer').Buffer;
|
|
4
|
+
var isArray = require('isarray');
|
|
5
|
+
var typedArrayBuffer = require('typed-array-buffer');
|
|
6
|
+
|
|
7
|
+
var isView = ArrayBuffer.isView || function isView(obj) {
|
|
8
|
+
try {
|
|
9
|
+
typedArrayBuffer(obj);
|
|
10
|
+
return true;
|
|
11
|
+
} catch (e) {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
var useUint8Array = typeof Uint8Array !== 'undefined';
|
|
17
|
+
var useArrayBuffer = typeof ArrayBuffer !== 'undefined'
|
|
18
|
+
&& typeof Uint8Array !== 'undefined';
|
|
19
|
+
var useFromArrayBuffer = useArrayBuffer && (Buffer.prototype instanceof Uint8Array || Buffer.TYPED_ARRAY_SUPPORT);
|
|
20
|
+
|
|
21
|
+
module.exports = function toBuffer(data, encoding) {
|
|
22
|
+
/*
|
|
23
|
+
* No need to do anything for exact instance
|
|
24
|
+
* This is only valid when safe-buffer.Buffer === buffer.Buffer, i.e. when Buffer.from/Buffer.alloc existed
|
|
25
|
+
*/
|
|
26
|
+
if (data instanceof Buffer) {
|
|
27
|
+
return data;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (typeof data === 'string') {
|
|
31
|
+
return Buffer.from(data, encoding);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/*
|
|
35
|
+
* Wrap any TypedArray instances and DataViews
|
|
36
|
+
* Makes sense only on engines with full TypedArray support -- let Buffer detect that
|
|
37
|
+
*/
|
|
38
|
+
if (useArrayBuffer && isView(data)) {
|
|
39
|
+
// Bug in Node.js <6.3.1, which treats this as out-of-bounds
|
|
40
|
+
if (data.byteLength === 0) {
|
|
41
|
+
return Buffer.alloc(0);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// When Buffer is based on Uint8Array, we can just construct it from ArrayBuffer
|
|
45
|
+
if (useFromArrayBuffer) {
|
|
46
|
+
var res = Buffer.from(data.buffer, data.byteOffset, data.byteLength);
|
|
47
|
+
/*
|
|
48
|
+
* Recheck result size, as offset/length doesn't work on Node.js <5.10
|
|
49
|
+
* We just go to Uint8Array case if this fails
|
|
50
|
+
*/
|
|
51
|
+
if (res.byteLength === data.byteLength) {
|
|
52
|
+
return res;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Convert to Uint8Array bytes and then to Buffer
|
|
57
|
+
var uint8 = data instanceof Uint8Array ? data : new Uint8Array(data.buffer, data.byteOffset, data.byteLength);
|
|
58
|
+
var result = Buffer.from(uint8);
|
|
59
|
+
|
|
60
|
+
/*
|
|
61
|
+
* Let's recheck that conversion succeeded
|
|
62
|
+
* We have .length but not .byteLength when useFromArrayBuffer is false
|
|
63
|
+
*/
|
|
64
|
+
if (result.length === data.byteLength) {
|
|
65
|
+
return result;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/*
|
|
70
|
+
* Uint8Array in engines where Buffer.from might not work with ArrayBuffer, just copy over
|
|
71
|
+
* Doesn't make sense with other TypedArray instances
|
|
72
|
+
*/
|
|
73
|
+
if (useUint8Array && data instanceof Uint8Array) {
|
|
74
|
+
return Buffer.from(data);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
var isArr = isArray(data);
|
|
78
|
+
if (isArr) {
|
|
79
|
+
for (var i = 0; i < data.length; i += 1) {
|
|
80
|
+
var x = data[i];
|
|
81
|
+
if (
|
|
82
|
+
typeof x !== 'number'
|
|
83
|
+
|| x < 0
|
|
84
|
+
|| x > 255
|
|
85
|
+
|| ~~x !== x // NaN and integer check
|
|
86
|
+
) {
|
|
87
|
+
throw new RangeError('Array items must be numbers in the range 0-255.');
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/*
|
|
93
|
+
* Old Buffer polyfill on an engine that doesn't have TypedArray support
|
|
94
|
+
* Also, this is from a different Buffer polyfill implementation then we have, as instanceof check failed
|
|
95
|
+
* Convert to our current Buffer implementation
|
|
96
|
+
*/
|
|
97
|
+
if (
|
|
98
|
+
isArr || (
|
|
99
|
+
Buffer.isBuffer(data)
|
|
100
|
+
&& data.constructor
|
|
101
|
+
&& typeof data.constructor.isBuffer === 'function'
|
|
102
|
+
&& data.constructor.isBuffer(data)
|
|
103
|
+
)
|
|
104
|
+
) {
|
|
105
|
+
return Buffer.from(data);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.');
|
|
109
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "to-buffer",
|
|
3
|
+
"version": "1.2.1",
|
|
4
|
+
"description": "Pass in a string, array, Buffer, Data View, or Uint8Array, and get a Buffer back.",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"sideEffects": false,
|
|
7
|
+
"scripts": {
|
|
8
|
+
"prepack": "npmignore --auto --commentLines=autogenerated",
|
|
9
|
+
"lint": "eslint --ext=js,mjs .",
|
|
10
|
+
"pretest": "npm run lint",
|
|
11
|
+
"tests-only": "nyc tape 'test/**/*'",
|
|
12
|
+
"test": "npm run tests-only",
|
|
13
|
+
"posttest": "npx npm@\">= 10.2\" audit --production",
|
|
14
|
+
"version": "auto-changelog && git add CHANGELOG.md",
|
|
15
|
+
"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
|
|
16
|
+
},
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "https://github.com/browserify/to-buffer.git"
|
|
20
|
+
},
|
|
21
|
+
"author": "Mathias Buus (@mafintosh)",
|
|
22
|
+
"license": "MIT",
|
|
23
|
+
"bugs": {
|
|
24
|
+
"url": "https://github.com/browserify/to-buffer/issues"
|
|
25
|
+
},
|
|
26
|
+
"homepage": "https://github.com/browserify/to-buffer",
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"isarray": "^2.0.5",
|
|
29
|
+
"safe-buffer": "^5.2.1",
|
|
30
|
+
"typed-array-buffer": "^1.0.3"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@ljharb/eslint-config": "^21.1.1",
|
|
34
|
+
"auto-changelog": "^2.5.0",
|
|
35
|
+
"available-typed-arrays": "^1.0.7",
|
|
36
|
+
"encoding": "^0.1.13",
|
|
37
|
+
"eslint": "=8.8.0",
|
|
38
|
+
"for-each": "^0.3.5",
|
|
39
|
+
"npmignore": "^0.3.1",
|
|
40
|
+
"nyc": "^10.3.2",
|
|
41
|
+
"tape": "^5.9.0"
|
|
42
|
+
},
|
|
43
|
+
"engines": {
|
|
44
|
+
"node": ">= 0.4"
|
|
45
|
+
},
|
|
46
|
+
"publishConfig": {
|
|
47
|
+
"ignore": [
|
|
48
|
+
".github/workflows",
|
|
49
|
+
"test"
|
|
50
|
+
]
|
|
51
|
+
},
|
|
52
|
+
"auto-changelog": {
|
|
53
|
+
"output": "CHANGELOG.md",
|
|
54
|
+
"template": "keepachangelog",
|
|
55
|
+
"unreleased": false,
|
|
56
|
+
"commitLimit": false,
|
|
57
|
+
"backfillLimit": false,
|
|
58
|
+
"hideCredit": true
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# These are supported funding model platforms
|
|
2
|
+
|
|
3
|
+
github: [ljharb]
|
|
4
|
+
patreon: # Replace with a single Patreon username
|
|
5
|
+
open_collective: # Replace with a single Open Collective username
|
|
6
|
+
ko_fi: # Replace with a single Ko-fi username
|
|
7
|
+
tidelift: npm/typed-array-buffer
|
|
8
|
+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
|
9
|
+
liberapay: # Replace with a single Liberapay username
|
|
10
|
+
issuehunt: # Replace with a single IssueHunt username
|
|
11
|
+
otechie: # Replace with a single Otechie username
|
|
12
|
+
custom: # Replace with a single custom sponsorship URL
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [v1.0.3](https://github.com/inspect-js/typed-array-buffer/compare/v1.0.2...v1.0.3) - 2024-12-18
|
|
9
|
+
|
|
10
|
+
### Commits
|
|
11
|
+
|
|
12
|
+
- [meta] update URLs [`aca9484`](https://github.com/inspect-js/typed-array-buffer/commit/aca9484b41f96767408e26e63854b5d86f759de8)
|
|
13
|
+
- [types] use shared config [`fcdcb05`](https://github.com/inspect-js/typed-array-buffer/commit/fcdcb05941a771826e1478a77aadd89c582e37cd)
|
|
14
|
+
- [actions] split out node 10-20, and 20+ [`5f5a406`](https://github.com/inspect-js/typed-array-buffer/commit/5f5a4067752d7bccecbaa8f6e143863d55197af9)
|
|
15
|
+
- [types] improve types [`f45042c`](https://github.com/inspect-js/typed-array-buffer/commit/f45042c07c04007217404d73aa77c26a73885210)
|
|
16
|
+
- [Dev Deps] update `@ljharb/eslint-config`, `@ljharb/tsconfig`, `@types/object-inspect`, `@types/tape`, `auto-changelog`, `es-value-fixtures`, `object-inspect`, `tape` [`0c937e7`](https://github.com/inspect-js/typed-array-buffer/commit/0c937e72e93dccc359c08cf1a9ef060e5f5e1a8d)
|
|
17
|
+
- [Refactor] use `call-bound` directly [`cf4aba4`](https://github.com/inspect-js/typed-array-buffer/commit/cf4aba4d8c1702ee9130abaf8a6a72907ca96ce0)
|
|
18
|
+
- [Tests] replace `aud` with `npm audit` [`a3abb73`](https://github.com/inspect-js/typed-array-buffer/commit/a3abb739300d1de6e88736019d718d831c7a4cca)
|
|
19
|
+
- [Dev Deps] update `@types/tape` [`548ffdc`](https://github.com/inspect-js/typed-array-buffer/commit/548ffdc881726b060ac92fc0c59ab0bb150df91f)
|
|
20
|
+
- [Deps] update `is-typed-array` [`3b5deb1`](https://github.com/inspect-js/typed-array-buffer/commit/3b5deb191a1c942deced0273b07fe69bc8de39ab)
|
|
21
|
+
- [Deps] update `call-bind` [`02cbc0c`](https://github.com/inspect-js/typed-array-buffer/commit/02cbc0cca2f69d81cdeedf7beebae2a5dd9dd4f7)
|
|
22
|
+
- [Tests] add attw and `postlint` [`f6daa66`](https://github.com/inspect-js/typed-array-buffer/commit/f6daa6695a69878d845070b90ab0bbf6392ebb03)
|
|
23
|
+
- [Dev Deps] add missing peer dep [`c9faf2a`](https://github.com/inspect-js/typed-array-buffer/commit/c9faf2ac04fc78410aeb144405db110fe9b60b6c)
|
|
24
|
+
|
|
25
|
+
## [v1.0.2](https://github.com/inspect-js/typed-array-buffer/compare/v1.0.1...v1.0.2) - 2024-02-19
|
|
26
|
+
|
|
27
|
+
### Commits
|
|
28
|
+
|
|
29
|
+
- add types [`23c6fba`](https://github.com/inspect-js/typed-array-buffer/commit/23c6fba167dbc8c1e9291eed3f68e64a5651075a)
|
|
30
|
+
- [Deps] update `available-typed-arrays` [`5f68ba1`](https://github.com/inspect-js/typed-array-buffer/commit/5f68ba1fdcd004af46d529fbb08220de2254cf43)
|
|
31
|
+
- [Deps] update `call-bind` [`54a92ce`](https://github.com/inspect-js/typed-array-buffer/commit/54a92ce4caf023c8680ffe64534ba881b78cdc17)
|
|
32
|
+
- [Dev Deps] update `tape` [`b0b3342`](https://github.com/inspect-js/typed-array-buffer/commit/b0b3342bcbefae5f3dff01b0e3734b08ca927f58)
|
|
33
|
+
|
|
34
|
+
## [v1.0.1](https://github.com/inspect-js/typed-array-buffer/compare/v1.0.0...v1.0.1) - 2024-02-06
|
|
35
|
+
|
|
36
|
+
### Commits
|
|
37
|
+
|
|
38
|
+
- [Dev Deps] update `aud`, `available-typed-arrays`, `npmignore`, `object-inspect`, `tape` [`5334477`](https://github.com/inspect-js/typed-array-buffer/commit/53344773866f35820dc4deef1aa47ec7890f2b02)
|
|
39
|
+
- [Refactor] use `es-errors`, so things that only need those do not need `get-intrinsic` [`e2511e0`](https://github.com/inspect-js/typed-array-buffer/commit/e2511e011a2331bd4a36ad6003a98b1cf766bc26)
|
|
40
|
+
- [Deps] update `call-bind`, `get-intrinsic`, `is-typed-array` [`36c3b11`](https://github.com/inspect-js/typed-array-buffer/commit/36c3b11efc9bce98de8bee5f81dcae4305876893)
|
|
41
|
+
- [meta] add `sideEffects` flag [`46cc1f4`](https://github.com/inspect-js/typed-array-buffer/commit/46cc1f4a8b8875fc6e84b33182602ec37655bbbd)
|
|
42
|
+
|
|
43
|
+
## v1.0.0 - 2023-06-05
|
|
44
|
+
|
|
45
|
+
### Commits
|
|
46
|
+
|
|
47
|
+
- Initial implementation, tests, readme [`5bc2953`](https://github.com/inspect-js/typed-array-buffer/commit/5bc295337b4310659832fc08699a4d10c2dbbded)
|
|
48
|
+
- Initial commit [`98b8ac9`](https://github.com/inspect-js/typed-array-buffer/commit/98b8ac90f407c368effa25d395aeea1d72e1d4b6)
|
|
49
|
+
- npm init [`6a4a73c`](https://github.com/inspect-js/typed-array-buffer/commit/6a4a73c66b1f13fd17699c6500a4979003676696)
|
|
50
|
+
- Only apps should have lockfiles [`7226abf`](https://github.com/inspect-js/typed-array-buffer/commit/7226abfda329b99dc25526c48740b076d128a7be)
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Jordan Harband
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# typed-array-buffer <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
|
|
2
|
+
|
|
3
|
+
[![github actions][actions-image]][actions-url]
|
|
4
|
+
[![coverage][codecov-image]][codecov-url]
|
|
5
|
+
[![License][license-image]][license-url]
|
|
6
|
+
[![Downloads][downloads-image]][downloads-url]
|
|
7
|
+
|
|
8
|
+
[![npm badge][npm-badge-png]][package-url]
|
|
9
|
+
|
|
10
|
+
Get the ArrayBuffer out of a TypedArray, robustly.
|
|
11
|
+
|
|
12
|
+
This will work in node <= 0.10 and < 0.11.4, where there's no prototype accessor, only a nonconfigurable own property.
|
|
13
|
+
It will also work in modern engines where `TypedArray.prototype.buffer` has been deleted after this module has loaded.
|
|
14
|
+
|
|
15
|
+
## Example
|
|
16
|
+
|
|
17
|
+
```js
|
|
18
|
+
const typedArrayBuffer = require('typed-array-buffer');
|
|
19
|
+
const assert = require('assert');
|
|
20
|
+
|
|
21
|
+
const arr = new Uint8Array(0);
|
|
22
|
+
assert.equal(arr.buffer, typedArrayBuffer(arr));
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Tests
|
|
26
|
+
Simply clone the repo, `npm install`, and run `npm test`
|
|
27
|
+
|
|
28
|
+
[package-url]: https://npmjs.org/package/typed-array-buffer
|
|
29
|
+
[npm-version-svg]: https://versionbadg.es/inspect-js/typed-array-buffer.svg
|
|
30
|
+
[deps-svg]: https://david-dm.org/inspect-js/typed-array-buffer.svg
|
|
31
|
+
[deps-url]: https://david-dm.org/inspect-js/typed-array-buffer
|
|
32
|
+
[dev-deps-svg]: https://david-dm.org/inspect-js/typed-array-buffer/dev-status.svg
|
|
33
|
+
[dev-deps-url]: https://david-dm.org/inspect-js/typed-array-buffer#info=devDependencies
|
|
34
|
+
[npm-badge-png]: https://nodei.co/npm/typed-array-buffer.png?downloads=true&stars=true
|
|
35
|
+
[license-image]: https://img.shields.io/npm/l/typed-array-buffer.svg
|
|
36
|
+
[license-url]: LICENSE
|
|
37
|
+
[downloads-image]: https://img.shields.io/npm/dm/typed-array-buffer.svg
|
|
38
|
+
[downloads-url]: https://npm-stat.com/charts.html?package=typed-array-buffer
|
|
39
|
+
[codecov-image]: https://codecov.io/gh/inspect-js/typed-array-buffer/branch/main/graphs/badge.svg
|
|
40
|
+
[codecov-url]: https://app.codecov.io/gh/inspect-js/typed-array-buffer/
|
|
41
|
+
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/typed-array-buffer
|
|
42
|
+
[actions-url]: https://github.com/inspect-js/typed-array-buffer/actions
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var $TypeError = require('es-errors/type');
|
|
4
|
+
|
|
5
|
+
var callBound = require('call-bound');
|
|
6
|
+
|
|
7
|
+
/** @type {undefined | ((thisArg: import('.').TypedArray) => Buffer<ArrayBufferLike>)} */
|
|
8
|
+
var $typedArrayBuffer = callBound('TypedArray.prototype.buffer', true);
|
|
9
|
+
|
|
10
|
+
var isTypedArray = require('is-typed-array');
|
|
11
|
+
|
|
12
|
+
/** @type {import('.')} */
|
|
13
|
+
// node <= 0.10, < 0.11.4 has a nonconfigurable own property instead of a prototype getter
|
|
14
|
+
module.exports = $typedArrayBuffer || function typedArrayBuffer(x) {
|
|
15
|
+
if (!isTypedArray(x)) {
|
|
16
|
+
throw new $TypeError('Not a Typed Array');
|
|
17
|
+
}
|
|
18
|
+
return x.buffer;
|
|
19
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "typed-array-buffer",
|
|
3
|
+
"version": "1.0.3",
|
|
4
|
+
"description": "Get the ArrayBuffer out of a TypedArray, robustly.",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": "./index.js",
|
|
8
|
+
"./package.json": "./package.json"
|
|
9
|
+
},
|
|
10
|
+
"sideEffects": false,
|
|
11
|
+
"scripts": {
|
|
12
|
+
"prepack": "npmignore --auto --commentLines=autogenerated",
|
|
13
|
+
"prepublishOnly": "safe-publish-latest",
|
|
14
|
+
"prepublish": "not-in-publish || npm run prepublishOnly",
|
|
15
|
+
"lint": "eslint --ext=js,mjs .",
|
|
16
|
+
"postlint": "tsc && attw -P",
|
|
17
|
+
"pretest": "npm run lint",
|
|
18
|
+
"tests-only": "nyc tape 'test/**/*.js'",
|
|
19
|
+
"test": "npm run tests-only",
|
|
20
|
+
"posttest": "npx npm@'>= 10.2' audit --production",
|
|
21
|
+
"version": "auto-changelog && git add CHANGELOG.md",
|
|
22
|
+
"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
|
|
23
|
+
},
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "git+https://github.com/inspect-js/typed-array-buffer.git"
|
|
27
|
+
},
|
|
28
|
+
"keywords": [
|
|
29
|
+
"typed array",
|
|
30
|
+
"arraybuffer",
|
|
31
|
+
"buffer"
|
|
32
|
+
],
|
|
33
|
+
"author": "Jordan Harband <ljharb@gmail.com>",
|
|
34
|
+
"license": "MIT",
|
|
35
|
+
"bugs": {
|
|
36
|
+
"url": "https://github.com/inspect-js/typed-array-buffer/issues"
|
|
37
|
+
},
|
|
38
|
+
"homepage": "https://github.com/inspect-js/typed-array-buffer#readme",
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"call-bound": "^1.0.3",
|
|
41
|
+
"es-errors": "^1.3.0",
|
|
42
|
+
"is-typed-array": "^1.1.14"
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@arethetypeswrong/cli": "^0.17.1",
|
|
46
|
+
"@ljharb/eslint-config": "^21.1.1",
|
|
47
|
+
"@ljharb/tsconfig": "^0.2.2",
|
|
48
|
+
"@types/es-value-fixtures": "^1.4.4",
|
|
49
|
+
"@types/for-each": "^0.3.3",
|
|
50
|
+
"@types/object-inspect": "^1.13.0",
|
|
51
|
+
"@types/tape": "^5.8.0",
|
|
52
|
+
"auto-changelog": "^2.5.0",
|
|
53
|
+
"available-typed-arrays": "^1.0.7",
|
|
54
|
+
"encoding": "^0.1.13",
|
|
55
|
+
"es-value-fixtures": "^1.5.0",
|
|
56
|
+
"eslint": "=8.8.0",
|
|
57
|
+
"for-each": "^0.3.3",
|
|
58
|
+
"in-publish": "^2.0.1",
|
|
59
|
+
"npmignore": "^0.3.1",
|
|
60
|
+
"nyc": "^10.3.2",
|
|
61
|
+
"object-inspect": "^1.13.3",
|
|
62
|
+
"safe-publish-latest": "^2.0.0",
|
|
63
|
+
"tape": "^5.9.0",
|
|
64
|
+
"typescript": "next"
|
|
65
|
+
},
|
|
66
|
+
"engines": {
|
|
67
|
+
"node": ">= 0.4"
|
|
68
|
+
},
|
|
69
|
+
"auto-changelog": {
|
|
70
|
+
"output": "CHANGELOG.md",
|
|
71
|
+
"template": "keepachangelog",
|
|
72
|
+
"unreleased": false,
|
|
73
|
+
"commitLimit": false,
|
|
74
|
+
"backfillLimit": false,
|
|
75
|
+
"hideCredit": true
|
|
76
|
+
},
|
|
77
|
+
"publishConfig": {
|
|
78
|
+
"ignore": [
|
|
79
|
+
".github/workflows"
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var test = require('tape');
|
|
4
|
+
var availableTypedArrays = require('available-typed-arrays')();
|
|
5
|
+
var forEach = require('for-each');
|
|
6
|
+
var v = require('es-value-fixtures');
|
|
7
|
+
var inspect = require('object-inspect');
|
|
8
|
+
|
|
9
|
+
var typedArrayBuffer = require('../');
|
|
10
|
+
|
|
11
|
+
test('typedArrayBuffer', function (t) {
|
|
12
|
+
// @ts-expect-error TS sucks at concat
|
|
13
|
+
forEach([].concat(v.primitives, v.objects), function (nonTA) {
|
|
14
|
+
t['throws'](function () { typedArrayBuffer(nonTA); }, TypeError, inspect(nonTA) + ' is not a Typed Array');
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
forEach(availableTypedArrays, function (TA) {
|
|
18
|
+
var ta = new global[TA](0);
|
|
19
|
+
t.equal(typedArrayBuffer(ta), ta.buffer, inspect(ta) + ' has the same buffer as its own buffer property');
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
t.end();
|
|
23
|
+
});
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "meteor-node-stubs",
|
|
3
3
|
"author": "Ben Newman <ben@meteor.com>",
|
|
4
4
|
"description": "Stub implementations of Node built-in modules, a la Browserify",
|
|
5
|
-
"version": "1.2.
|
|
5
|
+
"version": "1.2.22",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"homepage": "https://github.com/meteor/meteor/blob/devel/npm-packages/meteor-node-stubs/README.md",
|
|
File without changes
|
/package/node_modules/{isarray → @meteorjs/browserify-sign/node_modules/isarray}/.travis.yml
RENAMED
|
File without changes
|
|
File without changes
|
/package/node_modules/{isarray → @meteorjs/browserify-sign/node_modules/isarray}/component.json
RENAMED
|
File without changes
|
|
File without changes
|