binary-tree-typed 1.21.4 → 1.32.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.
- package/.eslintrc.js +65 -0
- package/.prettierignore +6 -0
- package/.prettierrc.js +16 -0
- package/README.md +1 -1
- package/jest.config.js +6 -4
- package/package.json +26 -10
- package/test/index.test.ts +5 -0
package/.eslintrc.js
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
'extends': [
|
|
3
|
+
'plugin:@typescript-eslint/recommended',
|
|
4
|
+
'prettier'
|
|
5
|
+
],
|
|
6
|
+
'rules': {
|
|
7
|
+
'react/display-name': 'off',
|
|
8
|
+
'@next/next/no-img-element': 'off',
|
|
9
|
+
'react/no-unescaped-entities': 'off',
|
|
10
|
+
'import/no-anonymous-default-export': 'off',
|
|
11
|
+
'@typescript-eslint/no-unused-vars': 'error',
|
|
12
|
+
'@typescript-eslint/ban-ts-comment': 'off',
|
|
13
|
+
'@typescript-eslint/no-explicit-any': 'off',
|
|
14
|
+
'@typescript-eslint/no-non-null-assertion': 'off',
|
|
15
|
+
// add new line above comment
|
|
16
|
+
'lines-around-comment': [
|
|
17
|
+
'error',
|
|
18
|
+
{
|
|
19
|
+
'beforeLineComment': false,
|
|
20
|
+
'beforeBlockComment': true,
|
|
21
|
+
'allowBlockStart': true,
|
|
22
|
+
'allowClassStart': true,
|
|
23
|
+
'allowObjectStart': true,
|
|
24
|
+
'allowArrayStart': true
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
// add new line above return
|
|
28
|
+
'newline-before-return': 'off',
|
|
29
|
+
// add new line below import
|
|
30
|
+
'import/newline-after-import': [
|
|
31
|
+
'error',
|
|
32
|
+
{
|
|
33
|
+
'count': 1
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
'@typescript-eslint/ban-types': [
|
|
37
|
+
'error',
|
|
38
|
+
{
|
|
39
|
+
'extendDefaults': true,
|
|
40
|
+
'types': {
|
|
41
|
+
'{}': false
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
'plugins': [
|
|
47
|
+
'import'
|
|
48
|
+
],
|
|
49
|
+
'settings': {
|
|
50
|
+
'import/parsers': {
|
|
51
|
+
'@typescript-eslint/parser': [
|
|
52
|
+
'.ts',
|
|
53
|
+
'.tsx'
|
|
54
|
+
]
|
|
55
|
+
},
|
|
56
|
+
'import/resolver': {
|
|
57
|
+
'typescript': {
|
|
58
|
+
'alwaysTryTypes': true,
|
|
59
|
+
'project': [
|
|
60
|
+
'./tsconfig.json'
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
package/.prettierignore
ADDED
package/.prettierrc.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
arrowParens: 'avoid',
|
|
3
|
+
bracketSpacing: true,
|
|
4
|
+
htmlWhitespaceSensitivity: 'css',
|
|
5
|
+
insertPragma: false,
|
|
6
|
+
bracketSameLine: false,
|
|
7
|
+
jsxSingleQuote: true,
|
|
8
|
+
printWidth: 120,
|
|
9
|
+
proseWrap: 'preserve',
|
|
10
|
+
quoteProps: 'as-needed',
|
|
11
|
+
requirePragma: false,
|
|
12
|
+
singleQuote: true,
|
|
13
|
+
tabWidth: 2,
|
|
14
|
+
trailingComma: 'none',
|
|
15
|
+
useTabs: false
|
|
16
|
+
}
|
package/README.md
CHANGED
package/jest.config.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
preset: 'ts-jest',
|
|
3
|
+
testEnvironment: 'node',
|
|
4
|
+
testMatch: ['<rootDir>/test/**/*.test.ts', '<rootDir>/test/**/*.test.js'],
|
|
5
|
+
collectCoverage: true,
|
|
6
|
+
coverageDirectory: 'coverage'
|
|
7
|
+
};
|
package/package.json
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "binary-tree-typed",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.32.0",
|
|
4
4
|
"description": "Binary Tree. Javascript & Typescript Data Structure.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "rm -rf dist && npx tsc",
|
|
8
|
+
"lint": "eslint --fix \"src/**/*.{js,ts}\"",
|
|
9
|
+
"format": "prettier --write \"src/**/*.{js,ts}\"",
|
|
8
10
|
"test": "jest",
|
|
9
11
|
"build:docs": "typedoc --out docs ./src",
|
|
10
12
|
"deps:check": "dependency-cruiser src",
|
|
@@ -16,29 +18,37 @@
|
|
|
16
18
|
},
|
|
17
19
|
"keywords": [
|
|
18
20
|
"Binary Tree",
|
|
21
|
+
"perfect",
|
|
22
|
+
"full",
|
|
23
|
+
"binary",
|
|
24
|
+
"tree",
|
|
19
25
|
"DFS",
|
|
20
|
-
"DFSIterative",
|
|
21
26
|
"BFS",
|
|
27
|
+
"Iterative",
|
|
28
|
+
"Recursive",
|
|
29
|
+
"Javascript",
|
|
30
|
+
"Typescript",
|
|
22
31
|
"Node",
|
|
23
|
-
"Parent",
|
|
24
|
-
"Child",
|
|
25
32
|
"Root",
|
|
26
33
|
"Leaf",
|
|
27
34
|
"Depth",
|
|
28
35
|
"Height",
|
|
29
36
|
"Traversal",
|
|
37
|
+
"pre",
|
|
38
|
+
"in",
|
|
39
|
+
"post",
|
|
40
|
+
"level",
|
|
41
|
+
"order",
|
|
30
42
|
"Pre-order",
|
|
31
43
|
"In-order",
|
|
32
44
|
"Post-order",
|
|
33
45
|
"Level-order",
|
|
34
46
|
"Balanced",
|
|
35
|
-
"Unbalanced",
|
|
36
47
|
"Full Binary Tree",
|
|
37
48
|
"Complete Binary Tree",
|
|
38
49
|
"Perfect Binary Tree",
|
|
39
50
|
"Binary Search Tree",
|
|
40
|
-
"Binary Expression Tree"
|
|
41
|
-
"Binary Heap"
|
|
51
|
+
"Binary Expression Tree"
|
|
42
52
|
],
|
|
43
53
|
"author": "Tyler Zeng zrwusa@gmail.com",
|
|
44
54
|
"license": "MIT",
|
|
@@ -50,13 +60,19 @@
|
|
|
50
60
|
"devDependencies": {
|
|
51
61
|
"@types/jest": "^29.5.3",
|
|
52
62
|
"@types/node": "^20.4.9",
|
|
53
|
-
"
|
|
63
|
+
"@typescript-eslint/eslint-plugin": "^5.6.0",
|
|
64
|
+
"@typescript-eslint/parser": "^5.11.0",
|
|
65
|
+
"eslint": "^7.32.0",
|
|
66
|
+
"eslint-config-prettier": "^8.3.0",
|
|
67
|
+
"eslint-import-resolver-alias": "^1.1.2",
|
|
68
|
+
"eslint-import-resolver-typescript": "^2.5.0",
|
|
69
|
+
"eslint-plugin-import": "^2.25.4",
|
|
54
70
|
"jest": "^29.6.2",
|
|
71
|
+
"prettier": "^3.0.3",
|
|
55
72
|
"ts-jest": "^29.1.1",
|
|
56
|
-
"typedoc": "^0.24.8",
|
|
57
73
|
"typescript": "^4.9.5"
|
|
58
74
|
},
|
|
59
75
|
"dependencies": {
|
|
60
|
-
"data-structure-typed": "^1.
|
|
76
|
+
"data-structure-typed": "^1.32.0"
|
|
61
77
|
}
|
|
62
78
|
}
|