Skip to content
This repository was archived by the owner on Sep 3, 2022. It is now read-only.

Commit 6c4436a

Browse files
committed
Types update.
1. Updated version of TypeScript. 2. Autogenerated d.ts file from JSDoc comments.
1 parent cc748c8 commit 6c4436a

File tree

4 files changed

+47
-7
lines changed

4 files changed

+47
-7
lines changed

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"name": "@composi/are-equal",
33
"description": "Function to get the type of the provided value. This is not the same as 'typeof'. It returns the capitalized type: Number, String, Array, Object, Data, RegExp, Symbol, etc.",
4-
"version": "1.0.8",
4+
"version": "1.0.9",
55
"main": "src/index.js",
66
"scripts": {
7-
"checkjs": "tsc --allowJs --checkJs --noEmit --moduleResolution node --target ES6 src/*.js",
7+
"checkjs": "tsc",
88
"format": "prettier --no-semi --single-quote --write ./src/*.js",
99
"lint": "eslint --config ./.eslintrc.json src",
1010
"start": "npm run format && npm run lint && npm run checkjs && npm run test",
@@ -39,7 +39,7 @@
3939
"eslint": "^4.19.1",
4040
"jest": "^24.8.0",
4141
"prettier": "^1.15.2",
42-
"typescript": "^3.1.6"
42+
"typescript": "^3.7.3"
4343
},
4444
"publishConfig": {
4545
"access": "public"

tsconfig.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"compilerOptions": {
3+
"target": "es6",
4+
"allowJs": true,
5+
"checkJs": true,
6+
"moduleResolution": "node",
7+
"alwaysStrict": true,
8+
"strictNullChecks": false,
9+
"emitDeclarationOnly": true,
10+
"declaration": true,
11+
"outDir": "types",
12+
"removeComments": false
13+
},
14+
"files": [
15+
"src/index.js"
16+
],
17+
"exclude": [
18+
"node_modules",
19+
"types"
20+
]
21+
}

types/index.d.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/**
2+
* Compare two values to see if they are equal.
3+
* It does comparison by value.
4+
* It treats equality of truthy/falsy values strictly.
5+
* undefined != null != false, etc.
6+
* Functions doing the same thing but with different names are not equal,
7+
* because their names are different.
8+
* NaN and 0/0 are equal.
9+
* Number(123) === 123
10+
* String('text') === 'text'
11+
* Arrays with the same values but in different orders are not equal:
12+
* [1,2,3,4] !== [1,3,2,4].
13+
* Objects with the same properties in different orders are equal.
14+
* An object with a static property with value equal to object that inherits its property from another object are not equal (prototype inheritance makes them different).
15+
* @param {any} value1 A value to check.
16+
* @param {any} value2 Another value to check.
17+
* @return {boolean} boolean
18+
*/
19+
export function areEqual(value1: any, value2: any): boolean;

0 commit comments

Comments
 (0)