base128-ascii 3.1.0 → 3.1.1

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.
Files changed (2) hide show
  1. package/main.js +5 -3
  2. package/package.json +1 -1
package/main.js CHANGED
@@ -3,7 +3,7 @@
3
3
  export const Base128Bytes = (() => {
4
4
  class Base128Bytes {
5
5
  constructor() {
6
- return Reflect.construct(Uint8Array, arguments, Base128Bytes)
6
+ return Reflect.construct(Uint8Array, arguments, new.target)
7
7
  }
8
8
  toString() {
9
9
  return new TextDecoder().decode(this)
@@ -21,8 +21,10 @@ export const Base128Bytes = (() => {
21
21
  )}\``
22
22
  }
23
23
  }
24
- const { buffer, byteLength, byteOffset, length } = Object.getOwnPropertyDescriptors(Object.getPrototypeOf(Uint8Array.prototype))
25
- Object.defineProperties(Base128Bytes.prototype, { buffer, byteLength, byteOffset, length })
24
+ const p = Object.getPrototypeOf(Uint8Array.prototype)
25
+ for (const key of ["buffer", "byteLength", "byteOffset", "length"]) {
26
+ Object.defineProperty(Base128Bytes.prototype, key, Object.getOwnPropertyDescriptor(p, key))
27
+ }
26
28
  return Base128Bytes
27
29
  })()
28
30
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "base128-ascii",
3
- "version": "3.1.0",
3
+ "version": "3.1.1",
4
4
  "author": "bddjr",
5
5
  "license": "Unlicense",
6
6
  "type": "module",