@digitransit-search-util/digitransit-search-util-tru-eq 0.0.2 → 0.0.4
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/README.md +2 -13
- package/package.json +5 -4
- package/test.js +7 -9
package/README.md
CHANGED
|
@@ -8,8 +8,8 @@ accept equality of non nullish values
|
|
|
8
8
|
|
|
9
9
|
### Parameters
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
* `val1` **([Boolean][1] | [Number][2] | BigInt | [String][3] | [Symbol][4] | [Object][5])** First value to be compared
|
|
12
|
+
* `param2` **([Boolean][1] | [Number][2] | BigInt | [String][3] | [Symbol][4] | [Object][5])** Second value to be compared
|
|
13
13
|
|
|
14
14
|
### Examples
|
|
15
15
|
|
|
@@ -29,11 +29,6 @@ Returns **[Boolean][1]** true/false
|
|
|
29
29
|
[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol
|
|
30
30
|
|
|
31
31
|
[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
|
|
32
|
-
|
|
33
|
-
<!-- This file is automatically generated. Please don't edit it directly:
|
|
34
|
-
if you find an error, edit the source file (likely index.js), and re-run
|
|
35
|
-
./scripts/generate-readmes in the digitransit-util project. -->
|
|
36
|
-
|
|
37
32
|
---
|
|
38
33
|
|
|
39
34
|
This module is part of the Digitransit-ui project. It is maintained in the
|
|
@@ -47,9 +42,3 @@ Install this module individually:
|
|
|
47
42
|
```sh
|
|
48
43
|
$ npm install @digitransit-search-util/digitransit-search-util-tru-eq
|
|
49
44
|
```
|
|
50
|
-
|
|
51
|
-
Or install the Digitransit-util module that includes it as a function:
|
|
52
|
-
|
|
53
|
-
```sh
|
|
54
|
-
$ npm install @digitransit-util/digitransit-util
|
|
55
|
-
```
|
package/package.json
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@digitransit-search-util/digitransit-search-util-tru-eq",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"description": "digitransit-search-util tru-eq module",
|
|
5
5
|
"main": "index.js",
|
|
6
|
+
"type": "module",
|
|
6
7
|
"publishConfig": {
|
|
7
8
|
"access": "public"
|
|
8
9
|
},
|
|
9
10
|
"scripts": {
|
|
10
|
-
"test": "
|
|
11
|
-
"docs": "node
|
|
11
|
+
"test": "vitest run --config ../../../config/vitest.config.js \"$PWD/test.js\"",
|
|
12
|
+
"docs": "node ../../../scripts/workspace-packages/generate-readmes.mjs"
|
|
12
13
|
},
|
|
13
14
|
"repository": {
|
|
14
15
|
"type": "git",
|
|
@@ -20,5 +21,5 @@
|
|
|
20
21
|
],
|
|
21
22
|
"author": "Digitransit Authors",
|
|
22
23
|
"license": "(AGPL-3.0 OR EUPL-1.2)",
|
|
23
|
-
"gitHead": "
|
|
24
|
+
"gitHead": "3ea16b8aa7ff98fa4d58f72aed40ac0cda27c85f"
|
|
24
25
|
}
|
package/test.js
CHANGED
|
@@ -1,28 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import { describe, it } from 'mocha';
|
|
4
|
-
import truEq from '.';
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import truEq from './index.js';
|
|
5
3
|
|
|
6
4
|
describe('Testing @digitransit-util/digitransit-util-tru-eq module', () => {
|
|
7
5
|
it('Checking that true is true', () => {
|
|
8
6
|
const retValue = truEq(true, true);
|
|
9
|
-
expect(true).
|
|
7
|
+
expect(true).toBe(retValue);
|
|
10
8
|
});
|
|
11
9
|
it('Checking that values dont match ', () => {
|
|
12
10
|
const retValue = truEq(2, '2');
|
|
13
|
-
expect(false).
|
|
11
|
+
expect(false).toBe(retValue);
|
|
14
12
|
});
|
|
15
13
|
it('Checking that values match ', () => {
|
|
16
14
|
const retValue = truEq('2', '2');
|
|
17
|
-
expect(true).
|
|
15
|
+
expect(true).toBe(retValue);
|
|
18
16
|
});
|
|
19
17
|
it('Checking that null values returns null', () => {
|
|
20
18
|
const retValue = truEq(null, null);
|
|
21
|
-
expect(null).
|
|
19
|
+
expect(null).toBe(retValue);
|
|
22
20
|
});
|
|
23
21
|
it('Checking object equality ', () => {
|
|
24
22
|
const obj = { name: 'hey' };
|
|
25
23
|
const retValue = truEq(obj, obj);
|
|
26
|
-
expect(true).
|
|
24
|
+
expect(true).toBe(retValue);
|
|
27
25
|
});
|
|
28
26
|
});
|