2026-06-06 20:12:40 +07:00
parent de84b2bf48
commit 97ac0f71f5
13682 changed files with 1125938 additions and 0 deletions
@@ -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.1.0](https://github.com/es-shims/math-intrinsics/compare/v1.0.0...v1.1.0) - 2024-12-18
### Commits
- [New] add `round` [`7cfb044`](https://github.com/es-shims/math-intrinsics/commit/7cfb04460c0fbdf1ca101eecbac3f59d11994130)
- [Tests] add attw [`e96be8f`](https://github.com/es-shims/math-intrinsics/commit/e96be8fbf58449eafe976446a0470e6ea561ad8d)
- [Dev Deps] update `@types/tape` [`30d0023`](https://github.com/es-shims/math-intrinsics/commit/30d00234ce8a3fa0094a61cd55d6686eb91e36ec)
## v1.0.0 - 2024-12-11
### Commits
- Initial implementation, tests, readme, types [`b898caa`](https://github.com/es-shims/math-intrinsics/commit/b898caae94e9994a94a42b8740f7bbcfd0a868fe)
- Initial commit [`02745b0`](https://github.com/es-shims/math-intrinsics/commit/02745b03a62255af8a332771987b55d127538d9c)
- [New] add `constants/maxArrayLength`, `mod` [`b978178`](https://github.com/es-shims/math-intrinsics/commit/b978178a57685bd23ed1c7efe2137f3784f5fcc5)
- npm init [`a39fc57`](https://github.com/es-shims/math-intrinsics/commit/a39fc57e5639a645d0bd52a0dc56202480223be2)
- Only apps should have lockfiles [`9451580`](https://github.com/es-shims/math-intrinsics/commit/94515800fb34db4f3cc7e99290042d45609ac7bd)
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: 175492ce93cc444589a4fed1f4af495d
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/math-intrinsics/CHANGELOG.md
uploadId: 920982
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2024 ECMAScript Shims
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.
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: eab52eb245e854f2c8012c6f4b880008
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/math-intrinsics/LICENSE
uploadId: 920982
@@ -0,0 +1,50 @@
# math-intrinsics <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]
ES Math-related intrinsics and helpers, robustly cached.
- `abs`
- `floor`
- `isFinite`
- `isInteger`
- `isNaN`
- `isNegativeZero`
- `max`
- `min`
- `mod`
- `pow`
- `round`
- `sign`
- `constants/maxArrayLength`
- `constants/maxSafeInteger`
- `constants/maxValue`
## Tests
Simply clone the repo, `npm install`, and run `npm test`
## Security
Please email [@ljharb](https://github.com/ljharb) or see https://tidelift.com/security if you have a potential security vulnerability to report.
[package-url]: https://npmjs.org/package/math-intrinsics
[npm-version-svg]: https://versionbadg.es/es-shims/math-intrinsics.svg
[deps-svg]: https://david-dm.org/es-shims/math-intrinsics.svg
[deps-url]: https://david-dm.org/es-shims/math-intrinsics
[dev-deps-svg]: https://david-dm.org/es-shims/math-intrinsics/dev-status.svg
[dev-deps-url]: https://david-dm.org/es-shims/math-intrinsics#info=devDependencies
[npm-badge-png]: https://nodei.co/npm/math-intrinsics.png?downloads=true&stars=true
[license-image]: https://img.shields.io/npm/l/math-intrinsics.svg
[license-url]: LICENSE
[downloads-image]: https://img.shields.io/npm/dm/es-object.svg
[downloads-url]: https://npm-stat.com/charts.html?package=math-intrinsics
[codecov-image]: https://codecov.io/gh/es-shims/math-intrinsics/branch/main/graphs/badge.svg
[codecov-url]: https://app.codecov.io/gh/es-shims/math-intrinsics/
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/es-shims/math-intrinsics
[actions-url]: https://github.com/es-shims/math-intrinsics/actions
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: 229fa15ad58054da4929d402265d4f98
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/math-intrinsics/README.md
uploadId: 920982
@@ -0,0 +1 @@
export = Math.abs;
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: 4e618a8f4954d410ba0f125651a03c6f
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/math-intrinsics/abs.d.ts
uploadId: 920982
+4
View File
@@ -0,0 +1,4 @@
'use strict';
/** @type {import('./abs')} */
module.exports = Math.abs;
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: bb8781e24333f4111912113a10b6bb83
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/math-intrinsics/abs.js
uploadId: 920982
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 265a44f4f8af74d9fb6fdacc7b210c4d
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,3 @@
declare const MAX_ARRAY_LENGTH: 4294967295;
export = MAX_ARRAY_LENGTH;
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: 299801a67de7e464aa88828924aa924f
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/math-intrinsics/constants/maxArrayLength.d.ts
uploadId: 920982
@@ -0,0 +1,4 @@
'use strict';
/** @type {import('./maxArrayLength')} */
module.exports = 4294967295; // Math.pow(2, 32) - 1;
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: 52b12cd709f3a468fb35fd4ddc232e20
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/math-intrinsics/constants/maxArrayLength.js
uploadId: 920982
@@ -0,0 +1,3 @@
declare const MAX_SAFE_INTEGER: 9007199254740991;
export = MAX_SAFE_INTEGER;
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: 82ce6679b9f8541ee8ac50ff3a601b60
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/math-intrinsics/constants/maxSafeInteger.d.ts
uploadId: 920982
@@ -0,0 +1,5 @@
'use strict';
/** @type {import('./maxSafeInteger')} */
// eslint-disable-next-line no-extra-parens
module.exports = /** @type {import('./maxSafeInteger')} */ (Number.MAX_SAFE_INTEGER) || 9007199254740991; // Math.pow(2, 53) - 1;
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: 47d03d075c7f94f149a6c862708493da
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/math-intrinsics/constants/maxSafeInteger.js
uploadId: 920982
@@ -0,0 +1,3 @@
declare const MAX_VALUE: 1.7976931348623157e+308;
export = MAX_VALUE;
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: 249080d26073a4ab0964cf78ec91a93d
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/math-intrinsics/constants/maxValue.d.ts
uploadId: 920982
@@ -0,0 +1,5 @@
'use strict';
/** @type {import('./maxValue')} */
// eslint-disable-next-line no-extra-parens
module.exports = /** @type {import('./maxValue')} */ (Number.MAX_VALUE) || 1.7976931348623157e+308;
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: 3f09f5b976af64ba393d0a8ba0a569fd
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/math-intrinsics/constants/maxValue.js
uploadId: 920982
@@ -0,0 +1 @@
export = Math.floor;
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: c72dae06292744cbf9edc7e1902361c7
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/math-intrinsics/floor.d.ts
uploadId: 920982
@@ -0,0 +1,4 @@
'use strict';
/** @type {import('./floor')} */
module.exports = Math.floor;
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: 1054b9006a32d4f1fa8c66eeabe7081e
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/math-intrinsics/floor.js
uploadId: 920982
@@ -0,0 +1,3 @@
declare function isFinite(x: unknown): x is number | bigint;
export = isFinite;
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: c5ea3144ed15a4282b37c0f71ce7a50c
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/math-intrinsics/isFinite.d.ts
uploadId: 920982
@@ -0,0 +1,12 @@
'use strict';
var $isNaN = require('./isNaN');
/** @type {import('./isFinite')} */
module.exports = function isFinite(x) {
return (typeof x === 'number' || typeof x === 'bigint')
&& !$isNaN(x)
&& x !== Infinity
&& x !== -Infinity;
};
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: cf30cb84cb87f4a378c9165f382453ac
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/math-intrinsics/isFinite.js
uploadId: 920982
@@ -0,0 +1,3 @@
declare function isInteger(argument: unknown): argument is number;
export = isInteger;
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: 42ed813b83e4b44148d404b17e60b43e
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/math-intrinsics/isInteger.d.ts
uploadId: 920982
@@ -0,0 +1,16 @@
'use strict';
var $abs = require('./abs');
var $floor = require('./floor');
var $isNaN = require('./isNaN');
var $isFinite = require('./isFinite');
/** @type {import('./isInteger')} */
module.exports = function isInteger(argument) {
if (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) {
return false;
}
var absValue = $abs(argument);
return $floor(absValue) === absValue;
};
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: e6c41266a076d45cd83a5c8f961047d0
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/math-intrinsics/isInteger.js
uploadId: 920982
@@ -0,0 +1 @@
export = Number.isNaN;
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: 63b5ad8c42d734404bfeb12061da48bf
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/math-intrinsics/isNaN.d.ts
uploadId: 920982
@@ -0,0 +1,6 @@
'use strict';
/** @type {import('./isNaN')} */
module.exports = Number.isNaN || function isNaN(a) {
return a !== a;
};
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: a005923d018174ddf943ae49d1b9ce50
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/math-intrinsics/isNaN.js
uploadId: 920982
@@ -0,0 +1,3 @@
declare function isNegativeZero(x: unknown): boolean;
export = isNegativeZero;
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: cb33466d9639a46a1a5caca93a654331
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/math-intrinsics/isNegativeZero.d.ts
uploadId: 920982
@@ -0,0 +1,6 @@
'use strict';
/** @type {import('./isNegativeZero')} */
module.exports = function isNegativeZero(x) {
return x === 0 && 1 / x === 1 / -0;
};
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: 847740fe265884f0eaed09371f4a5bcf
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/math-intrinsics/isNegativeZero.js
uploadId: 920982
@@ -0,0 +1 @@
export = Math.max;
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: c09b6326c8b624f86a2febb6a3bf9127
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/math-intrinsics/max.d.ts
uploadId: 920982
+4
View File
@@ -0,0 +1,4 @@
'use strict';
/** @type {import('./max')} */
module.exports = Math.max;
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: 2b8a479ffb151480a9cf36515724aa12
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/math-intrinsics/max.js
uploadId: 920982
@@ -0,0 +1 @@
export = Math.min;
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: 00d4220a63c694b76932320b3484689f
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/math-intrinsics/min.d.ts
uploadId: 920982
+4
View File
@@ -0,0 +1,4 @@
'use strict';
/** @type {import('./min')} */
module.exports = Math.min;
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: a3da6cd09891f491ca30d7a74da49865
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/math-intrinsics/min.js
uploadId: 920982
@@ -0,0 +1,3 @@
declare function mod(number: number, modulo: number): number;
export = mod;
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: 0d75b930d922145ad8c0afcb2f6673ee
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/math-intrinsics/mod.d.ts
uploadId: 920982
+9
View File
@@ -0,0 +1,9 @@
'use strict';
var $floor = require('./floor');
/** @type {import('./mod')} */
module.exports = function mod(number, modulo) {
var remain = number % modulo;
return $floor(remain >= 0 ? remain : remain + modulo);
};
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: d91e29ba3a1ae4f87958be5c497baad3
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/math-intrinsics/mod.js
uploadId: 920982
@@ -0,0 +1,86 @@
{
"name": "math-intrinsics",
"version": "1.1.0",
"description": "ES Math-related intrinsics and helpers, robustly cached.",
"main": false,
"exports": {
"./abs": "./abs.js",
"./floor": "./floor.js",
"./isFinite": "./isFinite.js",
"./isInteger": "./isInteger.js",
"./isNaN": "./isNaN.js",
"./isNegativeZero": "./isNegativeZero.js",
"./max": "./max.js",
"./min": "./min.js",
"./mod": "./mod.js",
"./pow": "./pow.js",
"./sign": "./sign.js",
"./round": "./round.js",
"./constants/maxArrayLength": "./constants/maxArrayLength.js",
"./constants/maxSafeInteger": "./constants/maxSafeInteger.js",
"./constants/maxValue": "./constants/maxValue.js",
"./package.json": "./package.json"
},
"sideEffects": false,
"scripts": {
"prepack": "npmignore --auto --commentLines=autogenerated",
"prepublishOnly": "safe-publish-latest",
"prepublish": "not-in-publish || npm run prepublishOnly",
"pretest": "npm run lint",
"test": "npm run tests-only",
"tests-only": "nyc tape 'test/**/*.js'",
"posttest": "npx npm@'>= 10.2' audit --production",
"prelint": "evalmd README.md && eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git' | grep -v dist/)",
"lint": "eslint --ext=js,mjs .",
"postlint": "tsc && attw -P",
"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)\")\""
},
"repository": {
"type": "git",
"url": "git+https://github.com/es-shims/math-intrinsics.git"
},
"author": "Jordan Harband <ljharb@gmail.com>",
"license": "MIT",
"bugs": {
"url": "https://github.com/es-shims/math-intrinsics/issues"
},
"homepage": "https://github.com/es-shims/math-intrinsics#readme",
"devDependencies": {
"@arethetypeswrong/cli": "^0.17.1",
"@ljharb/eslint-config": "^21.1.1",
"@ljharb/tsconfig": "^0.2.2",
"@types/for-each": "^0.3.3",
"@types/object-inspect": "^1.13.0",
"@types/tape": "^5.8.0",
"auto-changelog": "^2.5.0",
"eclint": "^2.8.1",
"es-value-fixtures": "^1.5.0",
"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.3",
"safe-publish-latest": "^2.0.0",
"tape": "^5.9.0",
"typescript": "next"
},
"auto-changelog": {
"output": "CHANGELOG.md",
"template": "keepachangelog",
"unreleased": false,
"commitLimit": false,
"backfillLimit": false,
"hideCredit": true
},
"publishConfig": {
"ignore": [
".github/workflows"
]
},
"engines": {
"node": ">= 0.4"
}
}
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: 5999022ee5ab34dfba0ba2893b1136af
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/math-intrinsics/package.json
uploadId: 920982
@@ -0,0 +1 @@
export = Math.pow;
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: 027ffcc023846405cb5dc38419c4a334
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/math-intrinsics/pow.d.ts
uploadId: 920982
+4
View File
@@ -0,0 +1,4 @@
'use strict';
/** @type {import('./pow')} */
module.exports = Math.pow;
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: 367432e7c59954df0af03cb1559f1dc5
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/math-intrinsics/pow.js
uploadId: 920982
@@ -0,0 +1 @@
export = Math.round;
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: 5f734712976ee4539b0d5c3ed31250c5
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/math-intrinsics/round.d.ts
uploadId: 920982
@@ -0,0 +1,4 @@
'use strict';
/** @type {import('./round')} */
module.exports = Math.round;
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: ce21ab33d95324f1283a0544770a852d
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/math-intrinsics/round.js
uploadId: 920982
@@ -0,0 +1,3 @@
declare function sign(x: number): number;
export = sign;
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: 2e199bc87eb56452db831521b05173d8
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/math-intrinsics/sign.d.ts
uploadId: 920982
+11
View File
@@ -0,0 +1,11 @@
'use strict';
var $isNaN = require('./isNaN');
/** @type {import('./sign')} */
module.exports = function sign(number) {
if ($isNaN(number) || number === 0) {
return number;
}
return number < 0 ? -1 : +1;
};
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: decc0a4cbcf604ffdacd5f2f658a5c0d
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/math-intrinsics/sign.js
uploadId: 920982
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 1d2edaba832844a36ad6edbdc6e66112
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,192 @@
'use strict';
var test = require('tape');
var v = require('es-value-fixtures');
var forEach = require('for-each');
var inspect = require('object-inspect');
var abs = require('../abs');
var floor = require('../floor');
var isFinite = require('../isFinite');
var isInteger = require('../isInteger');
var isNaN = require('../isNaN');
var isNegativeZero = require('../isNegativeZero');
var max = require('../max');
var min = require('../min');
var mod = require('../mod');
var pow = require('../pow');
var round = require('../round');
var sign = require('../sign');
var maxArrayLength = require('../constants/maxArrayLength');
var maxSafeInteger = require('../constants/maxSafeInteger');
var maxValue = require('../constants/maxValue');
test('abs', function (t) {
t.equal(abs(-1), 1, 'abs(-1) === 1');
t.equal(abs(+1), 1, 'abs(+1) === 1');
t.equal(abs(+0), +0, 'abs(+0) === +0');
t.equal(abs(-0), +0, 'abs(-0) === +0');
t.end();
});
test('floor', function (t) {
t.equal(floor(-1.1), -2, 'floor(-1.1) === -2');
t.equal(floor(+1.1), 1, 'floor(+1.1) === 1');
t.equal(floor(+0), +0, 'floor(+0) === +0');
t.equal(floor(-0), -0, 'floor(-0) === -0');
t.equal(floor(-Infinity), -Infinity, 'floor(-Infinity) === -Infinity');
t.equal(floor(Number(Infinity)), Number(Infinity), 'floor(+Infinity) === +Infinity');
t.equal(floor(NaN), NaN, 'floor(NaN) === NaN');
t.equal(floor(0), +0, 'floor(0) === +0');
t.equal(floor(-0), -0, 'floor(-0) === -0');
t.equal(floor(1), 1, 'floor(1) === 1');
t.equal(floor(-1), -1, 'floor(-1) === -1');
t.equal(floor(1.1), 1, 'floor(1.1) === 1');
t.equal(floor(-1.1), -2, 'floor(-1.1) === -2');
t.equal(floor(maxValue), maxValue, 'floor(maxValue) === maxValue');
t.equal(floor(maxSafeInteger), maxSafeInteger, 'floor(maxSafeInteger) === maxSafeInteger');
t.end();
});
test('isFinite', function (t) {
t.equal(isFinite(0), true, 'isFinite(+0) === true');
t.equal(isFinite(-0), true, 'isFinite(-0) === true');
t.equal(isFinite(1), true, 'isFinite(1) === true');
t.equal(isFinite(Infinity), false, 'isFinite(Infinity) === false');
t.equal(isFinite(-Infinity), false, 'isFinite(-Infinity) === false');
t.equal(isFinite(NaN), false, 'isFinite(NaN) === false');
forEach(v.nonNumbers, function (nonNumber) {
t.equal(isFinite(nonNumber), false, 'isFinite(' + inspect(nonNumber) + ') === false');
});
t.end();
});
test('isInteger', function (t) {
forEach([].concat(
// @ts-expect-error TS sucks with concat
v.nonNumbers,
v.nonIntegerNumbers
), function (nonInteger) {
t.equal(isInteger(nonInteger), false, 'isInteger(' + inspect(nonInteger) + ') === false');
});
t.end();
});
test('isNaN', function (t) {
forEach([].concat(
// @ts-expect-error TS sucks with concat
v.nonNumbers,
v.infinities,
v.zeroes,
v.integerNumbers
), function (nonNaN) {
t.equal(isNaN(nonNaN), false, 'isNaN(' + inspect(nonNaN) + ') === false');
});
t.equal(isNaN(NaN), true, 'isNaN(NaN) === true');
t.end();
});
test('isNegativeZero', function (t) {
t.equal(isNegativeZero(-0), true, 'isNegativeZero(-0) === true');
t.equal(isNegativeZero(+0), false, 'isNegativeZero(+0) === false');
t.equal(isNegativeZero(1), false, 'isNegativeZero(1) === false');
t.equal(isNegativeZero(-1), false, 'isNegativeZero(-1) === false');
t.equal(isNegativeZero(NaN), false, 'isNegativeZero(NaN) === false');
t.equal(isNegativeZero(Infinity), false, 'isNegativeZero(Infinity) === false');
t.equal(isNegativeZero(-Infinity), false, 'isNegativeZero(-Infinity) === false');
forEach(v.nonNumbers, function (nonNumber) {
t.equal(isNegativeZero(nonNumber), false, 'isNegativeZero(' + inspect(nonNumber) + ') === false');
});
t.end();
});
test('max', function (t) {
t.equal(max(1, 2), 2, 'max(1, 2) === 2');
t.equal(max(1, 2, 3), 3, 'max(1, 2, 3) === 3');
t.equal(max(1, 2, 3, 4), 4, 'max(1, 2, 3, 4) === 4');
t.equal(max(1, 2, 3, 4, 5), 5, 'max(1, 2, 3, 4, 5) === 5');
t.equal(max(1, 2, 3, 4, 5, 6), 6, 'max(1, 2, 3, 4, 5, 6) === 6');
t.equal(max(1, 2, 3, 4, 5, 6, 7), 7, 'max(1, 2, 3, 4, 5, 6, 7) === 7');
t.end();
});
test('min', function (t) {
t.equal(min(1, 2), 1, 'min(1, 2) === 1');
t.equal(min(1, 2, 3), 1, 'min(1, 2, 3) === 1');
t.equal(min(1, 2, 3, 4), 1, 'min(1, 2, 3, 4) === 1');
t.equal(min(1, 2, 3, 4, 5), 1, 'min(1, 2, 3, 4, 5) === 1');
t.equal(min(1, 2, 3, 4, 5, 6), 1, 'min(1, 2, 3, 4, 5, 6) === 1');
t.end();
});
test('mod', function (t) {
t.equal(mod(1, 2), 1, 'mod(1, 2) === 1');
t.equal(mod(2, 2), 0, 'mod(2, 2) === 0');
t.equal(mod(3, 2), 1, 'mod(3, 2) === 1');
t.equal(mod(4, 2), 0, 'mod(4, 2) === 0');
t.equal(mod(5, 2), 1, 'mod(5, 2) === 1');
t.equal(mod(6, 2), 0, 'mod(6, 2) === 0');
t.equal(mod(7, 2), 1, 'mod(7, 2) === 1');
t.equal(mod(8, 2), 0, 'mod(8, 2) === 0');
t.equal(mod(9, 2), 1, 'mod(9, 2) === 1');
t.equal(mod(10, 2), 0, 'mod(10, 2) === 0');
t.equal(mod(11, 2), 1, 'mod(11, 2) === 1');
t.end();
});
test('pow', function (t) {
t.equal(pow(2, 2), 4, 'pow(2, 2) === 4');
t.equal(pow(2, 3), 8, 'pow(2, 3) === 8');
t.equal(pow(2, 4), 16, 'pow(2, 4) === 16');
t.equal(pow(2, 5), 32, 'pow(2, 5) === 32');
t.equal(pow(2, 6), 64, 'pow(2, 6) === 64');
t.equal(pow(2, 7), 128, 'pow(2, 7) === 128');
t.equal(pow(2, 8), 256, 'pow(2, 8) === 256');
t.equal(pow(2, 9), 512, 'pow(2, 9) === 512');
t.equal(pow(2, 10), 1024, 'pow(2, 10) === 1024');
t.end();
});
test('round', function (t) {
t.equal(round(1.1), 1, 'round(1.1) === 1');
t.equal(round(1.5), 2, 'round(1.5) === 2');
t.equal(round(1.9), 2, 'round(1.9) === 2');
t.end();
});
test('sign', function (t) {
t.equal(sign(-1), -1, 'sign(-1) === -1');
t.equal(sign(+1), +1, 'sign(+1) === +1');
t.equal(sign(+0), +0, 'sign(+0) === +0');
t.equal(sign(-0), -0, 'sign(-0) === -0');
t.equal(sign(NaN), NaN, 'sign(NaN) === NaN');
t.equal(sign(Infinity), +1, 'sign(Infinity) === +1');
t.equal(sign(-Infinity), -1, 'sign(-Infinity) === -1');
t.equal(sign(maxValue), +1, 'sign(maxValue) === +1');
t.equal(sign(maxSafeInteger), +1, 'sign(maxSafeInteger) === +1');
t.end();
});
test('constants', function (t) {
t.equal(typeof maxArrayLength, 'number', 'typeof maxArrayLength === "number"');
t.equal(typeof maxSafeInteger, 'number', 'typeof maxSafeInteger === "number"');
t.equal(typeof maxValue, 'number', 'typeof maxValue === "number"');
t.end();
});
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: 5211b252890dc46829c3be055b6e8c69
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/math-intrinsics/test/index.js
uploadId: 920982
@@ -0,0 +1,3 @@
{
"extends": "@ljharb/tsconfig",
}
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: 9b27453b2c21e4e70bc7687e0e1d4ed4
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/math-intrinsics/tsconfig.json
uploadId: 920982