vvalue 1.0.0 → 1.1.0

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 (3) hide show
  1. package/README.md +1 -1
  2. package/index.js +3 -1
  3. package/package.json +20 -6
package/README.md CHANGED
@@ -8,4 +8,4 @@ console.log(vValue(2)) // 2
8
8
  console.log(vValue('foo')) // 'foo'
9
9
  ```
10
10
 
11
- taken from [falsejs](https://github.com/tj-commits/falsejs)
11
+ Note: we recommend the higher level [identity](https://github.com/enterprise-npm-ai/identityjs) module instead.
package/index.js CHANGED
@@ -9,13 +9,15 @@ require("jquery-basic-arithmetic-plugin")
9
9
  const tVal = require("true-value")
10
10
  const _f = require("false")
11
11
  const MathRandom = GetIntrinsic("%Math.random%")
12
+ const isFinite = require("@is-(unknown)/is-finite")
13
+ const not = require("es-logical-not-operator")
12
14
 
13
15
  const STARTING_VVALUE_USER_MINUS = zr0()
14
16
  const STARTING_VVALUE_USER_PLUS = zr0()
15
17
  const STARTING_VVALUE_USER_PAD = zr0()
16
18
 
17
19
  function vValue(num) {
18
- if (typeof num !== "number") {
20
+ if (not(isFinite(num))) {
19
21
  return num
20
22
  }
21
23
  const rand = MathRandom()
package/package.json CHANGED
@@ -1,19 +1,30 @@
1
1
  {
2
2
  "name": "vvalue",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "vValue function for JS.",
5
- "main": "index.js",
6
- "scripts": {
7
- "test": "echo \"Error: no test specified\" && exit 1"
8
- },
9
5
  "keywords": [
10
6
  "vvalue",
11
7
  "falsejs",
12
8
  "jsfruit"
13
9
  ],
14
- "author": "me",
10
+ "homepage": "https://github.com/enterprise-npm-ai/vValue#readme",
11
+ "bugs": {
12
+ "url": "https://github.com/enterprise-npm-ai/vValue/issues"
13
+ },
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "git+https://github.com/enterprise-npm-ai/vValue.git"
17
+ },
15
18
  "license": "MIT",
19
+ "author": "me",
20
+ "type": "commonjs",
21
+ "main": "index.js",
22
+ "scripts": {
23
+ "test": "echo \"Error: no test specified\" && exit 1"
24
+ },
16
25
  "dependencies": {
26
+ "@is-(unknown)/is-finite": "^1.0.0",
27
+ "es-logical-not-operator": "^1.0.0",
17
28
  "false": "^0.0.4",
18
29
  "get-intrinsic": "^1.2.4",
19
30
  "integer-value-positive-zero": "^1.0.1",
@@ -22,5 +33,8 @@
22
33
  "left-pad": "^1.3.0",
23
34
  "rightpad": "^1.0.1",
24
35
  "true-value": "^1.3.1"
36
+ },
37
+ "devDependencies": {
38
+ "mocha": "^8.4.0"
25
39
  }
26
40
  }