Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

math-sign-x

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

math-sign-x - npm Package Compare versions

Comparing version 3.0.0 to 4.0.0

dist/math-sign-x.esm.js

157

package.json
{
"name": "math-sign-x",
"version": "3.0.0",
"version": "4.0.0",
"description": "Shim for Math.sign.",

@@ -19,5 +19,25 @@ "homepage": "https://github.com/Xotic750/math-sign-x",

],
"main": "index.js",
"engines": {
"node": "*"
"files": [
"dist",
"src"
],
"module": "dist/math-sign-x.esm.js",
"main": "dist/math-sign-x.js",
"scripts": {
"build:esm": "mkdirp dist && babel -s true --env-name esm src/math-sign-x.js -o dist/math-sign-x.esm.js",
"build:base": "webpack --bail --progress --profile --colors",
"build": "npm run build:esm && cross-env NODE_ENV=production npm run build:base --",
"build:dev": "npm run build:base --",
"clean": "rimraf dist && npm run clean:coverage",
"clean:coverage": "rimraf __tests__/coverage",
"lint": "eslint -f 'node_modules/eslint-friendly-formatter' --ext .js .",
"lint-fix": "npm run lint -- --fix",
"report": "npm run build -- --env.report",
"report:dev": "npm run build:dev -- --env.report",
"security": "npm audit",
"security-fix": "npm run security -- fix",
"start": "nodemon --exec \"npm run build\" --watch src",
"test": "npm run clean:coverage && jest",
"test:ci": "npm run test -- --ci --maxWorkers=2",
"test:coverage": "npm run test -- --coverage"
},

@@ -33,58 +53,81 @@ "license": "MIT",

"dependencies": {
"is-nan-x": "^1.0.1",
"to-number-x": "^2.0.0"
"is-nan-x": "^2.0.7",
"to-number-x": "^3.0.5"
},
"devDependencies": {
"@xotic750/eslint-config-standard-x": "^2.2.1",
"browserify": "^14.4.0",
"browserify-derequire": "^0.9.4",
"cross-env": "^5.0.1",
"es5-shim": "^4.5.9",
"es6-shim": "^0.35.3",
"es7-shim": "^6.0.0",
"eslint": "^4.2.0",
"eslint-plugin-compat": "^1.0.4",
"eslint-plugin-css-modules": "^2.7.2",
"eslint-plugin-eslint-comments": "^1.0.2",
"eslint-plugin-jsdoc": "^3.1.1",
"eslint-plugin-json": "^1.2.0",
"eslint-plugin-no-use-extend-native": "^0.3.12",
"husky": "^0.13.4",
"jasmine-node": "^1.14.5",
"jsdoc-to-markdown": "^3.0.0",
"json3": "^3.3.2",
"make-jasmine-spec-runner-html": "^1.3.0",
"ncp": "^2.0.0",
"nodemon": "^1.11.0",
"nsp": "^2.6.3",
"parallelshell": "^3.0.1",
"replace-x": "^1.5.0",
"rimraf": "^2.6.1",
"serve": "^6.0.2",
"uglify-js": "^3.0.24"
"@babel/cli": "^7.5.0",
"@babel/core": "^7.5.4",
"@babel/node": "^7.5.0",
"@babel/plugin-proposal-class-properties": "^7.5.0",
"@babel/plugin-syntax-dynamic-import": "^7.2.0",
"@babel/plugin-syntax-export-default-from": "^7.2.0",
"@babel/plugin-syntax-export-namespace-from": "^7.2.0",
"@babel/plugin-transform-property-mutators": "^7.2.0",
"@babel/plugin-transform-runtime": "^7.5.0",
"@babel/preset-env": "^7.5.4",
"@babel/runtime": "^7.5.4",
"@prorenata/eslint-config-vue": "^1.13.6",
"@types/jest": "^24.0.15",
"@types/node": "^12.6.2",
"babel-core": "^7.0.0-0",
"babel-eslint": "^10.0.2",
"babel-loader": "^8.0.6",
"babel-plugin-lodash": "^3.3.4",
"caniuse-lite": "^1.0.30000983",
"chalk": "^2.4.2",
"concurrently": "^4.1.1",
"cross-env": "^5.2.0",
"eslint": "=5.16.0",
"eslint-config-airbnb-base": "^13.2.0",
"eslint-config-prettier": "^6.0.0",
"eslint-friendly-formatter": "^4.0.1",
"eslint-import-resolver-webpack": "^0.11.1",
"eslint-loader": "^2.2.1",
"eslint-plugin-babel": "^5.3.0",
"eslint-plugin-compat": "^3.2.0",
"eslint-plugin-css-modules": "^2.11.0",
"eslint-plugin-eslint-comments": "^3.1.2",
"eslint-plugin-html": "^6.0.0",
"eslint-plugin-import": "^2.18.0",
"eslint-plugin-jest": "^22.7.2",
"eslint-plugin-jsdoc": "^15.3.5",
"eslint-plugin-json": "^1.4.0",
"eslint-plugin-lodash": "^5.1.0",
"eslint-plugin-no-use-extend-native": "^0.4.1",
"eslint-plugin-prefer-object-spread": "^1.2.1",
"eslint-plugin-prettier": "^3.1.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-sort-class-members": "^1.5.0",
"eslint-plugin-switch-case": "^1.1.2",
"eslint-plugin-vue": "^5.2.3",
"friendly-errors-webpack-plugin": "^1.7.0",
"identity-obj-proxy": "^3.0.0",
"jest": "^24.8.0",
"jest-cli": "^24.8.0",
"jest-file": "^1.0.0",
"jsdoc-to-markdown": "^5.0.0",
"lodash": "^4.17.14",
"lodash-webpack-plugin": "^0.11.5",
"mkdirp": "^0.5.1",
"node-notifier": "^5.4.0",
"nodemon": "^1.19.1",
"prettier": "=1.14.3",
"rimraf": "^2.6.3",
"semver": "^6.2.0",
"source-map-loader": "^0.2.4",
"terser-webpack-plugin": "^1.3.0",
"typescript": "^3.5.3",
"webpack": "^4.35.3",
"webpack-bundle-analyzer": "^3.3.2",
"webpack-cli": "^3.3.5",
"webpack-merge": "^4.2.1"
},
"scripts": {
"clean": "rimraf README.md lib/*",
"clean:jasmine": "rimraf tests/index.html tests/run.js",
"clean:all": "npm run clean:jasmine && npm run clean",
"build": "npm run clean && npm run lint && npm run browserify && npm run uglify && npm run docs && npm test && npm run security",
"build:jasmine": "npm run clean:jasmine && make-jasmine-spec-runner-html",
"build:setver": "replace-x \" @version .*\" \" @version $(node -p -e \"require('./package.json').version\")\" index.js",
"build:name": "replace-x \" @module .*\" \" @module $(node -p -e \"require('./package.json').name\")\" index.js",
"build:description": "replace-x \" @file .*\" \" @file $(node -p -e \"require('./package.json').description\")\" index.js",
"build:replace": "npm run build:setver && npm run build:name && npm run build:description",
"production": "npm run clean:all && npm run build:jasmine && npm run build:replace && npm run build",
"start": "parallelshell \"serve\" \"nodemon --watch index.js --exec 'npm run build'\"",
"docs:name": "replace-x \"@{PACKAGE-NAME}\" \"$(node -p -e \"require('./package.json').name\")\" README.md",
"docs:badges": "ncp badges.html README.md && npm run docs:name",
"docs": "npm run docs:badges && jsdoc2md --name-format --example-lang js index.js >> README.md",
"lint": "eslint *.js tests/spec/*.js",
"lint-fix": "npm run lint -- --fix",
"security": "nsp check",
"test": "jasmine-node --matchall tests/spec/",
"browserify": "browserify -p browserify-derequire -e index.js -o lib/math-sign-x.js -u 'crypto' -s returnExports",
"uglify": "uglifyjs lib/math-sign-x.js -o lib/math-sign-x.min.js --config-file .uglifyjsrc.json",
"precommit": "npm run production",
"prepush": "npm run production"
}
"engines": {
"node": ">=8.11.4",
"npm": "6.4.1"
},
"browserslist": [
"> 1%",
"Explorer >= 9"
]
}

