Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion apps/rxjs.dev/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,10 @@
"@types/jasmine": "~3.6.0",
"@types/jasminewd2": "^2.0.3",
"@types/lunr": "^2.3.3",
"@types/node": "^20.6.3",
"@types/node": "^20.11.0",
"@types/svgo": "^1.3.3",
"@types/trusted-types": "^2.0.7",
"@types/yamljs": "^0.2.34",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ran into issues with TypeScript building the dev app and had to add some dev deps and update types in a few files.

"@typescript-eslint/eslint-plugin": "^6.9.0",
"@typescript-eslint/parser": "^6.9.1",
"archiver": "^3.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function decisionTreeReducer(tree: TreeNode[], apiList: FlattenedApiList,

if (!curr.options) {
// we found the function/operator we want to use
const apiNode: FlattenedApiNode = apiList[treeNode.label!];
const apiNode: FlattenedApiNode = apiList[treeNode.label! as keyof FlattenedApiList];
if (!apiNode) {
log.warn(`Decision Tree Generator - (reducer) - warning: Label does not exist in API List: ${treeNode.label}`);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { ApiListNode, TreeNodeRaw } from './interfaces';

export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;

/**
Expand All @@ -20,7 +22,7 @@ export function isStable(stability: string): boolean {
* @param {*} tree
* @returns
*/
export function treeNodeCount(tree) {
export function treeNodeCount(tree: TreeNodeRaw[]) {
return tree.reduce((acc: number, curr) => {
let childSum: number;
if (curr.children) {
Expand All @@ -39,23 +41,22 @@ export function treeNodeCount(tree) {
* @param {*} tree
* @returns
*/
export function rawNodesWithMethodCount(tree) {
return tree.filter(node => {
export function rawNodesWithMethodCount(tree: TreeNodeRaw[]): number {
return tree.filter((node) => {
let childHadMethod = false;

if (node.method) {
return node;
}

if (node.children) {
childHadMethod = rawNodesWithMethodCount(node.children);
childHadMethod = rawNodesWithMethodCount(node.children) > 0;
}

return childHadMethod;
}).length;
}


/**
* Recursively count valid API references
* Deprecated API refs are invalid
Expand All @@ -64,7 +65,7 @@ export function rawNodesWithMethodCount(tree) {
* @param {*} apiList
* @returns
*/
export function validApiRefCount(apiList): number {
export function validApiRefCount(apiList: ApiListNode[]): number {
return apiList.reduce((acc, curr) => {
const itemCount = curr.items.reduce((a, node) => {
if (node.stability === 'deprecated') {
Expand Down
4 changes: 0 additions & 4 deletions packages/rxjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,5 @@
"pre-commit": "lint-staged",
"commit-msg": "validate-commit-msg"
}
},
"peerDependencies": {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what I set out to remove.

"@types/node": "^20.6.3",
"typescript": "^5.2.2"
}
}
20 changes: 10 additions & 10 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2817,12 +2817,12 @@
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.18.63.tgz#1788fa8da838dbb5f9ea994b834278205db6ca2b"
integrity sha512-fAtCfv4jJg+ExtXhvCkCqUKZ+4ok/JQk01qDKhL5BDDoS3AxKXhV5/MAVUZyQnSEd2GT92fkgZl0pz0Q0AzcIQ==

"@types/node@^20.6.3":
version "20.8.8"
resolved "https://registry.yarnpkg.com/@types/node/-/node-20.8.8.tgz#adee050b422061ad5255fc38ff71b2bb96ea2a0e"
integrity sha512-YRsdVxq6OaLfmR9Hy816IMp33xOBjfyOgUd77ehqg96CFywxAPbDbXvAsuN2KVg2HOT8Eh6uAfU+l4WffwPVrQ==
"@types/node@^20.11.0":
version "20.11.0"
resolved "https://registry.yarnpkg.com/@types/node/-/node-20.11.0.tgz#8e0b99e70c0c1ade1a86c4a282f7b7ef87c9552f"
integrity sha512-o9bjXmDNcF7GbM4CNQpmi+TutCgap/K3w1JyKgxAjqx41zp9qlIAVFi0IhCNsJcXolEqLWhbFbEeL0PvYm4pcQ==
dependencies:
undici-types "~5.25.1"
undici-types "~5.26.4"

"@types/parse-json@^4.0.0":
version "4.0.2"
Expand Down Expand Up @@ -2942,6 +2942,11 @@
"@types/unist" "*"
"@types/vfile-message" "*"

"@types/yamljs@^0.2.34":
version "0.2.34"
resolved "https://registry.yarnpkg.com/@types/yamljs/-/yamljs-0.2.34.tgz#c10b1f31b173f2cc93342f27b0796c2eb5b3ae84"
integrity sha512-gJvfRlv9ErxdOv7ux7UsJVePtX54NAvQyd8ncoiFqK8G5aeHIfQfGH2fbruvjAQ9657HwAaO54waS+Dsk2QTUQ==

"@typescript-eslint/eslint-plugin@^6.9.0":
version "6.13.1"
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.13.1.tgz#f98bd887bf95551203c917e734d113bf8d527a0c"
Expand Down Expand Up @@ -15799,11 +15804,6 @@ undefsafe@^2.0.2:
resolved "https://registry.yarnpkg.com/undefsafe/-/undefsafe-2.0.5.tgz#38733b9327bdcd226db889fb723a6efd162e6e2c"
integrity sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==

undici-types@~5.25.1:
version "5.25.3"
resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.25.3.tgz#e044115914c85f0bcbb229f346ab739f064998c3"
integrity sha512-Ga1jfYwRn7+cP9v8auvEXN1rX3sWqlayd4HP7OKk4mZWylEmu3KzXDUGrQUN6Ol7qo1gPvB2e5gX6udnyEPgdA==

undici-types@~5.26.4:
version "5.26.5"
resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617"
Expand Down