diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d23ef962..aa869a58c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,10 @@ Dates are in `YYYY-MM-DD` format and versions are in [semantic versioning](http: - [#488](https://github.com/wordplaydev/wordplay/issues/488). Added animations off indicator on stage. - [#500](https://github.com/wordplaydev/wordplay/issues/500). Improved explanation when there's a space between an evaluation's name and inputs. +### Maintenance + +- Upgraded to TypeScript 5.5. + ## 0.10.1 2024-06-22 ### Fixed diff --git a/package-lock.json b/package-lock.json index d82f09e03..b8618963c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -51,7 +51,7 @@ "ts-json-schema-generator": "^1", "tslib": "^2.6", "tsx": "^4.7.0", - "typescript": "^5.4", + "typescript": "^5.5.2", "vite": "^5.2.7", "vite-plugin-eslint": "^1.8.1", "vitest": "^1.4.0" @@ -4367,9 +4367,9 @@ "peer": true }, "node_modules/colorjs.io": { - "version": "0.4.5", - "resolved": "https://registry.npmjs.org/colorjs.io/-/colorjs.io-0.4.5.tgz", - "integrity": "sha512-yCtUNCmge7llyfd/Wou19PMAcf5yC3XXhgFoAh6zsO2pGswhUPBaaUh8jzgHnXtXuZyFKzXZNAnyF5i+apICow==" + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/colorjs.io/-/colorjs.io-0.5.2.tgz", + "integrity": "sha512-twmVoizEW7ylZSN32OgKdXRmo1qg+wT5/6C3xu5b9QsWzSFAhHLn2xd8ro0diCsKfCj1RdaTP/nrcW+vAoQPIw==" }, "node_modules/combined-stream": { "version": "1.0.8", @@ -10626,9 +10626,9 @@ } }, "node_modules/typescript": { - "version": "5.4.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.3.tgz", - "integrity": "sha512-KrPd3PKaCLr78MalgiwJnA25Nm8HAmdwN3mYUYZgG/wizIo9EainNVQI9/yDavtVFRN2h3k8uf3GLHuhDMgEHg==", + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.2.tgz", + "integrity": "sha512-NcRtPEOsPFFWjobJEtfihkLCZCXZt/os3zf8nTxjVH3RvTSxjrCamJpbExGvYOF+tFHc3pA65qpdwPbzjohhew==", "dev": true, "bin": { "tsc": "bin/tsc", diff --git a/package.json b/package.json index 69e9f74c4..c9d9bf1ba 100644 --- a/package.json +++ b/package.json @@ -73,7 +73,7 @@ "ts-json-schema-generator": "^1", "tslib": "^2.6", "tsx": "^4.7.0", - "typescript": "^5.4", + "typescript": "^5.5.2", "vite": "^5.2.7", "vite-plugin-eslint": "^1.8.1", "vitest": "^1.4.0" @@ -81,7 +81,7 @@ "type": "module", "dependencies": { "@axe-core/playwright": "^4.8.5", - "colorjs.io": "^0", + "colorjs.io": "^5.2", "decimal.js": "^10", "dexie": "^4.0", "firebase": "^10.11.0", diff --git a/src/components/editor/Editor.svelte b/src/components/editor/Editor.svelte index e53e156f7..c1f081c73 100644 --- a/src/components/editor/Editor.svelte +++ b/src/components/editor/Editor.svelte @@ -637,9 +637,8 @@ spaceView instanceof HTMLElement && spaceView.dataset.id ? parseInt(spaceView.dataset.id) : undefined; - return tokenID - ? [source.getNodeByID(tokenID) as Token, spaceView] - : undefined; + const node = tokenID ? source.getNodeByID(tokenID) : undefined; + return node instanceof Token ? [node, spaceView] : undefined; } function getCaretPositionAt(event: PointerEvent): number | undefined { diff --git a/src/nodes/Token.ts b/src/nodes/Token.ts index 5d276dcf2..357faec28 100644 --- a/src/nodes/Token.ts +++ b/src/nodes/Token.ts @@ -52,7 +52,7 @@ export default class Token extends Node { return []; } - isLeaf() { + isLeaf(): this is Token { return true; }