@@ -24,24 +24,12 @@ <a href="https://travis-ci.org/Xotic750/math-sign-x"

## math-sign-x
Shim for Math.sign.
**See**: [20.2.2.29 Math.sign(x)](http://www.ecma-international.org/ecma-262/6.0/#sec-math.sign)
**Version**: 3.0.0
**Author**: Xotic750 <Xotic750@gmail.com>
**License**: [MIT](&lt;https://opensource.org/licenses/MIT&gt;)
**Copyright**: Xotic750
- [math-sign-x](#module_math-sign-x)
- [`.sign2016`](#module_math-sign-x.sign2016) ⇒ <code>number</code>
* [math-sign-x](#module_math-sign-x)
* [`.sign`](#module_math-sign-x.sign)
* [`.sign2016`](#module_math-sign-x.sign2016) ⇒ <code>number</code>
* [`.sign2018`](#module_math-sign-x.sign2018) ⇒ <code>number</code>
<a name="module_math-sign-x.sign"></a>
### `math-sign-x.sign`
Reference to sign2018.
**Kind**: static property of [<code>math-sign-x</code>](#module_math-sign-x)
<a name="module_math-sign-x.sign2016"></a>
### `math-sign-x.sign2016` ⇒ <code>number</code>
This method returns the sign of a number, indicating whether the number is positive,

@@ -53,24 +41,27 @@ negative or zero. (ES2016)

is a positive number, negative number, positive zero or negative zero, the function will
return 1, -1, 0 or -0 respectively. Otherwise, NaN is returned.
return 1, -1, 0 or -0 respectively. Otherwise, NaN is returned.
| Param | Type | Description |
| --- | --- | --- |
| x | <code>\*</code> | A number. |
| Param | Type | Description |
| ----- | --------------- | ----------- |
| x | <code>\*</code> | A number. |
**Example**
**Example**
```js
var mathSign = require('math-sign-x').sign2016;
import {sign2016} from 'math-sign-x';
mathSign(3); // 1
mathSign(-3); // -1
mathSign('-3'); // -1
mathSign(0); // 0
mathSign(-0); // -0
mathSign(NaN); // NaN
mathSign('foo'); // NaN
mathSign(); // NaN
console.log(sign2016(3)); // 1
console.log(sign2016(-3)); // -1
console.log(sign2016('-3')); // -1
console.log(sign2016(0)); // 0
console.log(sign2016(-0)); // -0
console.log(sign2016(NaN)); // NaN
console.log(sign2016('foo')); // NaN
console.log(sign2016()); // NaN
```
<a name="module_math-sign-x.sign2018"></a>
### `math-sign-x.sign2018` ⇒ <code>number</code>
<a name="module_math-sign-x"></a>
### `math-sign-x` ⇒ <code>number</code>
This method returns the sign of a number, indicating whether the number is positive,

@@ -82,20 +73,21 @@ negative or zero. (ES2018)

is a positive number, negative number, positive zero or negative zero, the function will
return 1, -1, 0 or -0 respectively. Otherwise, NaN is returned.
return 1, -1, 0 or -0 respectively. Otherwise, NaN is returned.
| Param | Type | Description |
| --- | --- | --- |
| x | <code>\*</code> | A number. |
| Param | Type | Description |
| ----- | --------------- | ----------- |
| x | <code>\*</code> | A number. |
**Example**
**Example**
```js
var mathSign = require('math-sign-x').sign2018;
import mathSign from 'math-sign-x';
mathSign(3); // 1
mathSign(-3); // -1
mathSign('-3'); // -1
mathSign(0); // 0
mathSign(-0); // -0
mathSign(NaN); // NaN
mathSign('foo'); // NaN
mathSign(); // NaN
console.log(mathSign(3)); // 1
console.log(mathSign(-3)); // -1
console.log(mathSign('-3')); // -1
console.log(mathSign(0)); // 0
console.log(mathSign(-0)); // -0
console.log(mathSign(NaN)); // NaN
console.log(mathSign('foo')); // NaN
console.log(mathSign()); // NaN
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc