typedarray.prototype.slice 1.0.1 → 1.0.3

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/CHANGELOG.md CHANGED
@@ -5,6 +5,22 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [v1.0.3](https://github.com/es-shims/TypedArray.prototype.slice/compare/v1.0.2...v1.0.3) - 2024-03-15
9
+
10
+ ### Commits
11
+
12
+ - [Deps] update `es-abstract` [`9067824`](https://github.com/es-shims/TypedArray.prototype.slice/commit/906782435b34ec0ce54a9dd613974601e08b5c2e)
13
+ - [Deps] update `call-bind`, `typed-array-buffer`, `typed-array-byte-offset` [`33da086`](https://github.com/es-shims/TypedArray.prototype.slice/commit/33da086e39deedf551abd8398fdf5d189cbe3d77)
14
+ - [Dev Deps] update `available-typed-arrays`, `tape` [`2f8d038`](https://github.com/es-shims/TypedArray.prototype.slice/commit/2f8d038eb15b8ac3206c2368036b988b01e5c417)
15
+
16
+ ## [v1.0.2](https://github.com/es-shims/TypedArray.prototype.slice/compare/v1.0.1...v1.0.2) - 2024-02-06
17
+
18
+ ### Commits
19
+
20
+ - [Dev Deps] update `aud`, `anvailable-typed-arrays`, `npmignore`, `object-inspect`, `tape` [`9334d4e`](https://github.com/es-shims/TypedArray.prototype.slice/commit/9334d4e47106747bdf08072c362352b189fa7778)
21
+ - [Deps] update `call-bind`, `define-properties`, `es-abstract`, `get-intrinsic` [`0acd649`](https://github.com/es-shims/TypedArray.prototype.slice/commit/0acd649f03baf849a88e27cd0dcfd78c400a5cb3)
22
+ - [Refactor] use `es-errors`, so things that only need those do not need `get-intrinsic` [`70215ad`](https://github.com/es-shims/TypedArray.prototype.slice/commit/70215adca0d4b948a9945cc7d5c0a7a70fbac2a8)
23
+
8
24
  ## [v1.0.1](https://github.com/es-shims/TypedArray.prototype.slice/compare/v1.0.0...v1.0.1) - 2023-07-18
9
25
 
10
26
  ### Commits
package/implementation.js CHANGED
@@ -1,22 +1,20 @@
1
1
  'use strict';
2
2
 
3
- var GetIntrinsic = require('get-intrinsic');
4
-
5
- var $TypeError = GetIntrinsic('%TypeError%');
6
-
7
- var Get = require('es-abstract/2023/Get');
8
- var GetValueFromBuffer = require('es-abstract/2023/GetValueFromBuffer');
9
- var IsDetachedBuffer = require('es-abstract/2023/IsDetachedBuffer');
10
- var max = require('es-abstract/2023/max');
11
- var min = require('es-abstract/2023/min');
12
- var Set = require('es-abstract/2023/Set');
13
- var SetValueInBuffer = require('es-abstract/2023/SetValueInBuffer');
14
- var ToIntegerOrInfinity = require('es-abstract/2023/ToIntegerOrInfinity');
15
- var ToString = require('es-abstract/2023/ToString');
16
- var TypedArrayElementSize = require('es-abstract/2023/TypedArrayElementSize');
17
- var TypedArrayElementType = require('es-abstract/2023/TypedArrayElementType');
18
- var TypedArraySpeciesCreate = require('es-abstract/2023/TypedArraySpeciesCreate');
19
- var ValidateTypedArray = require('es-abstract/2023/ValidateTypedArray');
3
+ var $TypeError = require('es-errors/type');
4
+
5
+ var Get = require('es-abstract/2024/Get');
6
+ var GetValueFromBuffer = require('es-abstract/2024/GetValueFromBuffer');
7
+ var IsDetachedBuffer = require('es-abstract/2024/IsDetachedBuffer');
8
+ var max = require('es-abstract/2024/max');
9
+ var min = require('es-abstract/2024/min');
10
+ var Set = require('es-abstract/2024/Set');
11
+ var SetValueInBuffer = require('es-abstract/2024/SetValueInBuffer');
12
+ var ToIntegerOrInfinity = require('es-abstract/2024/ToIntegerOrInfinity');
13
+ var ToString = require('es-abstract/2024/ToString');
14
+ var TypedArrayElementSize = require('es-abstract/2024/TypedArrayElementSize');
15
+ var TypedArrayElementType = require('es-abstract/2024/TypedArrayElementType');
16
+ var TypedArraySpeciesCreate = require('es-abstract/2024/TypedArraySpeciesCreate');
17
+ var ValidateTypedArray = require('es-abstract/2024/ValidateTypedArray');
20
18
 
21
19
  var typedArrayBuffer = require('typed-array-buffer');
22
20
  var typedArrayByteOffset = require('typed-array-byte-offset');
@@ -26,7 +24,7 @@ var typedArrayByteOffset = require('typed-array-byte-offset');
26
24
  module.exports = function slice(start, end) {
27
25
  var O = this; // step 1
28
26
 
29
- ValidateTypedArray(O); // step 2
27
+ ValidateTypedArray(O, 'SEQ-CST'); // step 2
30
28
 
31
29
  // 3. Let len be O.[[ArrayLength]].
32
30
  var len = O.length; // steps 3
@@ -73,8 +71,8 @@ module.exports = function slice(start, end) {
73
71
  var targetByteIndex = typedArrayByteOffset(A); // step 14.d.vii
74
72
  var limit = targetByteIndex + (count * elementSize); // step 14.d.viii
75
73
  while (targetByteIndex < limit) { // step 14.d.ix
76
- var value = GetValueFromBuffer(srcBuffer, srcByteIndex, 'Uint8', true, 'Unordered'); // step 14.d.ix.1
77
- SetValueInBuffer(targetBuffer, targetByteIndex, 'Uint8', value, true, 'Unordered'); // step 14.d.ix.2
74
+ var value = GetValueFromBuffer(srcBuffer, srcByteIndex, 'UINT8', true, 'UNORDERED'); // step 14.d.ix.1
75
+ SetValueInBuffer(targetBuffer, targetByteIndex, 'UINT8', value, true, 'UNORDERED'); // step 14.d.ix.2
78
76
  srcByteIndex += 1; // step 14.d.ix.3
79
77
  targetByteIndex += 1; // step 14.d.ix.4
80
78
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "typedarray.prototype.slice",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "ES spec-compliant shim for TypedArray.prototype.slice",
5
5
  "author": "Jordan Harband <ljharb@gmail.com>",
6
6
  "funding": {
@@ -53,19 +53,19 @@
53
53
  "es-shim API"
54
54
  ],
55
55
  "dependencies": {
56
- "call-bind": "^1.0.2",
57
- "define-properties": "^1.2.0",
58
- "es-abstract": "^1.22.1",
59
- "get-intrinsic": "^1.2.1",
60
- "typed-array-buffer": "^1.0.0",
61
- "typed-array-byte-offset": "^1.0.0"
56
+ "call-bind": "^1.0.7",
57
+ "define-properties": "^1.2.1",
58
+ "es-abstract": "^1.23.0",
59
+ "es-errors": "^1.3.0",
60
+ "typed-array-buffer": "^1.0.2",
61
+ "typed-array-byte-offset": "^1.0.2"
62
62
  },
63
63
  "devDependencies": {
64
64
  "@es-shims/api": "^2.4.2",
65
65
  "@ljharb/eslint-config": "^21.1.0",
66
- "aud": "^2.0.3",
66
+ "aud": "^2.0.4",
67
67
  "auto-changelog": "^2.4.0",
68
- "available-typed-arrays": "^1.0.5",
68
+ "available-typed-arrays": "^1.0.7",
69
69
  "eclint": "^2.8.1",
70
70
  "es-value-fixtures": "^1.4.2",
71
71
  "eslint": "=8.8.0",
@@ -74,11 +74,11 @@
74
74
  "functions-have-names": "^1.2.3",
75
75
  "has-strict-mode": "^1.0.1",
76
76
  "in-publish": "^2.0.1",
77
- "npmignore": "^0.3.0",
77
+ "npmignore": "^0.3.1",
78
78
  "nyc": "^10.3.2",
79
- "object-inspect": "^1.12.3",
79
+ "object-inspect": "^1.13.1",
80
80
  "safe-publish-latest": "^2.0.0",
81
- "tape": "^5.6.6"
81
+ "tape": "^5.7.5"
82
82
  },
83
83
  "testling": {
84
84
  "files": "test/index.js"