@identity-js/identity 1.2.8 → 1.2.9
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.
- package/index.js +3 -0
- package/package.json +2 -2
- package/test/index.js +12 -0
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@identity-js/identity",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.9",
|
|
4
4
|
"description": "Returns the value passed into the function.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"identity-js"
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@f/identity": "^1.1.1",
|
|
25
|
-
"@identity-js/number-identity": "^1.2.
|
|
25
|
+
"@identity-js/number-identity": "^1.2.3",
|
|
26
26
|
"@identity-js/string-identity": "^1.1.3",
|
|
27
27
|
"@is-(unknown)/is-finite": "^1.0.0",
|
|
28
28
|
"@is-(unknown)/is-string": "^1.0.0",
|
package/test/index.js
CHANGED
|
@@ -12,6 +12,18 @@ describe('identity()', () => {
|
|
|
12
12
|
const input = 3.2
|
|
13
13
|
assert.strictEqual(identity(input), 3.2, "The function should return 3.2")
|
|
14
14
|
})
|
|
15
|
+
|
|
16
|
+
it('should return the same negative number that was passed in', () => {
|
|
17
|
+
const input = -5
|
|
18
|
+
assert.strictEqual(identity(input), -5, 'The function should return the number -5.')
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
it('should return -0 when -0 is passed in', () => {
|
|
22
|
+
const input = -0
|
|
23
|
+
const result = identity(input)
|
|
24
|
+
assert.strictEqual(result, -0, 'The function should return -0.')
|
|
25
|
+
assert.isTrue(Object.is(result, -0), 'The function should return the exact value of -0.')
|
|
26
|
+
})
|
|
15
27
|
|
|
16
28
|
it('should return the same string that was passed in', () => {
|
|
17
29
|
const input = 'hello world'
|