@petamoriken/float16
Advanced tools
Comparing version 3.6.3 to 3.6.4
@@ -1,2 +0,2 @@ | ||
/*! @petamoriken/float16 v3.6.3 | MIT License - https://git.io/float16 */ | ||
/*! @petamoriken/float16 v3.6.4 | MIT License - https://github.com/petamoriken/float16 */ | ||
@@ -1032,3 +1032,3 @@ const float16 = (function (exports) { | ||
} | ||
slice(...opts) { | ||
slice(start, end) { | ||
assertFloat16Array(this); | ||
@@ -1045,3 +1045,3 @@ const float16bitsArray = getFloat16BitsArray(this); | ||
TypedArrayPrototypeGetBuffer( | ||
TypedArrayPrototypeSlice(uint16, ...safeIfNeeded(opts)) | ||
TypedArrayPrototypeSlice(uint16, start, end) | ||
) | ||
@@ -1051,19 +1051,19 @@ ); | ||
const length = TypedArrayPrototypeGetLength(float16bitsArray); | ||
const start = ToIntegerOrInfinity(opts[0]); | ||
const end = opts[1] === undefined ? length : ToIntegerOrInfinity(opts[1]); | ||
const relativeStart = ToIntegerOrInfinity(start); | ||
const relativeEnd = end === undefined ? length : ToIntegerOrInfinity(end); | ||
let k; | ||
if (start === -Infinity) { | ||
if (relativeStart === -Infinity) { | ||
k = 0; | ||
} else if (start < 0) { | ||
k = length + start > 0 ? length + start : 0; | ||
} else if (relativeStart < 0) { | ||
k = length + relativeStart > 0 ? length + relativeStart : 0; | ||
} else { | ||
k = length < start ? length : start; | ||
k = length < relativeStart ? length : relativeStart; | ||
} | ||
let final; | ||
if (end === -Infinity) { | ||
if (relativeEnd === -Infinity) { | ||
final = 0; | ||
} else if (end < 0) { | ||
final = length + end > 0 ? length + end : 0; | ||
} else if (relativeEnd < 0) { | ||
final = length + relativeEnd > 0 ? length + relativeEnd : 0; | ||
} else { | ||
final = length < end ? length : end; | ||
final = length < relativeEnd ? length : relativeEnd; | ||
} | ||
@@ -1088,3 +1088,3 @@ const count = final - k > 0 ? final - k : 0; | ||
} | ||
subarray(...opts) { | ||
subarray(begin, end) { | ||
assertFloat16Array(this); | ||
@@ -1098,3 +1098,3 @@ const float16bitsArray = getFloat16BitsArray(this); | ||
); | ||
const uint16Subarray = TypedArrayPrototypeSubarray(uint16, ...safeIfNeeded(opts)); | ||
const uint16Subarray = TypedArrayPrototypeSubarray(uint16, begin, end); | ||
const array = new Constructor( | ||
@@ -1101,0 +1101,0 @@ TypedArrayPrototypeGetBuffer(uint16Subarray), |
{ | ||
"name": "@petamoriken/float16", | ||
"version": "3.6.3", | ||
"version": "3.6.4", | ||
"description": "IEEE 754 half-precision floating-point for JavaScript", | ||
@@ -20,3 +20,3 @@ "keywords": [ | ||
], | ||
"homepage": "https://git.io/float16", | ||
"homepage": "https://github.com/petamoriken/float16", | ||
"bugs": { | ||
@@ -76,12 +76,12 @@ "url": "https://github.com/petamoriken/float16/issues" | ||
"devDependencies": { | ||
"@babel/cli": "^7.17.6", | ||
"@babel/core": "^7.17.5", | ||
"@babel/plugin-transform-modules-commonjs": "^7.16.8", | ||
"@types/nightwatch": "^2.0.0", | ||
"babel-plugin-replace-import-extension": "^1.1.2", | ||
"browserslist": "^4.20.0", | ||
"concurrently": "^7.0.0", | ||
"eslint": "^8.10.0", | ||
"eslint-plugin-import": "^2.25.4", | ||
"eslint-plugin-jsdoc": "^37.9.7", | ||
"@babel/cli": "^7.17.10", | ||
"@babel/core": "^7.18.5", | ||
"@babel/plugin-transform-modules-commonjs": "^7.18.2", | ||
"@types/nightwatch": "^2.0.9", | ||
"babel-plugin-replace-import-extension": "^1.1.3", | ||
"browserslist": "^4.21.0", | ||
"concurrently": "^7.2.2", | ||
"eslint": "^8.18.0", | ||
"eslint-plugin-import": "^2.26.0", | ||
"eslint-plugin-jsdoc": "^39.3.3", | ||
"espower-cli": "^1.1.0", | ||
@@ -91,13 +91,13 @@ "espower-loader": "^1.2.2", | ||
"find-unused-exports": "^3.0.0", | ||
"http-server": "^14.1.0", | ||
"mocha": "^9.2.1", | ||
"nightwatch": "^2.0.10", | ||
"nightwatch-saucelabs-endsauce": "^1.0.5", | ||
"http-server": "^14.1.1", | ||
"mocha": "^10.0.0", | ||
"nightwatch": "^2.2.1", | ||
"nightwatch-saucelabs-endsauce": "^1.2.1", | ||
"nyc": "^15.1.0", | ||
"power-assert": "^1.4.2", | ||
"rollup": "^2.70.0", | ||
"rollup": "^2.75.7", | ||
"rollup-plugin-cleanup": "^3.2.1", | ||
"source-map-support": "^0.5.21" | ||
}, | ||
"packageManager": "yarn@1.22.17" | ||
"packageManager": "yarn@1.22.19" | ||
} |
@@ -1,2 +0,2 @@ | ||
# <a href="https://git.io/float16">float16</a> | ||
# <a href="https://github.com/petamoriken/float16">float16</a> | ||
@@ -3,0 +3,0 @@ <p align="center"> |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
225736