Files
NapCatQQ/.pnpm-store/v3/files/d9/3a6975fb90a8511edb3bd227f9e6a0ee0616721245b88041976ceb02a077ca866a2ca2d7ad07967f93c6be66ae0841ddf023687bda005490bc8e6af88fc1ad
T
TanTan e311ca3275
Build NapCat Artifacts / Type Check & Test (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

18 lines
391 B
Plaintext

'use strict';
var $TypeError = require('es-errors/type');
var isNaN = require('../../helpers/isNaN');
// https://262.ecma-international.org/11.0/#sec-numeric-types-number-unaryMinus
module.exports = function NumberUnaryMinus(x) {
if (typeof x !== 'number') {
throw new $TypeError('Assertion failed: `x` argument must be a Number');
}
if (isNaN(x)) {
return NaN;
}
return -x;
};