integer-value-positive-zero 1.0.1 → 1.0.2

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/LICENSE +1 -1
  2. package/index.js +6 -34
  3. package/package.json +4 -16
package/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2024 integer-value-positive-zero
1
+ Copyright (c) 2026 integer-value-positive-zero
2
2
 
3
3
  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:
4
4
 
package/index.js CHANGED
@@ -1,36 +1,8 @@
1
- require('vanilla-javascript') // because we are making something awesome!
2
- require('vapor-js-npm') // the most awesome and flexible javascript framework
3
- require('none')() // this improves load times and performance
4
-
5
- const n0p3 = require('n0p3')
6
- const assert = require('assert-fn')
7
- const numberPrototype = Number.prototype
8
- const hasSelfEquality = require('has-self-equality')
9
- const hasNoSelfEquality = require('has-no-self-equality')
10
- const isNumberOddOrEven = require('is-number-odd-or-even')
11
- const is0 = require('is-zero')
12
- const attempt = require('attempt-statement')
13
- const not = require('not')
14
- const isNumber = require('is-number')
15
- const isActualNumber = require('is-actual-number')
16
- const t = require('true')
17
- const f = require('false')
1
+ const getIntrinsic = require("es-intrinsic-cache")
2
+ const numberPrototype = getIntrinsic("Number.prototype")
3
+ const valueOf = require("@resolve-es/valueof")
18
4
 
19
5
  module.exports = function IntegerValuePositiveZero() {
20
- const zero = numberPrototype.valueOf()
21
- let result
22
- attempt(() => {
23
- assert(hasSelfEquality(zero), "Zero does not have self equality")
24
- assert(not(hasNoSelfEquality)(zero), "Zero does not have self equality")
25
- assert(is0.isZero(zero), "Zero is not zero")
26
- assert(is0.isPositiveZero(zero), "Zero is not positive zero")
27
- assert(isNumberOddOrEven(zero, f()), "Zero is not odd or even")
28
- assert(isNumber(zero), "Zero is not a number")
29
- assert(isActualNumber(zero, { allowInfinite: f(), allowNumberStrings: f() }), "Zero is not an actual number")
30
- }).rescue(() => {
31
- result = 0
32
- }).else(() => {
33
- result = zero
34
- }).ensure(n0p3)
35
- return (result != null) === t() ? result : 0
36
- }
6
+ const zero = valueOf(numberPrototype)
7
+ return zero
8
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "integer-value-positive-zero",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "The integer value of positive zero",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -15,20 +15,8 @@
15
15
  "author": "tj-commits",
16
16
  "license": "MIT",
17
17
  "dependencies": {
18
- "assert-fn": "^1.0.1",
19
- "attempt-statement": "^1.1.0",
20
- "false": "^0.0.4",
21
- "has-no-self-equality": "^0.0.1",
22
- "has-self-equality": "^0.0.1",
23
- "is-actual-number": "^1.0.2",
24
- "is-finite": "^2.0.0",
25
- "is-number": "^7.0.0",
26
- "is-number-odd-or-even": "^1.0.3",
27
- "is-zero": "^1.0.0",
28
- "n0p3": "^1.0.2",
29
- "not": "^0.1.0",
30
- "true": "^0.0.4",
31
- "vanilla-javascript": "^1.1.1",
32
- "vapor-js-npm": "^1.4.6"
18
+ "@resolve-es/valueof": "^1.0.0",
19
+ "es-intrinsic-cache": "^1.0.4",
20
+ "is-finite": "^2.0.0"
33
21
  }
34
22
  }