diff --git a/.eslintignore b/.eslintignore deleted file mode 120000 index 3e4e48b0..00000000 --- a/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -.gitignore \ No newline at end of file diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index cd0b60e4..00000000 --- a/.eslintrc.js +++ /dev/null @@ -1,60 +0,0 @@ -module.exports = { - root: true, - - env: { - browser: true, - commonjs: true, - es6: true, - jest: true, - node: true, - }, - - settings: { - react: { - version: "detect", - }, - }, - - parser: "@typescript-eslint/parser", - parserOptions: { - ecmaFeatures: { - jsx: true, - }, - ecmaVersion: "latest", - sourceType: "module", - warnOnUnsupportedTypeScriptVersion: true, - }, - - plugins: ["@typescript-eslint", "import", "react", "react-hooks"], - - extends: [ - "eslint:recommended", - "plugin:@typescript-eslint/eslint-recommended", // disables eslint:recommended rules that conflict with typescript - "plugin:@typescript-eslint/recommended", - "prettier", // disables rules that conflict with prettier - "plugin:import/errors", - "plugin:import/warnings", - "plugin:import/typescript", - "plugin:react/recommended", - "plugin:react/jsx-runtime", - "plugin:react-hooks/recommended", - ], - - rules: { - // doesn't get along well with .js extensions (needed so node "type": module works) - "import/no-unresolved": "off", - // "import/no-cycle": ["error", { ignoreExternal: true }], - "@typescript-eslint/no-empty-function": "off", - "@typescript-eslint/no-non-null-assertion": "off", - "@typescript-eslint/no-empty-interface": "off", - "@typescript-eslint/no-this-alias": "off", - "@typescript-eslint/no-explicit-any": "off", // perhaps we should re-enable this in the future - "@typescript-eslint/no-unused-vars": [ - "warn", - { - args: "none", - ignoreRestSiblings: true, - }, - ], - }, -} diff --git a/.vscode/settings.json b/.vscode/settings.json index 77d24dc7..c6e2a5b9 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -15,5 +15,6 @@ "search.exclude": { "**/.yarn": true, "**/.pnp.*": true - } + }, + "eslint.experimental.useFlatConfig": true } diff --git a/apps/benchmark/.eslintignore b/apps/benchmark/.eslintignore deleted file mode 120000 index 3e4e48b0..00000000 --- a/apps/benchmark/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -.gitignore \ No newline at end of file diff --git a/apps/site/docs/examples/clientServer/server.ts b/apps/site/docs/examples/clientServer/server.ts index ffbf21b2..07dda15d 100644 --- a/apps/site/docs/examples/clientServer/server.ts +++ b/apps/site/docs/examples/clientServer/server.ts @@ -43,7 +43,9 @@ class Server { if (serializedActionCallToReplicate) { setTimeout(() => { // and distribute message, which includes new model IDs to keep them in sync - this.msgListeners.forEach((listener) => listener(serializedActionCallToReplicate!)) + this.msgListeners.forEach((listener) => { + listener(serializedActionCallToReplicate) + }) }, 500) } }, 500) diff --git a/apps/site/docs/examples/todoList/app.tsx b/apps/site/docs/examples/todoList/app.tsx index 4e020d9c..ffe457b9 100644 --- a/apps/site/docs/examples/todoList/app.tsx +++ b/apps/site/docs/examples/todoList/app.tsx @@ -27,8 +27,12 @@ export const TodoListView = observer(({ list }: { list: TodoList }) => { key={todo.id} done={todo.done} text={todo.text} - onClick={() => todo.setDone(!todo.done)} - onRemove={() => list.remove(todo)} + onClick={() => { + todo.setDone(!todo.done) + }} + onRemove={() => { + list.remove(todo) + }} /> ) diff --git a/apps/site/docs/examples/todoList/store.ts b/apps/site/docs/examples/todoList/store.ts index 2c5470c5..17fa4804 100644 --- a/apps/site/docs/examples/todoList/store.ts +++ b/apps/site/docs/examples/todoList/store.ts @@ -101,7 +101,6 @@ export function createRootStore(): TodoList { registerRootStore(rootStore) // we can also connect the store to the redux dev tools - // eslint-disable-next-line @typescript-eslint/no-var-requires const remotedev = require("remotedev") const connection = remotedev.connectViaExtension({ name: "Todo List Example", diff --git a/apps/site/docs/examples/yjsBinding/appInstance.tsx b/apps/site/docs/examples/yjsBinding/appInstance.tsx index 8ae274a3..ef606807 100644 --- a/apps/site/docs/examples/yjsBinding/appInstance.tsx +++ b/apps/site/docs/examples/yjsBinding/appInstance.tsx @@ -80,7 +80,12 @@ export const AppInstance = observer(() => {
{status.connected ? "Online (sync enabled)" : "Offline (sync disabled)"}
- diff --git a/apps/site/package.json b/apps/site/package.json index ec8df734..33a9641e 100644 --- a/apps/site/package.json +++ b/apps/site/package.json @@ -36,7 +36,7 @@ "@docusaurus/module-type-aliases": "^3.2.1", "@docusaurus/tsconfig": "^3.2.1", "@svgr/webpack": "^8.1.0", - "@types/react": "^18.2.74", + "@types/react": "^18.2.75", "@types/react-dom": "^18.2.24", "@types/uuid": "^9.0.8", "raw-loader": "^4.0.2", diff --git a/apps/site/tsconfig.json b/apps/site/tsconfig.json index 98660dd6..35879199 100644 --- a/apps/site/tsconfig.json +++ b/apps/site/tsconfig.json @@ -3,6 +3,7 @@ "extends": "@docusaurus/tsconfig", "compilerOptions": { "baseUrl": ".", - "experimentalDecorators": true + "experimentalDecorators": true, + "strict": true } } diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 00000000..06d6a51d --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,119 @@ +import { FlatCompat } from "@eslint/eslintrc" +import eslint from "@eslint/js" +import eslintConfigPrettier from "eslint-config-prettier" +import eslintPluginReactConfigsJsxRuntime from "eslint-plugin-react/configs/jsx-runtime.js" +import eslintPluginReactConfigsRecommended from "eslint-plugin-react/configs/recommended.js" +import globals from "globals" +import path from "path" +import tseslint from "typescript-eslint" +import { fileURLToPath } from "url" + +const __filename = fileURLToPath(import.meta.url) +const __dirname = path.dirname(__filename) + +const compat = new FlatCompat({ + baseDirectory: __dirname, +}) + +export default tseslint.config( + { + ignores: [ + "eslint.config.*", + "**/node_modules", + ".idea", + "*.log", + "**/.turbo", + "**/.DS_Store", + ".yarn/*", + "!.yarn/patches", + "!.yarn/releases", + "!.yarn/plugins", + "!.yarn/sdks", + "!.yarn/versions", + ".pnp.*", + "packages/lib/dist", + "packages/lib/coverage", + "packages/lib/api-docs", + "packages/mobx-keystone-yjs/dist", + "packages/mobx-keystone-yjs/coverage", + "apps/benchmark/dist", + ], + }, + eslint.configs.recommended, + ...tseslint.configs.strictTypeChecked, + ...tseslint.configs.stylisticTypeChecked, // TODO: reenable? + eslintConfigPrettier, + { + languageOptions: { + parserOptions: { + project: true, + tsconfigDirName: import.meta.dirname, + ecmaFeatures: { + jsx: true, + }, + ecmaVersion: "latest", + warnOnUnsupportedTypeScriptVersion: true, + }, + globals: { + ...globals.browser, + ...globals.commonjs, + ...globals.es2021, + ...globals.jest, + ...globals.node, + }, + }, + }, + // TODO: not working right now with flat configs + //...compat.extends("plugin:import/errors", "plugin:import/warnings", "plugin:import/typescript"), + eslintPluginReactConfigsRecommended, + eslintPluginReactConfigsJsxRuntime, + ...compat.extends("plugin:react-hooks/recommended"), + { + rules: { + // doesn't get along well with .js extensions (needed so node "type": module works) + "import/no-unresolved": "off", + // "import/no-cycle": ["error", { ignoreExternal: true }], + "@typescript-eslint/no-non-null-assertion": "off", + "@typescript-eslint/no-this-alias": "off", + "@typescript-eslint/no-unused-vars": [ + "warn", + { + args: "none", + ignoreRestSiblings: true, + }, + ], + "@typescript-eslint/no-empty-function": "off", + "@typescript-eslint/array-type": "off", + "@typescript-eslint/restrict-template-expressions": "off", + "@typescript-eslint/no-invalid-void-type": "off", + "@typescript-eslint/no-unnecessary-type-arguments": "off", + "@typescript-eslint/no-unnecessary-condition": "off", // bothers more than helps + "@typescript-eslint/unified-signatures": "off", + "@typescript-eslint/prefer-for-of": "off", + "@typescript-eslint/no-empty-interface": "off", + "@typescript-eslint/consistent-indexed-object-style": "off", + // perhaps we should re-enable these in the future + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/no-unsafe-return": "off", + "@typescript-eslint/no-unsafe-argument": "off", + "@typescript-eslint/no-unsafe-assignment": "off", + "@typescript-eslint/no-unsafe-member-access": "off", + }, + }, + { + files: ["packages/lib/test/**"], + rules: { + "@typescript-eslint/unbound-method": "off", + }, + }, + { + files: ["apps/site/docs/examples/**"], + rules: { + "@typescript-eslint/no-var-requires": "off", + "@typescript-eslint/no-unsafe-assignment": "off", + "@typescript-eslint/no-unsafe-member-access": "off", + "@typescript-eslint/no-unsafe-call": "off", + "@typescript-eslint/no-unused-vars": "off", + }, + } +) diff --git a/package.json b/package.json index 2473d226..127cd44a 100644 --- a/package.json +++ b/package.json @@ -28,19 +28,21 @@ "yjs": "^13.6.14" }, "devDependencies": { - "@typescript-eslint/eslint-plugin": "^7.5.0", - "@typescript-eslint/parser": "^7.5.0", + "@eslint/eslintrc": "^3.0.2", + "@eslint/js": "^9.0.0", "codecov": "^3.8.3", "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-import": "^2.29.1", "eslint-plugin-react": "^7.34.1", "eslint-plugin-react-hooks": "^4.6.0", - "netlify-cli": "^17.21.2", + "globals": "^15.0.0", + "netlify-cli": "^17.22.0", "prettier": "^3.2.5", "prettier-plugin-organize-imports": "^3.2.4", "turbo": "^1.13.2", - "typescript": "^5.4.4" + "typescript": "^5.4.4", + "typescript-eslint": "^7.6.0" }, "packageManager": "yarn@4.1.1" } diff --git a/packages/lib/.eslintignore b/packages/lib/.eslintignore deleted file mode 120000 index 3e4e48b0..00000000 --- a/packages/lib/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -.gitignore \ No newline at end of file diff --git a/packages/lib/package.json b/packages/lib/package.json index 18331a67..7f42a522 100755 --- a/packages/lib/package.json +++ b/packages/lib/package.json @@ -72,10 +72,10 @@ "@babel/plugin-proposal-decorators": "^7.24.1", "@babel/preset-env": "^7.24.4", "@babel/preset-typescript": "^7.24.1", - "@swc/core": "^1.4.12", + "@swc/core": "^1.4.13", "@swc/jest": "^0.2.36", "@types/jest": "^29.5.12", - "@types/node": "^20.12.5", + "@types/node": "^20.12.6", "babel-jest": "^29.7.0", "jest": "^29.7.0", "mobx-v4": "npm:mobx@^4.15.7", @@ -85,7 +85,7 @@ "spec.ts": "^1.1.3", "ts-jest": "^29.1.2", "ts-node": "^10.9.2", - "typedoc": "^0.25.12", + "typedoc": "^0.25.13", "typescript": "^5.4.4", "vite": "^5.2.8" }, diff --git a/packages/lib/src/action/applyAction.ts b/packages/lib/src/action/applyAction.ts index 33c4fc30..e694a036 100644 --- a/packages/lib/src/action/applyAction.ts +++ b/packages/lib/src/action/applyAction.ts @@ -41,7 +41,7 @@ export interface ActionCall { /** * Marks this action call as non-serialized. */ - readonly serialized?: undefined + readonly serialized?: boolean } const builtInActionToFunction = { @@ -87,7 +87,7 @@ export function applyAction(subtreeRoot: object, call: ActionCall): assertTweakedObject(current, `resolved ${current}`, true) if (isBuiltInAction(call.actionName)) { - const fnToCall: AnyFunction = builtInActionToFunction[call.actionName] + const fnToCall = builtInActionToFunction[call.actionName] as AnyFunction | undefined if (!fnToCall) { throw failure(`assertion failed: unknown built-in action - ${call.actionName}`) } @@ -102,6 +102,7 @@ export function applyAction(subtreeRoot: object, call: ActionCall): const dataModelAction = getDataModelAction(call.actionName) if (dataModelAction) { const instance: any = new dataModelAction.modelClass(current) + // eslint-disable-next-line @typescript-eslint/no-unsafe-call return instance[dataModelAction.fnName](...call.args) } @@ -110,5 +111,6 @@ export function applyAction(subtreeRoot: object, call: ActionCall): return standaloneAction.apply(current, call.args as any) } + // eslint-disable-next-line @typescript-eslint/no-unsafe-call return (current as any)[call.actionName].apply(current, call.args) } diff --git a/packages/lib/src/action/applyDelete.ts b/packages/lib/src/action/applyDelete.ts index da9eef13..4bec807a 100644 --- a/packages/lib/src/action/applyDelete.ts +++ b/packages/lib/src/action/applyDelete.ts @@ -21,7 +21,7 @@ export function applyDelete(node: O, fieldN * @internal */ export function internalApplyDelete(this: O, fieldName: string | number): void { - remove(this, "" + fieldName) + remove(this, String(fieldName)) } const wrappedInternalApplyDelete = lazy(() => diff --git a/packages/lib/src/action/applyMethodCall.ts b/packages/lib/src/action/applyMethodCall.ts index c87a7d16..40c7127f 100644 --- a/packages/lib/src/action/applyMethodCall.ts +++ b/packages/lib/src/action/applyMethodCall.ts @@ -25,6 +25,7 @@ export function applyMethodCall boolean /** * An action middleware function. * Rember to `return next()` if you want to continue the action or throw if you want to cancel it. */ - middleware(ctx: ActionContext, next: () => any): any + middleware: (ctx: ActionContext, next: () => any) => any } /** @@ -52,7 +52,7 @@ export function forEachActionMiddleware( // since an array like [a, b, c] will be called like c(b(a())) this means that we need to call // the parent object ones at the end of the array - let current: unknown | undefined = obj + let current: unknown = obj while (current) { const objMwares = perObjectActionMiddlewares.get(current) if (objMwares && objMwares.length > 0) { @@ -88,7 +88,7 @@ export function addActionMiddleware(mware: ActionMiddleware): ActionMiddlewareDi if (subtreeRoot) { const targetFilter = (ctx: ActionContext) => - ctx.target === subtreeRoot || isChildOfParent(ctx.target, subtreeRoot!) + ctx.target === subtreeRoot || isChildOfParent(ctx.target, subtreeRoot) if (!filter) { filter = targetFilter @@ -102,7 +102,7 @@ export function addActionMiddleware(mware: ActionMiddleware): ActionMiddlewareDi const actualMware = { middleware, filter } - let objMwares = perObjectActionMiddlewares.get(subtreeRoot)! + let objMwares = perObjectActionMiddlewares.get(subtreeRoot) if (!objMwares) { objMwares = [actualMware] perObjectActionMiddlewares.set(subtreeRoot, objMwares) diff --git a/packages/lib/src/action/modelFlow.ts b/packages/lib/src/action/modelFlow.ts index 358320b4..ee5943a5 100644 --- a/packages/lib/src/action/modelFlow.ts +++ b/packages/lib/src/action/modelFlow.ts @@ -132,6 +132,7 @@ export function flow({ function next(ret: any): void { if (ret && typeof ret.then === "function") { // an async iterator + // eslint-disable-next-line @typescript-eslint/no-unsafe-call ret.then(next, reject) } else if (ret.done) { // done @@ -247,6 +248,8 @@ function* promiseGenerator( // above code but compiled by TS for ES5 // so we don't include a dependency to regenerator runtime +/* eslint-disable */ + const __generator = function (thisArg: any, body: any) { let _: any = { label: 0, @@ -285,8 +288,8 @@ const __generator = function (thisArg: any, body: any) { op[0] & 2 ? y["return"] : op[0] - ? y["throw"] || ((t = y["return"]) && t.call(y), 0) - : y.next) && + ? y["throw"] || ((t = y["return"]) && t.call(y), 0) + : y.next) && !(t = t.call(y, op[1])).done) ) return t @@ -360,3 +363,5 @@ function promiseGenerator(this: Promise) { } }) } + +/* eslint-enable */ diff --git a/packages/lib/src/actionMiddlewares/readonlyMiddleware.ts b/packages/lib/src/actionMiddlewares/readonlyMiddleware.ts index e784d0d3..d57587aa 100644 --- a/packages/lib/src/actionMiddlewares/readonlyMiddleware.ts +++ b/packages/lib/src/actionMiddlewares/readonlyMiddleware.ts @@ -12,7 +12,7 @@ import { * Return type for readonly middleware. */ export interface ReadonlyMiddlewareReturn { - allowWrite(fn: () => R): R + allowWrite: (fn: () => R) => R dispose: ActionMiddlewareDisposer } diff --git a/packages/lib/src/actionMiddlewares/undoMiddleware.ts b/packages/lib/src/actionMiddlewares/undoMiddleware.ts index 9fdd9ad1..9af6fd4f 100644 --- a/packages/lib/src/actionMiddlewares/undoMiddleware.ts +++ b/packages/lib/src/actionMiddlewares/undoMiddleware.ts @@ -542,7 +542,7 @@ export class UndoManager { // use bound functions to fix es6 compilation const genNext = gen.next.bind(gen) - const genThrow = gen.throw!.bind(gen) + const genThrow = gen.throw.bind(gen) const promise = new Promise(function (resolve, reject) { function onFulfilled(res: any): void { @@ -552,7 +552,7 @@ export class UndoManager { ret = genNext(res) } catch (e) { group.end() - reject(e) + reject(e as Error) return } @@ -567,7 +567,7 @@ export class UndoManager { ret = genThrow(err) } catch (e) { group.end() - reject(e) + reject(e as Error) return } @@ -578,6 +578,7 @@ export class UndoManager { function next(ret: any): void { if (ret && typeof ret.then === "function") { // an async iterator + // eslint-disable-next-line @typescript-eslint/no-unsafe-call ret.then(next, reject) } else if (ret.done) { // done @@ -610,6 +611,7 @@ export class UndoManager { private readonly options: UndoMiddlewareOptions | undefined ) { if (getMobxVersion() >= 6) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-call mobx6.makeObservable(this) } diff --git a/packages/lib/src/computedTree/computedTree.ts b/packages/lib/src/computedTree/computedTree.ts index 2dbccfad..662be7dc 100644 --- a/packages/lib/src/computedTree/computedTree.ts +++ b/packages/lib/src/computedTree/computedTree.ts @@ -67,7 +67,7 @@ export function computedTree(...args: any[]): any { return tweakedValue } - const runLateInit = (instance: any, original: any, propertyKey: string) => { + const runLateInit = (instance: any, original: () => any, propertyKey: string) => { const c = computed(() => original.call(instance), { keepAlive: true }) const newValue = c.get() const tweakedValue = tweakComputedTreeNode(newValue, instance, propertyKey) diff --git a/packages/lib/src/dataModel/BaseDataModel.ts b/packages/lib/src/dataModel/BaseDataModel.ts index e08e1845..33711c00 100644 --- a/packages/lib/src/dataModel/BaseDataModel.ts +++ b/packages/lib/src/dataModel/BaseDataModel.ts @@ -68,7 +68,7 @@ export abstract class BaseDataModel { } // eslint-disable-next-line prefer-rest-params - const { modelClass: _modelClass }: DataModelConstructorOptions = arguments[1] as any + const { modelClass: _modelClass }: DataModelConstructorOptions = arguments[1] const modelClass = _modelClass! type Data = ModelPropsToUntransformedData @@ -93,7 +93,7 @@ export abstract class BaseDataModel { const k = modelPropsKeys[i] const propData = modelProps[k] - let newValue = initialData![k] + let newValue = initialData[k] let changed = false // apply untransform (if any) @@ -139,6 +139,7 @@ export abstract class BaseDataModel { const self = this as any // delete unnecessary props + // eslint-disable-next-line @typescript-eslint/no-dynamic-delete delete self[propsTypeSymbol] internalNewDataModel(this, tweakedData as any, { @@ -182,5 +183,6 @@ export interface AnyDataModel extends BaseDataModel {} * A data model class declaration, made of a base model and the model interface. */ export type DataModelClassDeclaration = BaseModelClass & { + // eslint-disable-next-line @typescript-eslint/prefer-function-type (...args: any[]): ModelInterface } diff --git a/packages/lib/src/dataModel/DataModel.ts b/packages/lib/src/dataModel/DataModel.ts index 3620a927..29cce9d0 100644 --- a/packages/lib/src/dataModel/DataModel.ts +++ b/packages/lib/src/dataModel/DataModel.ts @@ -22,7 +22,10 @@ export type _ComposedData = SuperModel ex : ModelPropsToUntransformedCreationData | ModelPropsToTransformedCreationData export interface _DataModel { - new (data: _ComposedData): SuperModel & + // eslint-disable-next-line @typescript-eslint/prefer-function-type + new ( + data: _ComposedData + ): SuperModel & BaseDataModel & Omit, BaseDataModelKeys> & ModelPropsToSetter @@ -39,7 +42,7 @@ export interface _DataModel { export function ExtendedDataModel< TProps extends ModelProps, TModel extends AnyDataModel, - A extends [] + A extends [], >( genFn: (...args: A) => { baseModel: AbstractModelClass @@ -65,13 +68,13 @@ export function ExtendedDataModel( ...args: any[] ): _DataModel { - let baseModel - let modelProps + let baseModel: AbstractModelClass + let modelProps: TProps if (isDataModelClass(args[0])) { baseModel = args[0] modelProps = args[1] } else { - const gen = args[0]() + const gen = (args[0] as () => { baseModel: ModelClass; props: TProps })() baseModel = gen.baseModel modelProps = gen.props diff --git a/packages/lib/src/model/BaseModel.ts b/packages/lib/src/model/BaseModel.ts index b3d4ea2e..b40996b3 100644 --- a/packages/lib/src/model/BaseModel.ts +++ b/packages/lib/src/model/BaseModel.ts @@ -131,16 +131,20 @@ export abstract class BaseModel< const initialData = data as any const { snapshotInitialData, modelClass, generateNewIds }: ModelConstructorOptions = // eslint-disable-next-line prefer-rest-params - arguments[1] as any + arguments[1] Object.setPrototypeOf(this, modelClass!.prototype) const self = this as any // delete unnecessary props + // eslint-disable-next-line @typescript-eslint/no-dynamic-delete delete self[propsTypeSymbol] + // eslint-disable-next-line @typescript-eslint/no-dynamic-delete delete self[fromSnapshotOverrideTypeSymbol] + // eslint-disable-next-line @typescript-eslint/no-dynamic-delete delete self[toSnapshotOverrideTypeSymbol] + // eslint-disable-next-line @typescript-eslint/no-dynamic-delete delete self[modelIdPropertyNameSymbol] if (!snapshotInitialData) { @@ -154,7 +158,7 @@ export abstract class BaseModel< ) } else { // from snapshot - internalFromSnapshotModel(this, snapshotInitialData!, modelClass!, !!generateNewIds) + internalFromSnapshotModel(this, snapshotInitialData, modelClass!, !!generateNewIds) } } @@ -268,5 +272,6 @@ export function modelSnapshotOutWithMetadata( * A model class declaration, made of a base model and the model interface. */ export type ModelClassDeclaration = BaseModelClass & { + // eslint-disable-next-line @typescript-eslint/prefer-function-type new (...args: any[]): ModelInterface } diff --git a/packages/lib/src/model/Model.ts b/packages/lib/src/model/Model.ts index 002aaeff..98369da3 100644 --- a/packages/lib/src/model/Model.ts +++ b/packages/lib/src/model/Model.ts @@ -17,7 +17,7 @@ import { assertIsModelClass, isModelClass } from "./utils" export type _ComposedCreationData< SuperModel, - TProps extends ModelProps + TProps extends ModelProps, > = SuperModel extends AnyModel ? ModelPropsToTransformedCreationData & ModelCreationData : ModelPropsToTransformedCreationData @@ -41,9 +41,12 @@ export interface _Model< SuperModel, TProps extends ModelProps, FromSnapshotOverride extends Record, - ToSnapshotOverride extends Record + ToSnapshotOverride extends Record, > { - new (data: _ComposedCreationData): SuperModel & + // eslint-disable-next-line @typescript-eslint/prefer-function-type + new ( + data: _ComposedCreationData + ): SuperModel & BaseModel> & Omit, BaseModelKeys> & ModelPropsToSetter @@ -70,7 +73,7 @@ export function ExtendedModel< TModelClass extends AbstractModelClass, A extends [], FS extends Record = never, - TS extends Record = never + TS extends Record = never, >( genFn: (...args: A) => { baseModel: TModelClass @@ -93,7 +96,7 @@ export function ExtendedModel< TProps extends ModelProps, TModelClass extends AbstractModelClass, FS extends Record = never, - TS extends Record = never + TS extends Record = never, >( baseModel: TModelClass, modelProps: TProps, @@ -105,17 +108,22 @@ export function ExtendedModel< TProps extends ModelProps, TModelClass extends AbstractModelClass, FS extends Record = never, - TS extends Record = never + TS extends Record = never, >(...args: any[]): _Model, TProps, FS, TS> { - let baseModel - let modelProps - let modelOptions + let baseModel: AbstractModelClass + let modelProps: TProps + let modelOptions: ModelOptions if (isModelClass(args[0])) { baseModel = args[0] modelProps = args[1] modelOptions = args[2] } else { - const gen = args[0]() + const gen = ( + args[0] as () => { + baseModel: ModelClass + props: TProps + } + )() baseModel = gen.baseModel modelProps = gen.props @@ -140,7 +148,7 @@ export function Model< TProps extends ModelProps, A extends [], FS extends Record = never, - TS extends Record = never + TS extends Record = never, >( fnModelProps: (...args: A) => TProps, modelOptions?: ModelOptions @@ -158,14 +166,14 @@ export function Model< export function Model< TProps extends ModelProps, FS extends Record = never, - TS extends Record = never + TS extends Record = never, >(modelProps: TProps, modelOptions?: ModelOptions): _Model // base export function Model< TProps extends ModelProps, FS extends Record = never, - TS extends Record = never + TS extends Record = never, >( fnModelPropsOrModelProps: (() => TProps) | TProps, modelOptions?: ModelOptions @@ -181,7 +189,7 @@ function internalModel< TProps extends ModelProps, TBaseModel extends AnyModel, FS extends Record = never, - TS extends Record = never + TS extends Record = never, >( modelProps: TProps, baseModel: ModelClass | undefined, @@ -214,7 +222,7 @@ export interface ModelOptions { * @param sn The custom input snapshot. * @returns An input snapshot that must match the expected model input snapshot. */ - fromSnapshotProcessor?(sn: FS): FromSnapshotDefaultType + fromSnapshotProcessor?: (sn: FS) => FromSnapshotDefaultType /** * Optional transformation that will be run when converting the data part of the model into a snapshot. @@ -223,5 +231,5 @@ export interface ModelOptions { * @param modelInstance The model instance. * @returns a custom output snapshot. */ - toSnapshotProcessor?(sn: ToSnapshotDefaultType, modelInstance: any): TS + toSnapshotProcessor?: (sn: ToSnapshotDefaultType, modelInstance: any) => TS } diff --git a/packages/lib/src/model/newModel.ts b/packages/lib/src/model/newModel.ts index 34df33eb..19c25578 100644 --- a/packages/lib/src/model/newModel.ts +++ b/packages/lib/src/model/newModel.ts @@ -77,7 +77,7 @@ export const internalNewModel = action( if (defaultValue !== noDefaultValue) { changed = true newValue = defaultValue - } else if (!(k in initialData!)) { + } else if (!(k in initialData)) { // for mobx4, we need to set up properties even if they are undefined changed = true } @@ -231,7 +231,7 @@ function getModelDetails(modelClass: ModelClass) { const modelIdPropertyName = getModelIdPropertyName(modelClass) const modelProps = getInternalModelClassPropsInfo(modelClass) - const modelIdPropData = modelIdPropertyName ? modelProps[modelIdPropertyName]! : undefined + const modelIdPropData = modelIdPropertyName ? modelProps[modelIdPropertyName] : undefined return { modelInfo, modelIdPropertyName, modelProps, modelIdPropData } } diff --git a/packages/lib/src/modelShared/BaseModelShared.ts b/packages/lib/src/modelShared/BaseModelShared.ts index 97b4950d..30560f05 100644 --- a/packages/lib/src/modelShared/BaseModelShared.ts +++ b/packages/lib/src/modelShared/BaseModelShared.ts @@ -34,11 +34,11 @@ export const modelInitializedSymbol = Symbol("modelInitialized") /** * Extracts the instance type of a model class. */ -export type ModelClass = { +export interface ModelClass { new (initialData: any): M - fromSnapshotProcessor?(sn: any): any - toSnapshotProcessor?(sn: any, modelInstance: any): any + fromSnapshotProcessor?: (sn: any) => any + toSnapshotProcessor?: (sn: any, modelInstance: any) => any } /** @@ -51,7 +51,9 @@ export type AbstractModelClass = abstract new /** * @internal */ -export type ModelWithProps = { [propsTypeSymbol]: ModelProps } +export interface ModelWithProps { + [propsTypeSymbol]: ModelProps +} /** * The props of a model. diff --git a/packages/lib/src/modelShared/modelClassInitializer.ts b/packages/lib/src/modelShared/modelClassInitializer.ts index 676efca3..cb3cb426 100644 --- a/packages/lib/src/modelShared/modelClassInitializer.ts +++ b/packages/lib/src/modelShared/modelClassInitializer.ts @@ -7,7 +7,10 @@ import type { ModelClass } from "./BaseModelShared" */ export const modelInitializersSymbol = Symbol("modelInitializers") -type ModelClassInitializer = (modelInstance: AnyModel | AnyDataModel) => void +/** + * @internal + */ +export type ModelClassInitializer = (modelInstance: AnyModel | AnyDataModel) => void /** * @internal @@ -16,7 +19,7 @@ export function addModelClassInitializer( modelClass: ModelClass, init: ModelClassInitializer ) { - let initializers = (modelClass as any)[modelInitializersSymbol] + let initializers: ModelClassInitializer[] = (modelClass as any)[modelInitializersSymbol] if (!initializers) { initializers = [] ;(modelClass as any)[modelInitializersSymbol] = initializers diff --git a/packages/lib/src/modelShared/modelDecorator.ts b/packages/lib/src/modelShared/modelDecorator.ts index c14de98b..ce007b51 100644 --- a/packages/lib/src/modelShared/modelDecorator.ts +++ b/packages/lib/src/modelShared/modelDecorator.ts @@ -57,10 +57,12 @@ const runAfterClassInitialization = ( // compatibility with mobx 6 if (tag.needsMakeObservable) { // we know it can be done and shouldn't fail + // eslint-disable-next-line @typescript-eslint/no-unsafe-call mobx6.makeObservable(instance) } else if (tag.needsMakeObservable === undefined) { if (getMobxVersion() >= 6) { try { + // eslint-disable-next-line @typescript-eslint/no-unsafe-call mobx6.makeObservable(instance) tag.needsMakeObservable = true } catch (e) { @@ -91,18 +93,21 @@ const runAfterClassInitialization = ( if (tag.type === "class" && instance.onInit) { wrapModelMethodInActionIfNeeded(instance, "onInit", HookAction.OnInit) + // eslint-disable-next-line @typescript-eslint/no-unsafe-call instance.onInit() } if (tag.type === "data" && instance.onLazyInit) { wrapModelMethodInActionIfNeeded(instance, "onLazyInit", HookAction.OnLazyInit) + // eslint-disable-next-line @typescript-eslint/no-unsafe-call instance.onLazyInit() } } const proxyClassHandler: ProxyHandler> = { construct(clazz, args) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-call const instance = new (clazz as any)(...args) runAfterClassInitialization(clazz, instance) diff --git a/packages/lib/src/modelShared/prop.ts b/packages/lib/src/modelShared/prop.ts index e3993590..dadb8a98 100644 --- a/packages/lib/src/modelShared/prop.ts +++ b/packages/lib/src/modelShared/prop.ts @@ -20,7 +20,7 @@ export interface ModelProp< TIsId extends boolean = false, THasSetter = never, TFromSnapshotOverride = never, - TToSnapshotOverride = never + TToSnapshotOverride = never, > { $valueType: TPropValue $creationValueType: TPropCreationValue @@ -39,17 +39,17 @@ export interface ModelProp< _isId: boolean _transform: | { - transform( + transform: ( original: unknown, model: object, propName: PropertyKey, setOriginalValue: (newOriginalValue: unknown) => void - ): unknown - untransform(transformed: unknown, model: object, propName: PropertyKey): unknown + ) => unknown + untransform: (transformed: unknown, model: object, propName: PropertyKey) => unknown } | undefined - _fromSnapshotProcessor?(sn: unknown): unknown - _toSnapshotProcessor?(sn: unknown): unknown + _fromSnapshotProcessor?: (sn: unknown) => unknown + _toSnapshotProcessor?: (sn: unknown) => unknown withSetter(): ModelProp< TPropValue, @@ -103,7 +103,7 @@ export interface ModelProp< withSnapshotProcessor< FS = TFromSnapshotOverride, TS = TToSnapshotOverride, - This extends AnyModelProp = this + This extends AnyModelProp = this, >(processor: { fromSnapshot?(sn: FS): ModelPropFromSnapshot toSnapshot?(sn: ModelPropToSnapshot): TS @@ -317,7 +317,7 @@ const baseProp: AnyModelProp = { }, withSnapshotProcessor({ fromSnapshot, toSnapshot }) { - let newFromSnapshot + let newFromSnapshot: ((sn: any) => any) | undefined if (this._fromSnapshotProcessor && fromSnapshot) { const oldFn = this._fromSnapshotProcessor @@ -329,12 +329,12 @@ const baseProp: AnyModelProp = { newFromSnapshot = this._fromSnapshotProcessor } - let newToSnapshot + let newToSnapshot: ((sn: any) => any) | undefined if (this._toSnapshotProcessor && toSnapshot) { - const oldFn: any = this._toSnapshotProcessor + const oldFn: (sn: unknown) => any = this._toSnapshotProcessor const newFn = toSnapshot - newToSnapshot = (sn: any) => newFn(oldFn(sn)) + newToSnapshot = (sn: unknown) => newFn(oldFn(sn)) } else if (toSnapshot) { newToSnapshot = toSnapshot } else { @@ -494,7 +494,10 @@ function toFullTransform(transformObject: ModelPropTransform) /** * @ignore */ -export function getModelPropDefaultValue(propData: AnyModelProp): unknown | typeof noDefaultValue { +export function getModelPropDefaultValue( + propData: AnyModelProp +): // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents +unknown | typeof noDefaultValue { if (propData._defaultFn !== noDefaultValue) { return propData._defaultFn() } diff --git a/packages/lib/src/modelShared/sharedInternalModel.ts b/packages/lib/src/modelShared/sharedInternalModel.ts index 56bc0703..b1ba8813 100644 --- a/packages/lib/src/modelShared/sharedInternalModel.ts +++ b/packages/lib/src/modelShared/sharedInternalModel.ts @@ -18,7 +18,7 @@ import { typesUnchecked } from "../types/utility/typesUnchecked" import { addHiddenProp, assertIsObject, failure, propNameToSetterName } from "../utils" import { chainFns } from "../utils/chainFns" import { ModelClass, modelInitializedSymbol } from "./BaseModelShared" -import { modelInitializersSymbol } from "./modelClassInitializer" +import { ModelClassInitializer, modelInitializersSymbol } from "./modelClassInitializer" import { getInternalModelClassPropsInfo, setInternalModelClassPropsInfo } from "./modelPropsInfo" import { modelMetadataSymbol, modelUnwrappedClassSymbol } from "./modelSymbols" import { AnyModelProp, getModelPropDefaultValue, ModelProps, noDefaultValue, prop } from "./prop" @@ -178,7 +178,7 @@ export function sharedInternalModel< idKey = idKeys[0] const idProp = composedModelProps[idKey] let baseProp: AnyModelProp = needsTypeChecker ? tPropForId : propForId - switch (idProp?._setter) { + switch (idProp._setter) { case true: baseProp = baseProp.withSetter() break @@ -217,6 +217,7 @@ export function sharedInternalModel< constructorOptions?: ModelConstructorOptions | DataModelConstructorOptions ) { const modelClass = constructorOptions?.modelClass ?? this.constructor + // eslint-disable-next-line @typescript-eslint/no-unsafe-call const baseModel = new base(initialData, { ...constructorOptions, modelClass, @@ -232,7 +233,10 @@ export function sharedInternalModel< ) } - propsToDeleteFromBase.forEach((prop) => delete baseModel[prop]) + propsToDeleteFromBase.forEach((prop) => { + // eslint-disable-next-line @typescript-eslint/no-dynamic-delete + delete baseModel[prop] + }) return baseModel } @@ -240,7 +244,7 @@ export function sharedInternalModel< // copy static props from base Object.assign(ThisModel, base) - const initializers = base[modelInitializersSymbol] + const initializers: ModelClassInitializer[] = base[modelInitializersSymbol] if (initializers) { ThisModel[modelInitializersSymbol] = initializers.slice() } @@ -288,6 +292,7 @@ export function sharedInternalModel< const setterName = propNameToSetterName(propName) if (!(basePropNames as Set).has(setterName)) { + // eslint-disable-next-line @typescript-eslint/no-confusing-void-expression const newPropDescriptor: any = modelAction(ThisModel.prototype, setterName, { value: function (this: any, value: any) { this[propName] = value diff --git a/packages/lib/src/parent/core.ts b/packages/lib/src/parent/core.ts index d48e9029..7b73b4b8 100644 --- a/packages/lib/src/parent/core.ts +++ b/packages/lib/src/parent/core.ts @@ -50,7 +50,7 @@ export const dataObjectParent = new WeakMap() */ export function dataToModelNode(node: T): T { const modelNode = dataObjectParent.get(node) - return (modelNode as T) ?? node + return (modelNode as T | undefined) ?? node } /** diff --git a/packages/lib/src/parent/coreObjectChildren.ts b/packages/lib/src/parent/coreObjectChildren.ts index 91ad5cda..87eac23f 100644 --- a/packages/lib/src/parent/coreObjectChildren.ts +++ b/packages/lib/src/parent/coreObjectChildren.ts @@ -75,7 +75,7 @@ function addNodeToDeepLists(node: any, data: DeepObjectChildren) { } const updateDeepObjectChildren = action((node: object): DeepObjectChildren => { - const obj = getObjectChildrenObject(node)! + const obj = getObjectChildrenObject(node) if (!obj.deepDirty) { return obj } @@ -162,7 +162,7 @@ export function registerDeepObjectChildrenExtension(extension: DeepObjectChil } function initExtensionsData() { - const extensionsData = new WeakMap() + const extensionsData = new WeakMap() extensions.forEach((extension, dataSymbol) => { extensionsData.set(dataSymbol, extension.initData()) diff --git a/packages/lib/src/parent/detach.ts b/packages/lib/src/parent/detach.ts index 09b9af39..4ea0ab92 100644 --- a/packages/lib/src/parent/detach.ts +++ b/packages/lib/src/parent/detach.ts @@ -38,7 +38,7 @@ function internalDetach(this: object): void { if (isObservableArray(parent)) { parent.splice(+path, 1) } else if (isObservableObject(parent)) { - remove(parent, "" + path) + remove(parent, String(path)) } else { throw failure("parent must be an observable object or an observable array") } diff --git a/packages/lib/src/parent/getChildrenObjects.ts b/packages/lib/src/parent/getChildrenObjects.ts index 967dd1da..30c9039c 100644 --- a/packages/lib/src/parent/getChildrenObjects.ts +++ b/packages/lib/src/parent/getChildrenObjects.ts @@ -17,7 +17,7 @@ export function getChildrenObjects( ): ReadonlySet { assertTweakedObject(node, "node") - if (!options || !options.deep) { + if (!options?.deep) { return getObjectChildren(node) } else { return getDeepObjectChildren(node).deep diff --git a/packages/lib/src/parent/walkTree.ts b/packages/lib/src/parent/walkTree.ts index 7ef453aa..b01d72bd 100644 --- a/packages/lib/src/parent/walkTree.ts +++ b/packages/lib/src/parent/walkTree.ts @@ -55,12 +55,12 @@ function walkTreeParentFirst( return ret } - const children = getObjectChildren(node)! + const children = getObjectChildren(node) stack.length += children.size let i = stack.length - 1 - const childrenIter = children!.values() + const childrenIter = children.values() let ch = childrenIter.next() while (!ch.done) { stack[i--] = ch.value @@ -75,7 +75,7 @@ function walkTreeChildrenFirst( root: object, visit: (node: object) => T | undefined ): T | undefined { - const childrenIter = getObjectChildren(root)!.values() + const childrenIter = getObjectChildren(root).values() let ch = childrenIter.next() while (!ch.done) { const ret = walkTreeChildrenFirst(ch.value, visit) @@ -136,8 +136,8 @@ function walkTreeAggregate( let map: Map | undefined const rootVal = visit(target) - const childrenMap = getObjectChildren(target)! - const childrenIter = childrenMap!.values() + const childrenMap = getObjectChildren(target) + const childrenIter = childrenMap.values() let ch = childrenIter.next() // small optimization, if there is only one child and this diff --git a/packages/lib/src/patch/emitPatch.ts b/packages/lib/src/patch/emitPatch.ts index ac90d729..aa509e69 100644 --- a/packages/lib/src/patch/emitPatch.ts +++ b/packages/lib/src/patch/emitPatch.ts @@ -86,7 +86,7 @@ export function onPatches(subtreeRoot: object, listener: OnPatchesListener): OnP listenersForObject.push(listener) return () => { - deleteFromArray(listenersForObject!, listener) + deleteFromArray(listenersForObject, listener) } } diff --git a/packages/lib/src/patch/jsonPatch.ts b/packages/lib/src/patch/jsonPatch.ts index 979f67d6..f888cfee 100644 --- a/packages/lib/src/patch/jsonPatch.ts +++ b/packages/lib/src/patch/jsonPatch.ts @@ -33,9 +33,9 @@ export interface JsonPatchReplaceOperation extends JsonPatchBaseOperation { */ function escapePathComponent(path: string | number): string { if (typeof path === "number") { - return "" + path + return String(path) } - if (path.indexOf("/") === -1 && path.indexOf("~") === -1) { + if (!path.includes("/") && !path.includes("~")) { return path } return path.replace(/~/g, "~0").replace(/\//g, "~1") diff --git a/packages/lib/src/patch/patchRecorder.ts b/packages/lib/src/patch/patchRecorder.ts index 21195dba..027ad3d0 100644 --- a/packages/lib/src/patch/patchRecorder.ts +++ b/packages/lib/src/patch/patchRecorder.ts @@ -58,7 +58,7 @@ export interface PatchRecorderOptions { * @param inversePatches Inverse patches about to be recorded. * @returns `true` to record the patch, `false` to skip it. */ - filter?(patches: Patch[], inversePatches: Patch[]): boolean + filter?: (patches: Patch[], inversePatches: Patch[]) => boolean /** * An optional callback run once a patch is recorded. diff --git a/packages/lib/src/redux/connectReduxDevTools.ts b/packages/lib/src/redux/connectReduxDevTools.ts index a461007b..9a342cb9 100644 --- a/packages/lib/src/redux/connectReduxDevTools.ts +++ b/packages/lib/src/redux/connectReduxDevTools.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-unsafe-call */ import { ActionContextActionType } from "../action" import { actionTrackingMiddleware, diff --git a/packages/lib/src/redux/redux.ts b/packages/lib/src/redux/redux.ts index 6c8d65cb..9537c0d7 100644 --- a/packages/lib/src/redux/redux.ts +++ b/packages/lib/src/redux/redux.ts @@ -40,16 +40,14 @@ export interface ReduxStore { /** * A redux runner for mobx-keystone. */ -export interface ReduxRunner { - (next: ReduxStore["dispatch"]): (action: ReduxAction) => ReduxAction -} +export type ReduxRunner = ( + next: ReduxStore["dispatch"] +) => (action: ReduxAction) => ReduxAction /** * A redux middleware for mobx-keystone. */ -export interface ReduxMiddleware { - (store: ReduxStore): ReduxRunner -} +export type ReduxMiddleware = (store: ReduxStore) => ReduxRunner /** * Generates a redux compatible store out of a mobx-keystone object. @@ -101,13 +99,12 @@ function runMiddlewares( let i = 0 function runNextMiddleware(action: ReduxAction): ReduxAction { - const runner = runners[i] - i++ - if (runner) { + if (i < runners.length) { + const runner = runners[i] + i++ return runner(runNextMiddleware)(action) - } else { - return next(action) } + return next(action) } return runNextMiddleware(initialAction) diff --git a/packages/lib/src/ref/core.ts b/packages/lib/src/ref/core.ts index a29eb245..5a8c0b54 100644 --- a/packages/lib/src/ref/core.ts +++ b/packages/lib/src/ref/core.ts @@ -141,7 +141,7 @@ export function internalCustomRef( * @returns The string ID or `undefined`. */ export function getModelRefId(target: object): string | undefined { - if (isModel(target) && target.getRefId) { + if (isModel(target)) { const id = target.getRefId() if (id !== undefined && typeof id !== "string") { throw failure("'getRefId()' must return a string or undefined when present") diff --git a/packages/lib/src/rootStore/attachDetach.ts b/packages/lib/src/rootStore/attachDetach.ts index 51e358ae..449eb197 100644 --- a/packages/lib/src/rootStore/attachDetach.ts +++ b/packages/lib/src/rootStore/attachDetach.ts @@ -44,7 +44,8 @@ export const attachToRootStore = action( for (let i = 0; i < childrenToCallLen; i++) { const ch = childrenToCall[i] - const disposer = (ch as any).onAttachedToRootStore!(rootStore) + // eslint-disable-next-line @typescript-eslint/no-unsafe-call + const disposer = (ch as any).onAttachedToRootStore(rootStore) if (disposer) { onAttachedDisposers.set(ch, disposer) } diff --git a/packages/lib/src/snapshot/SnapshotOf.ts b/packages/lib/src/snapshot/SnapshotOf.ts index e6cf1088..415a34d7 100644 --- a/packages/lib/src/snapshot/SnapshotOf.ts +++ b/packages/lib/src/snapshot/SnapshotOf.ts @@ -14,7 +14,7 @@ export type SnapshotOutOfObject = { export type SnapshotOutOfModel = ModelToSnapshot -export type SnapshotOutOfFrozen> = { +export interface SnapshotOutOfFrozen> { [frozenKey]: true data: F["data"] } @@ -31,27 +31,28 @@ export interface SnapshotOutOfArraySet { [modelIdKey]: string } -export type SnapshotOutOf = T extends ObjectMap - ? SnapshotOutOfObjectMap extends infer R - ? R - : never - : T extends ArraySet - ? SnapshotOutOfArraySet extends infer R - ? R - : never - : T extends AnyModel - ? SnapshotOutOfModel extends infer R - ? R - : never - : T extends Frozen - ? SnapshotOutOfFrozen extends infer R - ? R - : never - : T extends object - ? SnapshotOutOfObject extends infer R - ? R - : never - : T +export type SnapshotOutOf = + T extends ObjectMap + ? SnapshotOutOfObjectMap extends infer R + ? R + : never + : T extends ArraySet + ? SnapshotOutOfArraySet extends infer R + ? R + : never + : T extends AnyModel + ? SnapshotOutOfModel extends infer R + ? R + : never + : T extends Frozen + ? SnapshotOutOfFrozen extends infer R + ? R + : never + : T extends object + ? SnapshotOutOfObject extends infer R + ? R + : never + : T // snapshot in @@ -61,7 +62,7 @@ export type SnapshotInOfObject = { export type SnapshotInOfModel = ModelFromSnapshot -export type SnapshotInOfFrozen> = { +export interface SnapshotInOfFrozen> { [frozenKey]: true data: F["data"] } @@ -78,24 +79,25 @@ export interface SnapshotInOfArraySet { [modelIdKey]: string } -export type SnapshotInOf = T extends ObjectMap - ? SnapshotInOfObjectMap extends infer R - ? R - : never - : T extends ArraySet - ? SnapshotInOfArraySet extends infer R - ? R - : never - : T extends AnyModel - ? SnapshotInOfModel extends infer R - ? R - : never - : T extends Frozen - ? SnapshotInOfFrozen extends infer R - ? R - : never - : T extends object - ? SnapshotInOfObject extends infer R - ? R - : never - : T +export type SnapshotInOf = + T extends ObjectMap + ? SnapshotInOfObjectMap extends infer R + ? R + : never + : T extends ArraySet + ? SnapshotInOfArraySet extends infer R + ? R + : never + : T extends AnyModel + ? SnapshotInOfModel extends infer R + ? R + : never + : T extends Frozen + ? SnapshotInOfFrozen extends infer R + ? R + : never + : T extends object + ? SnapshotInOfObject extends infer R + ? R + : never + : T diff --git a/packages/lib/src/snapshot/applySnapshot.ts b/packages/lib/src/snapshot/applySnapshot.ts index 5d74d6bb..222e49e6 100644 --- a/packages/lib/src/snapshot/applySnapshot.ts +++ b/packages/lib/src/snapshot/applySnapshot.ts @@ -31,16 +31,10 @@ import type { SnapshotInOf, SnapshotOutOf } from "./SnapshotOf" * @param node Target object (model object, object or array). * @param snapshot Snapshot to apply. */ -export function applySnapshot(node: T, snapshot: SnapshotInOf): void - -/** - * Applies a full snapshot over an object, reconciling it with the current contents of the object. - * - * @typeparam T Object type. - * @param node Target object (model object, object or array). - * @param snapshot Snapshot to apply. - */ -export function applySnapshot(node: T, snapshot: SnapshotOutOf): void +export function applySnapshot( + node: T, + snapshot: SnapshotInOf | SnapshotOutOf +): void export function applySnapshot(node: object, snapshot: unknown): void { assertTweakedObject(node, "node") @@ -74,7 +68,8 @@ export function internalApplySnapshot( throw failure("if the snapshot is an array the target must be an array too") } - return reconcile() + reconcile() + return } if (isFrozenSnapshot(sn)) { @@ -121,7 +116,8 @@ export function internalApplySnapshot( } } - return reconcile() + reconcile() + return } if (isPlainObject(sn)) { @@ -130,7 +126,8 @@ export function internalApplySnapshot( throw failure("if the snapshot is an object the target must be an object too") } - return reconcile() + reconcile() + return } if (isMap(sn)) { diff --git a/packages/lib/src/snapshot/fromModelSnapshot.ts b/packages/lib/src/snapshot/fromModelSnapshot.ts index 0b7c7a9a..afff8a8b 100644 --- a/packages/lib/src/snapshot/fromModelSnapshot.ts +++ b/packages/lib/src/snapshot/fromModelSnapshot.ts @@ -23,12 +23,13 @@ function fromModelSnapshot(sn: SnapshotInOfModel, ctx: FromSnapshotCon } const modelIdPropertyName = getModelIdPropertyName(modelInfo.class as ModelClass) - if (modelIdPropertyName && (sn as any)[modelIdPropertyName] === undefined) { + if (modelIdPropertyName && sn[modelIdPropertyName] === undefined) { throw failure( `a model snapshot of type '${type}' must contain an id key (${modelIdPropertyName}), but none was found` ) } + // eslint-disable-next-line @typescript-eslint/no-unsafe-call return new (modelInfo.class as any)(undefined, { snapshotInitialData: { unprocessedSnapshot: sn, @@ -41,7 +42,7 @@ function fromModelSnapshot(sn: SnapshotInOfModel, ctx: FromSnapshotCon snapshotToInitialData: ctx.snapshotToInitialData, }, generateNewIds: ctx.options.generateNewIds, - } as ModelConstructorOptions) + } satisfies ModelConstructorOptions) } /** diff --git a/packages/lib/src/snapshot/fromSnapshot.ts b/packages/lib/src/snapshot/fromSnapshot.ts index 3af36b07..d0a1d272 100644 --- a/packages/lib/src/snapshot/fromSnapshot.ts +++ b/packages/lib/src/snapshot/fromSnapshot.ts @@ -14,7 +14,7 @@ import { registerDefaultSnapshotters } from "./registerDefaultSnapshotters" /** * @internal */ -export type Snapshotter = (sn: any, ctx: FromSnapshotContext) => any | undefined +export type Snapshotter = (sn: any, ctx: FromSnapshotContext) => any const snapshotters: { priority: number; snapshotter: Snapshotter }[] = [] @@ -41,7 +41,7 @@ export interface FromSnapshotOptions { */ export interface FromSnapshotContext { options: FromSnapshotOptions - snapshotToInitialData(processedSn: SnapshotInOfModel): any + snapshotToInitialData: (processedSn: SnapshotInOfModel) => any untypedSnapshot: unknown } @@ -83,9 +83,7 @@ export function fromSnapshot(arg1: any, arg2: any, arg3?: any): T { if (isLateTypeChecker(arg1) || arg1 instanceof TypeChecker || isModelClass(arg1)) { const typeChecker = resolveTypeChecker(arg1) unprocessedSnapshot = arg2 - snapshot = typeChecker.fromSnapshotProcessor - ? typeChecker.fromSnapshotProcessor(unprocessedSnapshot) - : unprocessedSnapshot + snapshot = typeChecker.fromSnapshotProcessor(unprocessedSnapshot) options = arg3 } else { snapshot = arg1 diff --git a/packages/lib/src/snapshot/internal.ts b/packages/lib/src/snapshot/internal.ts index c224429e..c67ff2e9 100644 --- a/packages/lib/src/snapshot/internal.ts +++ b/packages/lib/src/snapshot/internal.ts @@ -173,7 +173,7 @@ export function freezeInternalSnapshot(data: // this might be undefined if the data comes from example from transforms const isFrozen = frozenState.get(data) - if (isFrozen === undefined || isFrozen === true) { + if (isFrozen === undefined || isFrozen) { // already frozen or an external data (e.g. from a transform) return data } diff --git a/packages/lib/src/snapshot/reconcileModelSnapshot.ts b/packages/lib/src/snapshot/reconcileModelSnapshot.ts index 79234406..b4dd6507 100644 --- a/packages/lib/src/snapshot/reconcileModelSnapshot.ts +++ b/packages/lib/src/snapshot/reconcileModelSnapshot.ts @@ -6,7 +6,7 @@ import { isModel, isModelSnapshot } from "../model/utils" import type { ModelClass } from "../modelShared/BaseModelShared" import { getModelInfoForName } from "../modelShared/modelInfo" import { getInternalModelClassPropsInfo } from "../modelShared/modelPropsInfo" -import { getModelPropDefaultValue, noDefaultValue } from "../modelShared/prop" +import { AnyModelProp, getModelPropDefaultValue, noDefaultValue } from "../modelShared/prop" import { deepEquals } from "../treeUtils/deepEquals" import { runTypeCheckingAfterChange } from "../tweaker/typeChecking" import { withoutTypeChecking } from "../tweaker/withoutTypeChecking" @@ -79,7 +79,7 @@ function reconcileModelSnapshot( const k = dataKeys[i] if (!(k in processedSn)) { // use default value if applicable - const modelProp = modelProps[k] + const modelProp = modelProps[k] as AnyModelProp | undefined const defaultValue = modelProp ? getModelPropDefaultValue(modelProp) : noDefaultValue if (defaultValue === noDefaultValue) { remove(data, k) @@ -102,7 +102,7 @@ function reconcileModelSnapshot( // use default value if applicable if (newValue == null) { - const modelProp = modelProps[k] + const modelProp = modelProps[k] as AnyModelProp | undefined const defaultValue = modelProp ? getModelPropDefaultValue(modelProp) : noDefaultValue if (defaultValue !== noDefaultValue) { newValue = defaultValue diff --git a/packages/lib/src/snapshot/reconcileSnapshot.ts b/packages/lib/src/snapshot/reconcileSnapshot.ts index cf8998c5..43b0a9fe 100644 --- a/packages/lib/src/snapshot/reconcileSnapshot.ts +++ b/packages/lib/src/snapshot/reconcileSnapshot.ts @@ -7,7 +7,7 @@ import type { ModelPool } from "../utils/ModelPool" import { getSnapshot } from "./getSnapshot" import { registerDefaultReconcilers } from "./registerDefaultReconcilers" -type Reconciler = (value: any, sn: any, modelPool: ModelPool, parent: any) => any | undefined +type Reconciler = (value: any, sn: any, modelPool: ModelPool, parent: any) => any const reconcilers: { priority: number; reconciler: Reconciler }[] = [] diff --git a/packages/lib/src/standardActions/arrayActions.ts b/packages/lib/src/standardActions/arrayActions.ts index 6f914e87..49efa8ac 100644 --- a/packages/lib/src/standardActions/arrayActions.ts +++ b/packages/lib/src/standardActions/arrayActions.ts @@ -4,10 +4,9 @@ import { namespace as ns } from "../utils" import { setIfDifferent } from "../utils/setIfDifferent" import { standaloneAction } from "./standaloneActions" -function _splice(array: any[], start: number, deleteCount?: number): any[] -function _splice(array: any[], start: number, deleteCount: number, ...items: any[]): any[] +function _splice(array: any[], start: number, deleteCount?: number, ...items: any[]): any[] function _splice(array: any[], ...args: any[]): any[] { - return (array.splice as any)(...args) + return (array.splice as (...args: any[]) => any[])(...args) } const namespace = `${ns}/arrayActions` @@ -18,7 +17,7 @@ export const arrayActions = { }), delete: standaloneAction(`${namespace}::delete`, (array: T[], index: number): boolean => { - return remove(array, "" + index) + return remove(array, String(index)) }), setLength: standaloneAction(`${namespace}::setLength`, (array: T[], length: number): void => { diff --git a/packages/lib/src/standardActions/objectActions.ts b/packages/lib/src/standardActions/objectActions.ts index b6c5b919..04b2837f 100644 --- a/packages/lib/src/standardActions/objectActions.ts +++ b/packages/lib/src/standardActions/objectActions.ts @@ -52,6 +52,7 @@ export const objectActions = { methodName: K, ...args: T[K] extends AnyFunction ? Parameters : never ): T[K] extends AnyFunction ? ReturnType : never => { + // eslint-disable-next-line @typescript-eslint/no-unsafe-call return (target as any)[methodName](...args) } ), diff --git a/packages/lib/src/tweaker/tweak.ts b/packages/lib/src/tweaker/tweak.ts index c510ced0..5c063a73 100644 --- a/packages/lib/src/tweaker/tweak.ts +++ b/packages/lib/src/tweaker/tweak.ts @@ -159,7 +159,7 @@ export function tryUntweak(value: any): (() => void) | undefined { // pre-untweaking, untweak children first // we have to make a copy since it will be changed - const children = Array.from(getObjectChildren(value)!.values()) + const children = Array.from(getObjectChildren(value).values()) for (let i = 0; i < children.length; i++) { setParent( diff --git a/packages/lib/src/tweaker/tweakArray.ts b/packages/lib/src/tweaker/tweakArray.ts index a1604d0d..d0ce8455 100644 --- a/packages/lib/src/tweaker/tweakArray.ts +++ b/packages/lib/src/tweaker/tweakArray.ts @@ -182,9 +182,9 @@ function arrayDidChangeUpdate(change: any /*IArrayDidChange*/, oldSnapshot: any) } function arrayDidChangeSplice(change: any /*IArrayDidChange*/, oldSnapshot: any) { - const index = change.index - const addedCount = change.addedCount - const removedCount = change.removedCount + const index = change.index as number + const addedCount = change.addedCount as number + const removedCount = change.removedCount as number const addedItems: any[] = [] addedItems.length = addedCount diff --git a/packages/lib/src/tweaker/tweakPlainObject.ts b/packages/lib/src/tweaker/tweakPlainObject.ts index be99d477..8b02b854 100644 --- a/packages/lib/src/tweaker/tweakPlainObject.ts +++ b/packages/lib/src/tweaker/tweakPlainObject.ts @@ -138,6 +138,7 @@ function mutateSet(k: PropertyKey, v: unknown, sn: Record) } function mutateDelete(k: PropertyKey, sn: Record) { + // eslint-disable-next-line @typescript-eslint/no-dynamic-delete delete sn[k] } @@ -165,7 +166,7 @@ function objectDidChange(change: IObjectDidChange): void { runTypeCheckingAfterChange(obj, patchRecorder) - if (!runningWithoutSnapshotOrPatches && mutate) { + if (!runningWithoutSnapshotOrPatches) { updateInternalSnapshot(actualNode, mutate) patchRecorder.emit(actualNode) } @@ -268,7 +269,7 @@ function interceptObjectMutation(change: IObjectWillChange) { case "add": change.newValue = tweak(change.newValue, { parent: change.object, - path: "" + change.name, + path: String(change.name), }) break @@ -285,7 +286,7 @@ function interceptObjectMutation(change: IObjectWillChange) { change.newValue = tweak(newVal, { parent: change.object, - path: "" + change.name, + path: String(change.name), }) } break diff --git a/packages/lib/src/types/TypeChecker.ts b/packages/lib/src/types/TypeChecker.ts index d7481bec..69b90502 100644 --- a/packages/lib/src/types/TypeChecker.ts +++ b/packages/lib/src/types/TypeChecker.ts @@ -46,8 +46,9 @@ export function invalidateCachedTypeCheckerResult(obj: object) { const set = typeCheckersWithCachedResultsOfObject.get(current) if (set) { typeCheckersWithCachedResultsOfObject.delete(current) - // eslint-disable-next-line no-loop-func - set.forEach((typeChecker) => typeChecker.invalidateCachedResult(current)) + set.forEach((typeChecker) => { + typeChecker.invalidateCachedResult(current) + }) } current = fastGetParentIncludingDataObjects(current, false) @@ -66,7 +67,9 @@ export function invalidateCachedToSnapshotProcessorResult(obj: object) { const set = typeCheckersWithCachedSnapshotProcessorResultsOfObject.get(obj) if (set) { - set.forEach((typeChecker) => typeChecker.invalidateSnapshotProcessorCachedResult(obj)) + set.forEach((typeChecker) => { + typeChecker.invalidateSnapshotProcessorCachedResult(obj) + }) typeCheckersWithCachedSnapshotProcessorResultsOfObject.delete(obj) } } diff --git a/packages/lib/src/types/objectBased/typesDataModelData.ts b/packages/lib/src/types/objectBased/typesDataModelData.ts index fdaf5736..064c9f95 100644 --- a/packages/lib/src/types/objectBased/typesDataModelData.ts +++ b/packages/lib/src/types/objectBased/typesDataModelData.ts @@ -110,7 +110,7 @@ export function typesDataModelData( cachedDataModelTypeChecker.set(modelClazz, tc) - return tc as any + return tc } } @@ -137,7 +137,7 @@ export class DataModelDataTypeInfo extends TypeInfo { Object.keys(objSchema).forEach((propName) => { const propData = objSchema[propName] - const type = propData._typeChecker as any as AnyStandardType + const type = propData._typeChecker as any as AnyStandardType | undefined let typeInfo: TypeInfo | undefined if (type) { diff --git a/packages/lib/src/types/objectBased/typesModel.ts b/packages/lib/src/types/objectBased/typesModel.ts index e3b0b3da..6f88d236 100644 --- a/packages/lib/src/types/objectBased/typesModel.ts +++ b/packages/lib/src/types/objectBased/typesModel.ts @@ -120,7 +120,7 @@ export function typesModel(modelClass: _ClassOrObject): cachedModelTypeChecker.set(modelClazz, tc) - return tc as any + return tc } } @@ -147,7 +147,7 @@ export class ModelTypeInfo extends TypeInfo { Object.keys(objSchema).forEach((propName) => { const propData = objSchema[propName] - const type = propData._typeChecker as any as AnyStandardType + const type = propData._typeChecker as any as AnyStandardType | undefined let typeInfo: TypeInfo | undefined if (type) { @@ -183,7 +183,10 @@ export class ModelTypeInfo extends TypeInfo { return modelInfo.name } - constructor(thisType: AnyStandardType, readonly modelClass: ModelClass) { + constructor( + thisType: AnyStandardType, + readonly modelClass: ModelClass + ) { super(thisType) } } diff --git a/packages/lib/src/types/objectBased/typesObject.ts b/packages/lib/src/types/objectBased/typesObject.ts index 94c8484d..7a40a17c 100644 --- a/packages/lib/src/types/objectBased/typesObject.ts +++ b/packages/lib/src/types/objectBased/typesObject.ts @@ -24,9 +24,7 @@ function typesObjectHelper(objFn: S, frozen: boolean, typeInfoGen: TypeInfoGe assertIsFunction(objFn, "objFn") return lateTypeChecker(() => { - const objectSchema: { - [k: string]: TypeChecker | LateTypeChecker - } = (objFn as any)() + const objectSchema: Record = objFn() assertIsObject(objectSchema, "objectSchema") const schemaEntries = Object.entries(objectSchema) @@ -177,7 +175,10 @@ export class ObjectTypeInfo extends TypeInfo { return this._props() } - constructor(thisType: AnyStandardType, private _objTypeFn: ObjectTypeFunction) { + constructor( + thisType: AnyStandardType, + private _objTypeFn: ObjectTypeFunction + ) { super(thisType) } } @@ -215,7 +216,10 @@ export class FrozenTypeInfo extends TypeInfo { return getTypeInfo(this.dataType) } - constructor(thisType: AnyStandardType, readonly dataType: AnyStandardType) { + constructor( + thisType: AnyStandardType, + readonly dataType: AnyStandardType + ) { super(thisType) } } diff --git a/packages/lib/src/types/schemas.ts b/packages/lib/src/types/schemas.ts index aa2edae0..828d6330 100644 --- a/packages/lib/src/types/schemas.ts +++ b/packages/lib/src/types/schemas.ts @@ -50,6 +50,7 @@ export interface ObjectType > {} export interface ObjectTypeFunction { + // eslint-disable-next-line @typescript-eslint/prefer-function-type (): ObjectOfTypes } diff --git a/packages/lib/src/types/utility/typesRefinement.ts b/packages/lib/src/types/utility/typesRefinement.ts index 1d032c22..5937f9c0 100644 --- a/packages/lib/src/types/utility/typesRefinement.ts +++ b/packages/lib/src/types/utility/typesRefinement.ts @@ -48,6 +48,7 @@ export function typesRefinement( const getTypeName = (...recursiveTypeCheckers: TypeChecker[]) => { const baseTypeName = baseChecker.getTypeName(...recursiveTypeCheckers, baseChecker) + // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing const refinementName = typeName || "refinementOf" return `${refinementName}<${baseTypeName}>` } diff --git a/packages/lib/src/types/utility/typesTag.ts b/packages/lib/src/types/utility/typesTag.ts index ada17af8..f034c7a0 100644 --- a/packages/lib/src/types/utility/typesTag.ts +++ b/packages/lib/src/types/utility/typesTag.ts @@ -43,6 +43,7 @@ export function typesTag(baseType: T, tag: A, typeName?: s const getTypeName = (...recursiveTypeCheckers: TypeChecker[]) => { const baseTypeName = baseChecker.getTypeName(...recursiveTypeCheckers, baseChecker) + // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing const taggedName = typeName || "tagged" return `${taggedName}<${baseTypeName}>` } diff --git a/packages/lib/src/utils/decorators.ts b/packages/lib/src/utils/decorators.ts index 0f65f2f1..3e038e44 100644 --- a/packages/lib/src/utils/decorators.ts +++ b/packages/lib/src/utils/decorators.ts @@ -20,6 +20,7 @@ const unboundMethodSymbol = Symbol("unboundMethod") const bindMethod = (method: any, instance: any) => { const unboundMethod = unboundMethodSymbol in method ? method[unboundMethodSymbol] : method + // eslint-disable-next-line @typescript-eslint/no-unsafe-call const boundMethod = unboundMethod.bind(instance) // copy modelAction symbol, etc. Object.getOwnPropertySymbols(unboundMethod).forEach((s) => { @@ -86,59 +87,65 @@ export function decorateWrapMethodOrField( const ctx = args[1] as ClassMethodDecoratorContext | ClassFieldDecoratorContext checkDecoratorContext(decoratorName, ctx.name, ctx.static) - if (ctx.kind !== "method" && ctx.kind !== "field") { - throw failure(`@${decoratorName} can only be used on fields or methods}`) - } + switch (ctx.kind) { + case "method": { + // @action method() { } + const value = args[0] + const propertyKey = ctx.name as string + + let inited = false + + ctx.addInitializer(function (this: any) { + // only do one override on first initialization for the whole class + if (inited) { + return + } + inited = true + + const target = this + checkModelDecoratorTaget(decoratorName, target) + + // find the deepest proto that matches the value + let proto = this + let nextProto = Object.getPrototypeOf(proto) + while (nextProto && nextProto[propertyKey] === value) { + proto = nextProto + nextProto = Object.getPrototypeOf(proto) + } + + proto[propertyKey] = wrap( + getActionNameAndContextOverride(target, propertyKey, false), + proto[propertyKey] + ) + }) + + break + } - if (ctx.kind === "method") { - // @action method() { } - const value = args[0] - const propertyKey = ctx.name as string + case "field": { + // @action method = () => {} + const propertyKey = ctx.name as string - let inited = false + let data: ReturnType | undefined - ctx.addInitializer(function (this: any) { - // only do one override on first initialization for the whole class - if (inited) { - return - } - inited = true + return function (this: any, value: any) { + const instance = this - const target = this - checkModelDecoratorTaget(decoratorName, target) + if (!data) { + checkModelDecoratorTaget(decoratorName, instance) + data = getActionNameAndContextOverride(instance, propertyKey, false) + } - // find the deepest proto that matches the value - let proto = this - let nextProto = Object.getPrototypeOf(proto) - while (nextProto && nextProto[propertyKey] === value) { - proto = nextProto - nextProto = Object.getPrototypeOf(proto) - } - - proto[propertyKey] = wrap( - getActionNameAndContextOverride(target, propertyKey, false), - proto[propertyKey] - ) - }) - } else if (ctx.kind === "field") { - // @action method = () => {} - const propertyKey = ctx.name as string + const method = wrap(data, value) - let data: ReturnType | undefined - - return function (this: any, value: any) { - const instance = this - - if (!data) { - checkModelDecoratorTaget(decoratorName, instance) - data = getActionNameAndContextOverride(instance, propertyKey, false) + // all of this is to make method destructuring work + return bindMethod(method, instance) } - - const method = wrap(data, value) - - // all of this is to make method destructuring work - return bindMethod(method, instance) + break } + + default: + throw failure(`@${decoratorName} can only be used on fields or methods}`) } } } diff --git a/packages/lib/src/utils/index.ts b/packages/lib/src/utils/index.ts index e855a78d..98b5f504 100644 --- a/packages/lib/src/utils/index.ts +++ b/packages/lib/src/utils/index.ts @@ -262,7 +262,7 @@ export function addLateInitializationFunction( symbol: symbol, fn: (instance: any) => void ) { - let array: LateInitializationFunctionsArray = target[symbol] + let array: LateInitializationFunctionsArray | undefined = target[symbol] if (!array || !Object.prototype.hasOwnProperty.call(target, symbol)) { // leave base array unmodified, create new array in the derived class array = array ? array.slice() : [] diff --git a/packages/lib/src/wrappers/ArraySet.ts b/packages/lib/src/wrappers/ArraySet.ts index ea84ad6a..4e7c2416 100644 --- a/packages/lib/src/wrappers/ArraySet.ts +++ b/packages/lib/src/wrappers/ArraySet.ts @@ -88,9 +88,7 @@ export class ArraySet return this.values() } - get [Symbol.toStringTag](): string { - return "ArraySet" - } + readonly [Symbol.toStringTag] = "ArraySet" } /** diff --git a/packages/lib/src/wrappers/ObjectMap.ts b/packages/lib/src/wrappers/ObjectMap.ts index 6b60cb8a..f35b6e9d 100644 --- a/packages/lib/src/wrappers/ObjectMap.ts +++ b/packages/lib/src/wrappers/ObjectMap.ts @@ -94,9 +94,7 @@ export class ObjectMap return this.entries() } - get [Symbol.toStringTag](): string { - return "ObjectMap" - } + readonly [Symbol.toStringTag] = "ObjectMap" } /** @@ -106,7 +104,7 @@ export class ObjectMap * @param [entries] Optional initial values. */ export function objectMap(entries?: ReadonlyArray | null): ObjectMap { - const initialObj: { [k: string]: V } = {} + const initialObj: Record = {} if (entries) { const len = entries.length diff --git a/packages/lib/test/action/action.test.ts b/packages/lib/test/action/action.test.ts index ecf529bf..9f42a4ed 100644 --- a/packages/lib/test/action/action.test.ts +++ b/packages/lib/test/action/action.test.ts @@ -31,7 +31,7 @@ export class P extends Model({ p2: prop(() => new P2({})), x: prop(0), arr: prop(() => []), - obj: prop<{ [k: string]: number }>(() => ({})), + obj: prop>(() => ({})), }) { @modelAction addX(n: number) { @@ -51,12 +51,12 @@ export class P extends Model({ this.arr.push(n) // this is valid in mobx5 but not mobx4 // this.obj["" + n] = n - set(this.obj, "" + n, n) + set(this.obj, String(n), n) } } test("action tracking", () => { - const events: any = [] + const events: any[] = [] const p = new P({}) @@ -662,7 +662,7 @@ test("applyAction", () => { const ra = pa.p2.addY(15) const rb = applyAction(pb, { targetPath: ["p2"], - targetPathIds: [pb.p2.$modelId!], + targetPathIds: [pb.p2.$modelId], actionName: "addY", args: [15], }) @@ -677,7 +677,7 @@ test("applyAction", () => { }) applyAction(pb, { targetPath: ["p2"], - targetPathIds: [pb.p2.$modelId!], + targetPathIds: [pb.p2.$modelId], actionName: "$$applySnapshot", args: [{ ...getSnapshot(pb.p2), y: 100 }], }) diff --git a/packages/lib/test/action/applyDelete.test.ts b/packages/lib/test/action/applyDelete.test.ts index af59ba07..6e25547a 100644 --- a/packages/lib/test/action/applyDelete.test.ts +++ b/packages/lib/test/action/applyDelete.test.ts @@ -10,11 +10,11 @@ import { autoDispose, testModel } from "../utils" @testModel("P") export class P extends Model({ - obj: prop<{ [k: string]: number } | undefined>(undefined), + obj: prop | undefined>(undefined), }) {} test("applyDelete", () => { - const events: any = [] + const events: any[] = [] const p = new P({ obj: { a: 1, b: 2 } }) diff --git a/packages/lib/test/action/applyMethodCall.test.ts b/packages/lib/test/action/applyMethodCall.test.ts index 0dc6f814..952c15c3 100644 --- a/packages/lib/test/action/applyMethodCall.test.ts +++ b/packages/lib/test/action/applyMethodCall.test.ts @@ -17,7 +17,7 @@ export class P extends Model({ }) {} test("applyCall", () => { - const events: any = [] + const events: any[] = [] const p = new P({ arr: [1, 2, 3] }) diff --git a/packages/lib/test/action/applySet.test.ts b/packages/lib/test/action/applySet.test.ts index 60c27297..e07bedae 100644 --- a/packages/lib/test/action/applySet.test.ts +++ b/packages/lib/test/action/applySet.test.ts @@ -5,11 +5,11 @@ import { autoDispose, testModel } from "../utils" export class P extends Model({ y: prop(0), ch: prop

(undefined), - obj: prop<{ [k: string]: number } | undefined>(undefined), + obj: prop | undefined>(undefined), }) {} test("applySet", () => { - const events: any = [] + const events: any[] = [] const p = new P({}) diff --git a/packages/lib/test/actionMiddlewares/actionSerialization.test.ts b/packages/lib/test/actionMiddlewares/actionSerialization.test.ts index 5138235d..892710b7 100644 --- a/packages/lib/test/actionMiddlewares/actionSerialization.test.ts +++ b/packages/lib/test/actionMiddlewares/actionSerialization.test.ts @@ -21,6 +21,7 @@ import { testModel } from "../utils" test("serializeActionCallArgument and deserializeActionCallArgument", () => { // unserializable args + // eslint-disable-next-line @typescript-eslint/no-extraneous-class class RandomClass {} const rc = new RandomClass() @@ -142,7 +143,7 @@ test("serializeActionCallArgument and deserializeActionCallArgument", () => { } expect(serializeActionCallArgument(map)).toEqual(serMap) - const mapBack = deserializeActionCallArgument(serMap) + const mapBack: Map = deserializeActionCallArgument(serMap) expect(mapBack instanceof Map).toBe(true) expect(Array.from(mapBack.entries())).toEqual(mapKV) @@ -155,7 +156,7 @@ test("serializeActionCallArgument and deserializeActionCallArgument", () => { } expect(serializeActionCallArgument(set)).toEqual(serSet) - const setBack = deserializeActionCallArgument(serSet) + const setBack: Set = deserializeActionCallArgument(serSet) expect(setBack instanceof Set).toBe(true) expect(Array.from(setBack.keys())).toEqual(setK) @@ -310,9 +311,9 @@ describe("concurrency", () => { // remove replicate(captured[0]) // trying to change a deleted item - expect(() => replicate(captured[1])).toThrow( - 'object at path ["list",1] with ids [null,"id-2"] could not be resolved' - ) + expect(() => { + replicate(captured[1]) + }).toThrow('object at path ["list",1] with ids [null,"id-2"] could not be resolved') }) test("remove same item twice", () => { @@ -324,9 +325,9 @@ describe("concurrency", () => { // remove replicate(captured[0]) // trying to remove already removed item - expect(() => replicate(captured[1])).toThrow( - 'object at path ["list",1] with ids [null,"id-2"] could not be resolved' - ) + expect(() => { + replicate(captured[1]) + }).toThrow('object at path ["list",1] with ids [null,"id-2"] could not be resolved') }) test("remove two and change text on third item", () => { @@ -338,9 +339,9 @@ describe("concurrency", () => { // remove replicate(captured[0]) // trying to change an item that moved to index 0 from index 2 - expect(() => replicate(captured[1])).toThrow( - 'object at path ["list",2] with ids [null,"id-3"] could not be resolved' - ) + expect(() => { + replicate(captured[1]) + }).toThrow('object at path ["list",2] with ids [null,"id-3"] could not be resolved') }) test("remove 0,1 and 1,2", () => { @@ -352,8 +353,8 @@ describe("concurrency", () => { // remove replicate(captured[0]) // trying to remove an item that no longer exists - expect(() => replicate(captured[1])).toThrow( - 'object at path ["list",1] with ids [null,"id-2"] could not be resolved' - ) + expect(() => { + replicate(captured[1]) + }).toThrow('object at path ["list",1] with ids [null,"id-2"] could not be resolved') }) }) diff --git a/packages/lib/test/actionMiddlewares/actionTrackingMiddleware-flow.test.ts b/packages/lib/test/actionMiddlewares/actionTrackingMiddleware-flow.test.ts index f7e13ccf..00a914b3 100644 --- a/packages/lib/test/actionMiddlewares/actionTrackingMiddleware-flow.test.ts +++ b/packages/lib/test/actionMiddlewares/actionTrackingMiddleware-flow.test.ts @@ -152,7 +152,7 @@ test("actionTrackingMiddleware - flow", async () => { if (ctx.actionName === "addXY") { return { result: ActionTrackingResult.Return, - value: ret.value + 1000, + value: (ret.value as number) + 1000, } } return undefined diff --git a/packages/lib/test/actionMiddlewares/actionTrackingMiddleware-sync.test.ts b/packages/lib/test/actionMiddlewares/actionTrackingMiddleware-sync.test.ts index fe179fa8..481906e4 100644 --- a/packages/lib/test/actionMiddlewares/actionTrackingMiddleware-sync.test.ts +++ b/packages/lib/test/actionMiddlewares/actionTrackingMiddleware-sync.test.ts @@ -128,7 +128,7 @@ test("actionTrackingMiddleware - sync", () => { if (ctx.actionName === "addXY") { return { result: ActionTrackingResult.Return, - value: ret.value + 1000, + value: (ret.value as number) + 1000, } } return undefined @@ -192,7 +192,9 @@ test("actionTrackingMiddleware - sync", () => { // throwing reset() - expect(() => p1.throw("some error")).toThrow("some error") + expect(() => { + p1.throw("some error") + }).toThrow("some error") expect(events.map(eventToString)).toMatchInlineSnapshot(` [ "throw (filter)", diff --git a/packages/lib/test/actionMiddlewares/onActionMiddleware.test.ts b/packages/lib/test/actionMiddlewares/onActionMiddleware.test.ts index 2a45e39d..aafe2f3c 100644 --- a/packages/lib/test/actionMiddlewares/onActionMiddleware.test.ts +++ b/packages/lib/test/actionMiddlewares/onActionMiddleware.test.ts @@ -214,6 +214,7 @@ test("onActionMiddleware", () => { // unserializable args reset() + // eslint-disable-next-line @typescript-eslint/no-extraneous-class class RandomClass {} const rc = new RandomClass() diff --git a/packages/lib/test/actionMiddlewares/readonlyMiddleware.test.ts b/packages/lib/test/actionMiddlewares/readonlyMiddleware.test.ts index c5558818..8d978469 100644 --- a/packages/lib/test/actionMiddlewares/readonlyMiddleware.test.ts +++ b/packages/lib/test/actionMiddlewares/readonlyMiddleware.test.ts @@ -54,10 +54,14 @@ test("subnode", () => { autoDispose(dispose) const oldY1 = p.p2.y - expect(() => p.p2.setY(300)).toThrow("tried to invoke action 'setY' over a readonly node") + expect(() => { + p.p2.setY(300) + }).toThrow("tried to invoke action 'setY' over a readonly node") expect(p.p2.y).toBe(oldY1) - allowWrite(() => p.p2.setY(300)) + allowWrite(() => { + p.p2.setY(300) + }) expect(p.p2.y).toBe(300) expect(() => p.setXY(50, 400)).toThrow("tried to invoke action 'setY' over a readonly node") @@ -81,10 +85,14 @@ test("root node", () => { autoDispose(dispose) const oldY1 = p.p2.y - expect(() => p.p2.setY(300)).toThrow("tried to invoke action 'setY' over a readonly node") + expect(() => { + p.p2.setY(300) + }).toThrow("tried to invoke action 'setY' over a readonly node") expect(p.p2.y).toBe(oldY1) - allowWrite(() => p.p2.setY(300)) + allowWrite(() => { + p.p2.setY(300) + }) expect(p.p2.y).toBe(300) const oldX2 = p.x diff --git a/packages/lib/test/actionMiddlewares/transactionMiddleware.test.ts b/packages/lib/test/actionMiddlewares/transactionMiddleware.test.ts index e2283755..499a7b93 100644 --- a/packages/lib/test/actionMiddlewares/transactionMiddleware.test.ts +++ b/packages/lib/test/actionMiddlewares/transactionMiddleware.test.ts @@ -101,7 +101,11 @@ describe("transactionMiddleware - sync", () => { }) async function delay(x: number) { - return new Promise((r) => setTimeout(() => r(x), x)) + return new Promise((r) => + setTimeout(() => { + r(x) + }, x) + ) } @testModel("P2Flow") diff --git a/packages/lib/test/actionMiddlewares/undoMiddleware.test.ts b/packages/lib/test/actionMiddlewares/undoMiddleware.test.ts index 34f58aaa..ff9132b0 100644 --- a/packages/lib/test/actionMiddlewares/undoMiddleware.test.ts +++ b/packages/lib/test/actionMiddlewares/undoMiddleware.test.ts @@ -80,10 +80,14 @@ function expectUndoManagerRedoToBe(manager: UndoManager, undoLevels: number, red expect(manager.redoQueue.length).toBe(redoLevels) if (undoLevels <= 0) { - expect(() => manager.undo()).toThrow("nothing to undo") + expect(() => { + manager.undo() + }).toThrow("nothing to undo") } if (redoLevels <= 0) { - expect(() => manager.redo()).toThrow("nothing to redo") + expect(() => { + manager.redo() + }).toThrow("nothing to redo") } } @@ -102,7 +106,9 @@ test("undoMiddleware - sync", () => { }, }) expect(manager instanceof UndoManager).toBeTruthy() - autoDispose(() => manager.dispose()) + autoDispose(() => { + manager.dispose() + }) function getEvents(): { undo: ReadonlyArray; redo: ReadonlyArray } { return { @@ -134,7 +140,9 @@ test("undoMiddleware - sync", () => { snapshots.push(getSnapshot(p)) attachedState = "beforeIncXY3,20" - expect(() => p.incXY(3, 20)).toThrow("incXY") + expect(() => { + p.incXY(3, 20) + }).toThrow("incXY") snapshots.push(getSnapshot(p)) expect(p.x).toBe(1 + 2 + 3) @@ -267,7 +275,9 @@ test("undoMiddleware - async", async () => { const manager = undoMiddleware(r, r.undoData) expect(manager instanceof UndoManager).toBeTruthy() - autoDispose(() => manager.dispose()) + autoDispose(() => { + manager.dispose() + }) function getEvents(): { undo: ReadonlyArray; redo: ReadonlyArray } { return { @@ -493,7 +503,9 @@ test("does not generate steps if using withoutUndo", () => { const p = r.p const manager = undoMiddleware(r, r.undoData) - autoDispose(() => manager.dispose()) + autoDispose(() => { + manager.dispose() + }) function expectUndoRedoToBe(undoLevels: number, redoLevels: number) { expectUndoManagerRedoToBe(manager, undoLevels, redoLevels) @@ -520,7 +532,9 @@ test("withGroup", () => { const p = r.p const manager = undoMiddleware(r, r.undoData) - autoDispose(() => manager.dispose()) + autoDispose(() => { + manager.dispose() + }) function expectUndoRedoToBe(undoLevels: number, redoLevels: number) { expectUndoManagerRedoToBe(manager, undoLevels, redoLevels) @@ -558,7 +572,9 @@ test("createGroup", () => { const p = r.p const manager = undoMiddleware(r, r.undoData) - autoDispose(() => manager.dispose()) + autoDispose(() => { + manager.dispose() + }) function expectUndoRedoToBe(undoLevels: number, redoLevels: number) { expectUndoManagerRedoToBe(manager, undoLevels, redoLevels) @@ -623,7 +639,9 @@ test("withGroupFlow - simple case", async () => { const p = r.p const manager = undoMiddleware(r, r.undoData) - autoDispose(() => manager.dispose()) + autoDispose(() => { + manager.dispose() + }) function expectUndoRedoToBe(undoLevels: number, redoLevels: number) { expectUndoManagerRedoToBe(manager, undoLevels, redoLevels) @@ -668,7 +686,9 @@ test("withGroupFlow - throwing", async () => { const p = r.p const manager = undoMiddleware(r, r.undoData) - autoDispose(() => manager.dispose()) + autoDispose(() => { + manager.dispose() + }) function expectUndoRedoToBe(undoLevels: number, redoLevels: number) { expectUndoManagerRedoToBe(manager, undoLevels, redoLevels) @@ -684,14 +704,14 @@ test("withGroupFlow - throwing", async () => { yield* _await( manager.withGroupFlow(function* () { yield* _await(p.incX(3)) - // eslint-disable-next-line no-throw-literal + // eslint-disable-next-line no-throw-literal, @typescript-eslint/only-throw-error throw "inside" }) ) fail("should have thrown") } catch (err) { expect(err).toBe("inside") - // eslint-disable-next-line no-throw-literal + // eslint-disable-next-line no-throw-literal, @typescript-eslint/only-throw-error throw "outside" } }) @@ -720,7 +740,9 @@ test("withGroupFlow - concurrent", async () => { const p = r.p const manager = undoMiddleware(r, r.undoData) - autoDispose(() => manager.dispose()) + autoDispose(() => { + manager.dispose() + }) function expectUndoRedoToBe(undoLevels: number, redoLevels: number) { expectUndoManagerRedoToBe(manager, undoLevels, redoLevels) @@ -816,7 +838,9 @@ test("concurrent async actions", async () => { const manager = undoMiddleware(r, r.undoData) expect(manager instanceof UndoManager).toBeTruthy() - autoDispose(() => manager.dispose()) + autoDispose(() => { + manager.dispose() + }) function getEvents(): { undo: ReadonlyArray; redo: ReadonlyArray } { return { @@ -980,7 +1004,9 @@ test("limit undo/redo steps", () => { maxRedoLevels: 1, maxUndoLevels: 2, }) - autoDispose(() => manager.dispose()) + autoDispose(() => { + manager.dispose() + }) function expectUndoRedoToBe(undoLevels: number, redoLevels: number) { expectUndoManagerRedoToBe(manager, undoLevels, redoLevels) diff --git a/packages/lib/test/computedTree/computedTree.test.ts b/packages/lib/test/computedTree/computedTree.test.ts index 98b94f7e..169f05c5 100644 --- a/packages/lib/test/computedTree/computedTree.test.ts +++ b/packages/lib/test/computedTree/computedTree.test.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/class-literal-property-style */ import { computed, reaction, toJS } from "mobx" import { computedTree, @@ -389,7 +390,9 @@ describe("tree utility functions", () => { } } ) - autoDispose(() => disposer(true)) + autoDispose(() => { + disposer(true) + }) expect(counter).toBe(1) @@ -405,7 +408,9 @@ describe("tree utility functions", () => { test("computed tree cannot be detached", () => { const r = new R({}) - expect(() => detach(r.model)).toThrow("tried to invoke action '$$detach' over a readonly node") + expect(() => { + detach(r.model) + }).toThrow("tried to invoke action '$$detach' over a readonly node") }) }) @@ -507,9 +512,9 @@ test("computed tree is reactive", () => { test("computed tree is readonly", () => { const r = new R({}) - expect(() => r.model.setValue(11)).toThrow( - "tried to invoke action 'setValue' over a readonly node" - ) + expect(() => { + r.model.setValue(11) + }).toThrow("tried to invoke action 'setValue' over a readonly node") }) test("computed tree works with an array of models", () => { diff --git a/packages/lib/test/dataModel/dataModel.test.ts b/packages/lib/test/dataModel/dataModel.test.ts index c07e2030..11b09eac 100644 --- a/packages/lib/test/dataModel/dataModel.test.ts +++ b/packages/lib/test/dataModel/dataModel.test.ts @@ -114,7 +114,7 @@ test("without type", async () => { expect(viewRuns).toBe(1) viewRuns = 0 - const events: any = [] + const events: any[] = [] autoDispose( addActionMiddleware({ @@ -463,7 +463,7 @@ test("with type", async () => { expect(viewRuns).toBe(1) viewRuns = 0 - const events: any = [] + const events: any[] = [] autoDispose( addActionMiddleware({ @@ -789,7 +789,9 @@ test("parent/child", () => { const tc = new ChildModel({ x: 10 }) - expect(() => pm.setSubObj(tc)).toThrow( + expect(() => { + pm.setSubObj(tc) + }).toThrow( "data models are not directly supported. you may insert the data in the tree instead ('$' property)." ) pm.setSubObj(tc.$) @@ -817,7 +819,7 @@ test("extends works", () => { const bm = new Base({ x: 10 }) expect(bm.x).toBe(10) - const events: any = [] + const events: any[] = [] autoDispose( addActionMiddleware({ diff --git a/packages/lib/test/model/modelDecorator.test.ts b/packages/lib/test/model/modelDecorator.test.ts index 22668ce7..7755c0d1 100644 --- a/packages/lib/test/model/modelDecorator.test.ts +++ b/packages/lib/test/model/modelDecorator.test.ts @@ -72,9 +72,9 @@ test("model decorator sets model type static prop and toString methods", () => { expect(`${MyModel}`).toBe(`class MyModel#${type}`) expect(`${MyModel2}`).toBe(`class MyModel#${type}`) - const inst = new MyModel2({}) as MyModel + const inst = new MyModel2({}) expect(`${inst}`).toBe(`[MyModel#${type} ${JSON.stringify(getSnapshot(inst))}]`) - expect(`${inst.toString({ withData: false })}`).toBe(`[MyModel#${type}]`) + expect(inst.toString({ withData: false })).toBe(`[MyModel#${type}]`) }) test("decoratedModel", () => { diff --git a/packages/lib/test/model/onChildAttachedTo.test.ts b/packages/lib/test/model/onChildAttachedTo.test.ts index 4a77fbfa..c1623032 100644 --- a/packages/lib/test/model/onChildAttachedTo.test.ts +++ b/packages/lib/test/model/onChildAttachedTo.test.ts @@ -38,9 +38,9 @@ beforeEach(() => { const d = onChildAttachedTo( () => node, (child) => { - const path = getParentToChildPath(node, child)! + const path = getParentToChildPath(node, child) if (!path) { - fail("path between " + node + " and " + child + " could not be found") + fail("path between node and child could not be found") } log("attached", node, child, path) return () => { @@ -120,7 +120,9 @@ beforeEach(() => { expect(events).toMatchSnapshot("new arr") // disposer - disposers.forEach((d) => d(false)) + disposers.forEach((d) => { + d(false) + }) events.length = 0 r.a.b.setArr([4, 5, 6]) expect(events).toHaveLength(0) @@ -190,7 +192,9 @@ test("dynamic target", () => { expect(events).toMatchSnapshot("remove Todo") // disposer - disposers.forEach((d) => d(false)) + disposers.forEach((d) => { + d(false) + }) events.length = 0 todoList.removeTodo(todoList.todos[0]) expect(events).toHaveLength(0) diff --git a/packages/lib/test/model/setter.test.ts b/packages/lib/test/model/setter.test.ts index 7f66ef5b..b6a90663 100644 --- a/packages/lib/test/model/setter.test.ts +++ b/packages/lib/test/model/setter.test.ts @@ -31,7 +31,7 @@ export class P extends Model({ } test("setter", () => { - const events: any = [] + const events: any[] = [] const p = new P({}) diff --git a/packages/lib/test/model/subclassing.test.ts b/packages/lib/test/model/subclassing.test.ts index a471d3f1..97dfca8d 100644 --- a/packages/lib/test/model/subclassing.test.ts +++ b/packages/lib/test/model/subclassing.test.ts @@ -439,7 +439,7 @@ test("abstract model classes with factory", () => { @computed public get error(): string | undefined { - return this.validate!(this.value) + return this.validate(this.value) } } diff --git a/packages/lib/test/model/valueType.test.ts b/packages/lib/test/model/valueType.test.ts index 056c50b9..321b46fc 100644 --- a/packages/lib/test/model/valueType.test.ts +++ b/packages/lib/test/model/valueType.test.ts @@ -72,7 +72,7 @@ test("value type", () => { // (it had no previous parent) expect(r.setProp(p1)!).toBe(p1) - const p3 = expectClonedValueType(r.arrPush(p1)!, () => r.p_arr[r.p_arr.length - 1]) + const p3 = expectClonedValueType(r.arrPush(p1), () => r.p_arr[r.p_arr.length - 1]) const p3_2 = r.arrPop() expect(p3_2).toBe(p3) diff --git a/packages/lib/test/patch/patch.test.ts b/packages/lib/test/patch/patch.test.ts index 6677c100..844c8bdb 100644 --- a/packages/lib/test/patch/patch.test.ts +++ b/packages/lib/test/patch/patch.test.ts @@ -56,7 +56,9 @@ describe("onPatches and applyPatches", () => { pInvPatches .slice() .reverse() - .forEach((invpatches) => applyPatches(p, invpatches, true)) + .forEach((invpatches) => { + applyPatches(p, invpatches, true) + }) }) expect(getSnapshot(p)).toStrictEqual(sn) } @@ -996,7 +998,9 @@ test("patches with reserved prop names", () => { pInvPatches .slice() .reverse() - .forEach((invpatches) => applyPatches(p, invpatches, true)) + .forEach((invpatches) => { + applyPatches(p, invpatches, true) + }) }) expect(getSnapshot(p)).toStrictEqual(sn) } @@ -1074,7 +1078,9 @@ test("patches with action in onAttachedToRootStore", () => { } const r = new R({}) - autoDispose(() => unregisterRootStore(r)) + autoDispose(() => { + unregisterRootStore(r) + }) registerRootStore(r) const sn = getSnapshot(r) @@ -1151,7 +1157,9 @@ test("patches with action in onAttachedToRootStore", () => { rInvPatches .slice() .reverse() - .forEach((invpatches) => applyPatches(r, invpatches, true)) + .forEach((invpatches) => { + applyPatches(r, invpatches, true) + }) }) expect(getSnapshot(r)).toStrictEqual(sn) }) @@ -1242,7 +1250,9 @@ test("global patches should not include $ in their path", () => { const disposeOnGlobalPatches = onGlobalPatches((_, p) => { globalPatches.push(...p) }) - autoDispose(() => disposeOnGlobalPatches()) + autoDispose(() => { + disposeOnGlobalPatches() + }) fromSnapshot(ParentModel, {}) diff --git a/packages/lib/test/redux/connectReduxDevTools.test.ts b/packages/lib/test/redux/connectReduxDevTools.test.ts index 13f9fdf2..5928eabc 100644 --- a/packages/lib/test/redux/connectReduxDevTools.test.ts +++ b/packages/lib/test/redux/connectReduxDevTools.test.ts @@ -28,7 +28,7 @@ test("waitAsync helper works", async () => { test("waitAsyncReject helper works", async () => { try { await waitAsyncReject(10) - throw fail("should have failed") + fail("should have failed") } catch { // do nothing } @@ -199,7 +199,9 @@ function addStandardTests() { }) test("m.setXThrow()", () => { - expect(() => m.setXThrow()).toThrow() + expect(() => { + m.setXThrow() + }).toThrow() expect(devTools.send.mock.calls).toMatchSnapshot() }) @@ -211,7 +213,7 @@ function addStandardTests() { test("m.setXAsyncThrowSync()", async () => { try { await m.setXAsyncThrowSync() - throw fail("should have thrown") + fail("should have thrown") } catch { // ignore } @@ -221,7 +223,7 @@ function addStandardTests() { test("m.setXAsyncThrowAsync()", async () => { try { await m.setXAsyncThrowAsync() - throw fail("should have thrown") + fail("should have thrown") } catch { // ignore } @@ -249,7 +251,7 @@ function addStandardTests() { test("m.setXYAsyncThrowSync() -> m.setXAsyncThrowSync()", async () => { try { await m.setXYAsyncThrowSync() - throw fail("should have thrown") + fail("should have thrown") } catch { // ignore } @@ -259,7 +261,7 @@ function addStandardTests() { test("m.setXYAsyncThrowAsync() -> m.setXYAsyncThrowAsync()", async () => { try { await m.setXYAsyncThrowAsync() - throw fail("should have thrown") + fail("should have thrown") } catch { // ignore } @@ -273,7 +275,7 @@ function addStandardTests() { test('m.addtoArray({ a: "otherA" }), m.array[0].setA()', () => { m.addToArray(new M2({ a: "otherA" })) - m.array[0]!.setA() + m.array[0].setA() expect(devTools.send.mock.calls).toMatchSnapshot() }) @@ -282,7 +284,7 @@ function addStandardTests() { x: "snapshotX", y: "snapshotY", array: [], - [modelIdKey]: m.$modelId!, + [modelIdKey]: m.$modelId, }) applySnapshot(m, snapshot) expect(devTools.send.mock.calls).toMatchSnapshot() diff --git a/packages/lib/test/ref/customRef.test.ts b/packages/lib/test/ref/customRef.test.ts index 426367b0..e05ca706 100644 --- a/packages/lib/test/ref/customRef.test.ts +++ b/packages/lib/test/ref/customRef.test.ts @@ -25,7 +25,7 @@ interface Country { @testModel("Countries") class Countries extends Model({ - countries: prop<{ [k: string]: Country }>(() => ({})), + countries: prop>(() => ({})), selectedCountryRef: prop | undefined>(), selectedCountriesRef: prop[]>(() => []), }) { @@ -73,7 +73,7 @@ const countryRef = customRef("countryRef", { getId(target) { const targetParentPath = getParentPath(target) - return "" + targetParentPath!.path + return String(targetParentPath!.path) }, onResolvedValueChange(ref, newValue, oldValue) { @@ -84,7 +84,7 @@ const countryRef = customRef("countryRef", { }, }) -const initialCountries: () => { [k: string]: Country } = () => ({ +const initialCountries: () => Record = () => ({ spain: { weather: "sunny", }, @@ -104,7 +104,7 @@ test("single ref works", () => { expect(c.selectedCountryRef).toBeUndefined() expect(c.selectedCountry).toBeUndefined() - const spain = c.countries["spain"] + const spain = c.countries.spain c.setSelectedCountry(spain) expect(c.selectedCountry).toBe(spain) @@ -121,9 +121,9 @@ test("single ref works", () => { // cloning should be ok const cloneC = clone(c) - expect(cloneC.countries["spain"]).toBeTruthy() + expect(cloneC.countries.spain).toBeTruthy() const cloneCSelectedCountry = cloneC.selectedCountry - expect(cloneCSelectedCountry).toBe(cloneC.countries["spain"]) + expect(cloneCSelectedCountry).toBe(cloneC.countries.spain) // remove referenced country c.removeCountry("spain") @@ -140,7 +140,7 @@ test("single ref works", () => { ) // clone should not be affected - expect(cloneC.selectedCountry).toBe(cloneC.countries["spain"]) + expect(cloneC.selectedCountry).toBe(cloneC.countries.spain) }) test("array ref works", () => { @@ -151,8 +151,8 @@ test("array ref works", () => { expect(c.selectedCountriesRef).toEqual([]) expect(c.selectedCountries).toEqual([]) - const spain = c.countries["spain"] - const uk = c.countries["uk"] + const spain = c.countries.spain + const uk = c.countries.uk c.setSelectedCountries([spain, uk]) expect(c.selectedCountries).toEqual([spain, uk]) @@ -175,9 +175,9 @@ test("array ref works", () => { // cloning should be ok const cloneC = clone(c) - expect(cloneC.countries["spain"]).toBeTruthy() - expect(cloneC.countries["uk"]).toBeTruthy() - expect(cloneC.selectedCountries).toEqual([cloneC.countries["spain"], cloneC.countries["uk"]]) + expect(cloneC.countries.spain).toBeTruthy() + expect(cloneC.countries.uk).toBeTruthy() + expect(cloneC.selectedCountries).toEqual([cloneC.countries.spain, cloneC.countries.uk]) // remove referenced country const oldR = r.slice() @@ -201,7 +201,7 @@ test("array ref works", () => { expect(oldR[1].current).toBe(uk) // clone should not be affected - expect(cloneC.selectedCountries).toEqual([cloneC.countries["spain"], cloneC.countries["uk"]]) + expect(cloneC.selectedCountries).toEqual([cloneC.countries.spain, cloneC.countries.uk]) }) test("single selection with getRefId", () => { @@ -285,7 +285,7 @@ const countryRef2 = customRef("countryRef2", { getId(target) { const targetParentPath = getParentPath(target) - return "" + targetParentPath!.path + return String(targetParentPath!.path) }, }) @@ -294,7 +294,7 @@ describe("resolution", () => { const c = new Countries({ countries: initialCountries(), }) - const cSpain = c.countries["spain"] + const cSpain = c.countries.spain const ref = countryRef2(cSpain) @@ -334,7 +334,7 @@ test("isRefOfType", () => { const c = new Countries({ countries: initialCountries(), }) - const cSpain = c.countries["spain"] + const cSpain = c.countries.spain const ref = countryRef(cSpain) const ref2 = countryRef2(cSpain) diff --git a/packages/lib/test/ref/rootRef.test.ts b/packages/lib/test/ref/rootRef.test.ts index 232b253a..797cbb18 100644 --- a/packages/lib/test/ref/rootRef.test.ts +++ b/packages/lib/test/ref/rootRef.test.ts @@ -39,7 +39,7 @@ class Country extends Model({ @testModel("Countries") class Countries extends Model({ - countries: prop<{ [k: string]: Country }>(() => ({})), + countries: prop>(() => ({})), selectedCountryRef: prop | undefined>(), selectedCountriesRef: prop[]>(() => []), }) { @@ -90,7 +90,7 @@ const countryRef = rootRef("countryRef", { }, }) -const initialCountries: () => { [k: string]: Country } = () => ({ +const initialCountries: () => Record = () => ({ spain: new Country({ id: "spain", weather: "sunny", @@ -113,7 +113,7 @@ test("single ref works", () => { expect(c.selectedCountryRef).toBeUndefined() expect(c.selectedCountry).toBeUndefined() - const spain = c.countries["spain"] + const spain = c.countries.spain c.setSelectedCountry(spain) expect(c.selectedCountry).toBe(spain) @@ -131,9 +131,9 @@ test("single ref works", () => { // cloning should be ok const cloneC = clone(c) - expect(cloneC.countries["spain"]).toBeTruthy() + expect(cloneC.countries.spain).toBeTruthy() const cloneCSelectedCountry = cloneC.selectedCountry - expect(cloneCSelectedCountry).toBe(cloneC.countries["spain"]) + expect(cloneCSelectedCountry).toBe(cloneC.countries.spain) // remove referenced country c.removeCountry("spain") @@ -150,7 +150,7 @@ test("single ref works", () => { ) // clone should not be affected - expect(cloneC.selectedCountry).toBe(cloneC.countries["spain"]) + expect(cloneC.selectedCountry).toBe(cloneC.countries.spain) }) test("array ref works", () => { @@ -161,8 +161,8 @@ test("array ref works", () => { expect(c.selectedCountriesRef).toEqual([]) expect(c.selectedCountries).toEqual([]) - const spain = c.countries["spain"] - const uk = c.countries["uk"] + const spain = c.countries.spain + const uk = c.countries.uk c.setSelectedCountries([spain, uk]) expect(c.selectedCountries).toEqual([spain, uk]) @@ -185,9 +185,9 @@ test("array ref works", () => { // cloning should be ok const cloneC = clone(c) - expect(cloneC.countries["spain"]).toBeTruthy() - expect(cloneC.countries["uk"]).toBeTruthy() - expect(cloneC.selectedCountries).toEqual([cloneC.countries["spain"], cloneC.countries["uk"]]) + expect(cloneC.countries.spain).toBeTruthy() + expect(cloneC.countries.uk).toBeTruthy() + expect(cloneC.selectedCountries).toEqual([cloneC.countries.spain, cloneC.countries.uk]) // remove referenced country const oldR = r.slice() @@ -211,7 +211,7 @@ test("array ref works", () => { expect(oldR[1].current).toBe(uk) // clone should not be affected - expect(cloneC.selectedCountries).toEqual([cloneC.countries["spain"], cloneC.countries["uk"]]) + expect(cloneC.selectedCountries).toEqual([cloneC.countries.spain, cloneC.countries.uk]) }) test("single selection with custom getId", () => { @@ -276,12 +276,12 @@ test("moving ref between roots", () => { const c1 = new Countries({ countries: initialCountries(), }) - const c1Spain = c1.countries["spain"] + const c1Spain = c1.countries.spain const c2 = new Countries({ countries: initialCountries(), }) - const c2Spain = c2.countries["spain"] + const c2Spain = c2.countries.spain const ref = countryRef(c1Spain) expect(ref.isValid).toBe(false) @@ -314,7 +314,7 @@ describe("resolution", () => { const c = new Countries({ countries: initialCountries(), }) - const cSpain = c.countries["spain"] + const cSpain = c.countries.spain const ref = countryRef2(cSpain) @@ -367,7 +367,7 @@ describe("resolution", () => { const c = new Countries({ countries: initialCountries(), }) - const cSpain = c.countries["spain"] + const cSpain = c.countries.spain const ref = countryRef2(cSpain) @@ -407,7 +407,7 @@ test("isRefOfType", () => { const c = new Countries({ countries: initialCountries(), }) - const cSpain = c.countries["spain"] + const cSpain = c.countries.spain const ref = countryRef(cSpain) const ref2 = countryRef2(cSpain) @@ -590,9 +590,11 @@ test("undo manager can undo removal of a referenced object in a single step", () }) const manager = undoMiddleware(c) - autoDispose(() => manager.dispose()) + autoDispose(() => { + manager.dispose() + }) - const spain = c.countries["spain"] + const spain = c.countries.spain c.setSelectedCountry(spain) expect(manager.undoQueue).toMatchInlineSnapshot(` @@ -696,7 +698,7 @@ test("backrefs can be updated in the middle of an action if the target and ref a const c = new Countries({ countries: initialCountries(), }) - const cSpain = c.countries["spain"] + const cSpain = c.countries.spain c.setSelectedCountryRef(countryRef2(cSpain)) const ref = c.selectedCountryRef! diff --git a/packages/lib/test/rootStore/rootStore.test.ts b/packages/lib/test/rootStore/rootStore.test.ts index 5b41cf49..5a058f4f 100644 --- a/packages/lib/test/rootStore/rootStore.test.ts +++ b/packages/lib/test/rootStore/rootStore.test.ts @@ -184,9 +184,9 @@ test("array as rootStore", () => { expect(registerRootStore(arr)).toBe(arr) expect(isRootStore(arr)).toBeTruthy() - expect(isRootStore(arr[0]!)).toBeFalsy() + expect(isRootStore(arr[0])).toBeFalsy() expect(getRootStore(arr)).toBe(arr) - expect(getRootStore(arr[0]!)).toBe(arr) + expect(getRootStore(arr[0])).toBe(arr) expect(events).toMatchInlineSnapshot(` [ "p3Attached", @@ -195,7 +195,7 @@ test("array as rootStore", () => { // detach p3 from root store resetEvents() - const oldP3 = arr[0]! + const oldP3 = arr[0] runUnprotected(() => { arr.splice(0, 1) }) @@ -217,9 +217,9 @@ test("array as rootStore", () => { }) expect(isRootStore(arr)).toBeTruthy() - expect(isRootStore(arr[0]!)).toBeFalsy() + expect(isRootStore(arr[0])).toBeFalsy() expect(getRootStore(arr)).toBe(arr) - expect(getRootStore(arr[0]!)).toBe(arr) + expect(getRootStore(arr[0])).toBe(arr) expect(events).toMatchInlineSnapshot(` [ "p3Attached", @@ -230,9 +230,9 @@ test("array as rootStore", () => { resetEvents() unregisterRootStore(arr) expect(isRootStore(arr)).toBeFalsy() - expect(isRootStore(arr[0]!)).toBeFalsy() + expect(isRootStore(arr[0])).toBeFalsy() expect(getRootStore(arr)).toBeUndefined() - expect(getRootStore(arr[0]!)).toBeUndefined() + expect(getRootStore(arr[0])).toBeUndefined() expect(events).toMatchInlineSnapshot(` [ "p3Detached", @@ -366,7 +366,7 @@ test("bug #384", () => { const todos: Todo[] = [] for (let i = 0; i < 5000; i++) { - todos.push(new Todo({ text: "Todo #" + i })) + todos.push(new Todo({ text: `Todo #${i}` })) } const store = new Store({}) diff --git a/packages/lib/test/snapshot/getSnapshot.test.ts b/packages/lib/test/snapshot/getSnapshot.test.ts index 808fb998..31ab58bc 100644 --- a/packages/lib/test/snapshot/getSnapshot.test.ts +++ b/packages/lib/test/snapshot/getSnapshot.test.ts @@ -4,6 +4,7 @@ import { createP } from "../testbed" import { autoDispose, testModel } from "../utils" test("basic types", () => { + // eslint-disable-next-line @typescript-eslint/no-confusing-void-expression expect(getSnapshot(undefined)).toBe(undefined) expect(getSnapshot(null)).toBe(null) expect(getSnapshot(7)).toBe(7) diff --git a/packages/lib/test/snapshot/modelProcessor.test.ts b/packages/lib/test/snapshot/modelProcessor.test.ts index 0d10c3ff..5204b812 100644 --- a/packages/lib/test/snapshot/modelProcessor.test.ts +++ b/packages/lib/test/snapshot/modelProcessor.test.ts @@ -161,7 +161,7 @@ test("output snapshot processor", () => { toSnapshotProcessor(sn, instance) { expect(instance instanceof IP4).toBe(true) return { - y: sn.arr.map((x) => "" + x).join(","), + y: sn.arr.map((x) => String(x)).join(","), } }, } @@ -182,7 +182,7 @@ test("output snapshot processor", () => { toSnapshotProcessor(sn, instance) { expect(instance instanceof P4).toBe(true) return { - y: sn.arr.map((x) => "" + x).join(","), + y: sn.arr.map((x) => String(x)).join(","), child: sn.child, } }, diff --git a/packages/lib/test/snapshot/noModelType.test.ts b/packages/lib/test/snapshot/noModelType.test.ts index a03ae5e9..d33d0a63 100644 --- a/packages/lib/test/snapshot/noModelType.test.ts +++ b/packages/lib/test/snapshot/noModelType.test.ts @@ -1,7 +1,11 @@ import { + AnyDataModel, + AnyModel, + AnyStandardType, fromSnapshot, getSnapshot, Model, + ModelClass, modelIdKey, modelSnapshotInWithMetadata, modelSnapshotOutWithMetadata, @@ -9,6 +13,7 @@ import { SnapshotInOf, tProp, types, + TypeToData, } from "../../src" import { testModel } from "../utils" @@ -31,7 +36,7 @@ test("model without model type thanks to a tProp", () => { ) expect(m2.m1 instanceof M1).toBe(true) - expect(m2.m1!.x).toBe(6) + expect(m2.m1.x).toBe(6) expect(getSnapshot(m2)).toStrictEqual( modelSnapshotOutWithMetadata(M2, { @@ -59,9 +64,9 @@ test("model without model type thanks to a tProp", () => { }) ) - const sn1 = getSnapshot(types.model(M1), m2.m1!) + const sn1 = getSnapshot(types.model(M1), m2.m1) // multiple calls should yield the same result - expect(getSnapshot(types.model(M1), m2.m1!)).toBe(sn1) + expect(getSnapshot(types.model(M1), m2.m1)).toBe(sn1) expect(sn1).toStrictEqual( modelSnapshotOutWithMetadata(M1, { @@ -85,13 +90,19 @@ test("model without model type thanks to a type passed to fromSnapshot", () => { // const m2Sn: SnapshotInOf = { y: 1 } - const testType = (type: any, sn: any, getInstance?: (val: any) => M1) => { + const testType = < + TType extends AnyStandardType | ModelClass | ModelClass, + >( + type: TType, + sn: SnapshotInOf>, + getInstance?: (val: TypeToData) => M1 | M2 | undefined | null + ) => { const fsn = fromSnapshot(type, sn) const m1 = getInstance?.(fsn) if (m1 !== undefined) { expect(m1 instanceof M1).toBe(true) - expect(m1!.x).toBe(m1Sn.x) + expect((m1 as M1).x).toBe(m1Sn.x) expect(getSnapshot(m1)).toStrictEqual(modelSnapshotOutWithMetadata(M1, m1Sn)) // TODO: do we need a getSnapshot that will skip modelType? } else { diff --git a/packages/lib/test/snapshot/propProcessor.test.ts b/packages/lib/test/snapshot/propProcessor.test.ts index c2565656..f8481ee4 100644 --- a/packages/lib/test/snapshot/propProcessor.test.ts +++ b/packages/lib/test/snapshot/propProcessor.test.ts @@ -20,7 +20,7 @@ test("input snapshot processor", () => { @testModel("customInputSnapshot") class P3 extends Model({ arr: prop(() => []).withSnapshotProcessor({ - fromSnapshot: (sn: string) => sn?.split(",").map((x) => +x), + fromSnapshot: (sn: string) => sn.split(",").map((x) => +x), }), }) {} @@ -85,7 +85,7 @@ test("output snapshot processor", () => { class IP4 extends Model({ arr: prop(() => []).withSnapshotProcessor({ toSnapshot: (sn) => { - return sn.map((x) => "" + x).join(",") + return sn.map((x) => String(x)).join(",") }, }), }) { @@ -99,7 +99,7 @@ test("output snapshot processor", () => { class P4 extends Model({ arr: prop(() => []).withSnapshotProcessor({ toSnapshot: (sn) => { - return sn.map((x) => "" + x).join(",") + return sn.map((x) => String(x)).join(",") }, }), child: prop(), @@ -210,6 +210,7 @@ test("model without model type", () => { if (!sn) return sn const snCopy = { ...sn } + // eslint-disable-next-line @typescript-eslint/no-dynamic-delete delete (snCopy as any)[modelTypeKey] return snCopy }, diff --git a/packages/lib/test/snapshot/snapshot.test.ts b/packages/lib/test/snapshot/snapshot.test.ts index 66699eec..b2b2102c 100644 --- a/packages/lib/test/snapshot/snapshot.test.ts +++ b/packages/lib/test/snapshot/snapshot.test.ts @@ -432,11 +432,11 @@ test("applySnapshot can create a new submodel", () => { test("undefined should not be allowed in arrays, but null should", () => { const p = createP() - expect(() => + expect(() => { runUnprotected(() => { p.arr.push(undefined as any) }) - ).toThrow("undefined is not supported inside arrays") + }).toThrow("undefined is not supported inside arrays") expect(p.arr.length).toBe(0) runUnprotected(() => { @@ -493,9 +493,7 @@ test("types", () => { assert( _ as SnapshotInOf>, _ as { - items?: { - [k: string]: number - } + items?: Record [modelTypeKey]?: string [modelIdKey]: string } @@ -504,9 +502,7 @@ test("types", () => { assert( _ as SnapshotOutOf>, _ as { - items: { - [k: string]: number - } + items: Record [modelTypeKey]?: string [modelIdKey]: string } diff --git a/packages/lib/test/spread/spread.test.ts b/packages/lib/test/spread/spread.test.ts index 2eb26465..2095ae1b 100644 --- a/packages/lib/test/spread/spread.test.ts +++ b/packages/lib/test/spread/spread.test.ts @@ -288,7 +288,7 @@ test("reassigning an object via spreading", () => { @testModel("SpreadObj") class SpreadObj extends Model({ [modelIdKey]: idProp, - spreadObj: prop<{ [k: string]: Obj }>(() => ({})), + spreadObj: prop>(() => ({})), }) { @modelAction add(n: string, x: number) { @@ -300,7 +300,7 @@ test("reassigning an object via spreading", () => { } @modelAction - set(spreadObj: { [k: string]: Obj }) { + set(spreadObj: Record) { this.spreadObj = spreadObj } } @@ -319,9 +319,9 @@ test("reassigning an object via spreading", () => { const o2 = o.add("two", 2) const o3 = o.add("three", 3) - expect(o.spreadObj["one"].x).toBe(1) - expect(o.spreadObj["two"].x).toBe(2) - expect(o.spreadObj["three"].x).toBe(3) + expect(o.spreadObj.one.x).toBe(1) + expect(o.spreadObj.two.x).toBe(2) + expect(o.spreadObj.three.x).toBe(3) expect(getSnapshot(o)).toMatchInlineSnapshot(` { diff --git a/packages/lib/test/standardActions/standaloneActions.test.ts b/packages/lib/test/standardActions/standaloneActions.test.ts index f1a41e46..de90e53f 100644 --- a/packages/lib/test/standardActions/standaloneActions.test.ts +++ b/packages/lib/test/standardActions/standaloneActions.test.ts @@ -17,7 +17,7 @@ import { } from "../../src" import { autoDispose, testModel } from "../utils" -test("without type", async () => { +test("without type", () => { interface Todo { done: boolean text: string @@ -65,7 +65,7 @@ test("without type", async () => { myTodoTag.toggleDone() expect(todo.done).toBe(false) - const events: any = [] + const events: any[] = [] autoDispose( addActionMiddleware({ @@ -361,7 +361,7 @@ test("without type", async () => { expect(todo.text).toBe("4") }) -test("with type", async () => { +test("with type", () => { const todoType = types.object(() => ({ done: types.boolean, text: types.string, @@ -389,7 +389,7 @@ test("with type", async () => { const todo = toTreeNode(todoType, { done: false, text: "1" }) registerRootStore(todo) - const events: any = [] + const events: any[] = [] autoDispose( addActionMiddleware({ @@ -712,13 +712,13 @@ test("standaloneFlow", async () => { const root = new DataModel({}) const pr = fetchData(root, 3) - assert(pr, _ as Promise) + void assert(pr, _ as Promise) const r = await pr assert(r, _ as number) expect(r).toBe(3) const pr2 = root.fetchX(4) - assert(pr2, _ as Promise) + void assert(pr2, _ as Promise) const r2 = await pr2 assert(r2, _ as number) expect(r2).toBe(4) diff --git a/packages/lib/test/treeUtils/sandbox.test.ts b/packages/lib/test/treeUtils/sandbox.test.ts index e22989c4..77e68a33 100644 --- a/packages/lib/test/treeUtils/sandbox.test.ts +++ b/packages/lib/test/treeUtils/sandbox.test.ts @@ -42,14 +42,18 @@ class B extends Model({ test("sandbox creates instance of SandboxManager", () => { const a = new A({ b: new B({ value: 0 }) }) const manager = sandbox(a) - autoDispose(() => manager.dispose()) + autoDispose(() => { + manager.dispose() + }) expect(manager instanceof SandboxManager).toBeTruthy() }) test("withSandbox can be called with one node or a tuple of nodes", () => { const a = new A({ b: new B({ value: 0 }) }) const manager = sandbox(a) - autoDispose(() => manager.dispose()) + autoDispose(() => { + manager.dispose() + }) manager.withSandbox([a], (node) => { assert(node, _ as A) @@ -92,7 +96,9 @@ test("withSandbox can be called with an array node", () => { const r = new R({ a: [new A({ b: new B({ value: 1 }) }), new A({ b: new B({ value: 2 }) })] }) const manager = sandbox(r) - autoDispose(() => manager.dispose()) + autoDispose(() => { + manager.dispose() + }) manager.withSandbox([r.a], (node) => { assert(node, _ as A[]) @@ -105,7 +111,9 @@ test("withSandbox can be called with an array node", () => { test("withSandbox callback is called when node is a child of subtreeRoot", () => { const a = new A({ b: new B({ value: 0 }) }) const manager = sandbox(a) - autoDispose(() => manager.dispose()) + autoDispose(() => { + manager.dispose() + }) let called = false @@ -119,7 +127,9 @@ test("withSandbox callback is called when node is a child of subtreeRoot", () => test("withSandbox throws a failure when node is not a child of subtreeRoot", () => { const a = new A({ b: new B({ value: 0 }) }) const manager = sandbox(a.b) - autoDispose(() => manager.dispose()) + autoDispose(() => { + manager.dispose() + }) expect(() => { manager.withSandbox([a], () => false) @@ -129,7 +139,9 @@ test("withSandbox throws a failure when node is not a child of subtreeRoot", () test("sandbox copy reuses IDs from original tree", () => { const a = new A({ b: new B({ value: 0 }) }) const manager = sandbox(a) - autoDispose(() => manager.dispose()) + autoDispose(() => { + manager.dispose() + }) manager.withSandbox([a], (node) => { expect(node.$modelId).toBe(a.$modelId) @@ -141,14 +153,16 @@ test("sandbox copy reuses IDs from original tree", () => { test("original tree must not be changed while withSandbox executes", () => { const a = new A({ b: new B({ value: 0 }) }) const manager = sandbox(a) - autoDispose(() => manager.dispose()) + autoDispose(() => { + manager.dispose() + }) - expect(() => + expect(() => { manager.withSandbox([a.b], () => { a.b.setValue(2) return false }) - ).toThrow("original subtree must not change while 'withSandbox' executes") + }).toThrow("original subtree must not change while 'withSandbox' executes") }) test.each<[boolean, boolean]>([ @@ -159,7 +173,9 @@ test.each<[boolean, boolean]>([ ])("withSandbox calls can be nested (%j - %j)", (commitInner, commitOuter) => { const a = new A({ b: new B({ value: 0 }) }) const manager = sandbox(a) - autoDispose(() => manager.dispose()) + autoDispose(() => { + manager.dispose() + }) manager.withSandbox([a.b], (node1) => { node1.setValue(1) @@ -184,14 +200,16 @@ test.each<[boolean, boolean]>([ test("nested withSandbox call requires sandbox node", () => { const a = new A({ b: new B({ value: 0 }) }) const manager = sandbox(a) - autoDispose(() => manager.dispose()) + autoDispose(() => { + manager.dispose() + }) manager.withSandbox([a.b], () => { - expect(() => + expect(() => { manager.withSandbox([a.b], () => { return false }) - ).toThrow("node is not a child of subtreeRootClone") + }).toThrow("node is not a child of subtreeRootClone") return false }) }) @@ -204,7 +222,9 @@ test("sandbox node is a root store if original subtree root is a root store", () } }) const manager = sandbox(a) - autoDispose(() => manager.dispose()) + autoDispose(() => { + manager.dispose() + }) expect(isRootStore(a)).toBeFalsy() manager.withSandbox([a], (node) => { @@ -232,7 +252,9 @@ test("sandbox node is a root store if original subtree root is a root store", () test("sandbox is patched when original tree changes", () => { const a = new A({ b: new B({ value: 0 }) }) const manager = sandbox(a) - autoDispose(() => manager.dispose()) + autoDispose(() => { + manager.dispose() + }) manager.withSandbox([a.b], (node) => { expect(node.value).toBe(0) @@ -250,7 +272,9 @@ test("sandbox is patched when original tree changes", () => { test("changes in sandbox can be applied to original tree - idempotent action", () => { const a = new A({ b: new B({ value: 0 }) }) const manager = sandbox(a) - autoDispose(() => manager.dispose()) + autoDispose(() => { + manager.dispose() + }) manager.withSandbox([a.b], (node) => { node.setValue(1) @@ -284,7 +308,9 @@ test("changes in sandbox can be applied to original tree - non-idempotent action const c = new C({ values: [] }) const manager = sandbox(c) - autoDispose(() => manager.dispose()) + autoDispose(() => { + manager.dispose() + }) manager.withSandbox([c], (node) => { node.append(10) @@ -304,7 +330,9 @@ test("changes in sandbox can be applied to original tree - non-idempotent action test("changes in sandbox can be rejected", () => { const a = new A({ b: new B({ value: 0 }) }) const manager = sandbox(a) - autoDispose(() => manager.dispose()) + autoDispose(() => { + manager.dispose() + }) manager.withSandbox([a.b], (node) => { node.setValue(1) @@ -328,7 +356,9 @@ test("changes in sandbox can be rejected", () => { test("changes in sandbox are rejected when fn throws", () => { const a = new A({ b: new B({ value: 0 }) }) const manager = sandbox(a) - autoDispose(() => manager.dispose()) + autoDispose(() => { + manager.dispose() + }) expect(() => { manager.withSandbox([a.b], (node) => { @@ -350,7 +380,9 @@ test("changes in sandbox are rejected when fn throws", () => { test("withSandbox can return value from fn", () => { const a = new A({ b: new B({ value: 0 }) }) const manager = sandbox(a) - autoDispose(() => manager.dispose()) + autoDispose(() => { + manager.dispose() + }) const returnValue1 = manager.withSandbox([a.b], (node) => { node.setValue(1) @@ -372,7 +404,9 @@ test("withSandbox can return value from fn", () => { test("sandbox cannot be changed outside of fn", () => { const a = new A({ b: new B({ value: 0 }) }) const manager = sandbox(a) - autoDispose(() => manager.dispose()) + autoDispose(() => { + manager.dispose() + }) let n!: B manager.withSandbox([a.b], (node) => { @@ -380,7 +414,9 @@ test("sandbox cannot be changed outside of fn", () => { return false }) - expect(() => n.setValue(1)).toThrow("tried to invoke action 'setValue' over a readonly node") + expect(() => { + n.setValue(1) + }).toThrow("tried to invoke action 'setValue' over a readonly node") }) test("sanboxed nodes can check if they are sandboxed", () => { @@ -451,7 +487,9 @@ test("sanboxed nodes can check if they are sandboxed", () => { initEvents.length = 0 const manager = sandbox(a) - autoDispose(() => manager.dispose()) + autoDispose(() => { + manager.dispose() + }) expect(initEvents).toMatchInlineSnapshot(` [ @@ -511,7 +549,9 @@ test("isSandboxedNode recognizes ref/prev/next to all be sandboxed nodes or not const a = new A({ b: new B({ value: 0 }) }) const r = new R({}) const manager = sandbox(r) - autoDispose(() => manager.dispose()) + autoDispose(() => { + manager.dispose() + }) runUnprotected(() => { r.aref = aRef(a) diff --git a/packages/lib/test/types/typeChecking.test.ts b/packages/lib/test/types/typeChecking.test.ts index 9e1c30fc..735598a0 100644 --- a/packages/lib/test/types/typeChecking.test.ts +++ b/packages/lib/test/types/typeChecking.test.ts @@ -336,7 +336,7 @@ test("tuple - simple types", () => { test("record - simple types", () => { const type = types.record(types.number) type T = TypeToData - assert(_ as T, _ as { [k: string]: number }) + assert(_ as T, _ as Record) expectTypeCheckOk(type, {}) expectTypeCheckOk(type, { x: 5, y: 6 }) @@ -652,7 +652,7 @@ test("record - complex types", () => { })) const type = types.record(valueType) - assert(_ as TypeToData, _ as { [k: string]: { y: string } }) + assert(_ as TypeToData, _ as Record) expectTypeCheckOk(type, { o: { y: "6" } }) @@ -1003,6 +1003,7 @@ test("enum (number)", () => { test("enumValues (mixed)", () => { enum A { X1, + // eslint-disable-next-line @typescript-eslint/no-mixed-enums X15 = "x15", X2 = 6, } @@ -1013,6 +1014,7 @@ test("enumValues (mixed)", () => { test("enum (mixed)", () => { enum A { X1, + // eslint-disable-next-line @typescript-eslint/no-mixed-enums X15 = "x15", X2 = 6, } diff --git a/packages/lib/test/utils.ts b/packages/lib/test/utils.ts index c6290b0b..7843cbed 100644 --- a/packages/lib/test/utils.ts +++ b/packages/lib/test/utils.ts @@ -5,7 +5,9 @@ type Disposer = () => void const disposers: Disposer[] = [] afterEach(() => { - disposers.forEach((d) => d()) + disposers.forEach((d) => { + d() + }) disposers.length = 0 }) @@ -14,7 +16,11 @@ export function autoDispose(disposer: Disposer) { } export async function delay(x: number) { - return new Promise((r) => setTimeout(() => r(x), x)) + return new Promise((r) => + setTimeout(() => { + r(x) + }, x) + ) } export function timeMock() { diff --git a/packages/lib/test/wrappers/ObjectMap.test.ts b/packages/lib/test/wrappers/ObjectMap.test.ts index 4c62cc71..913f2b6d 100644 --- a/packages/lib/test/wrappers/ObjectMap.test.ts +++ b/packages/lib/test/wrappers/ObjectMap.test.ts @@ -15,7 +15,7 @@ beforeEach(() => { }) function expectMapValues(valsN: number[]) { - const vals = valsN.map((v) => ["" + v, v] as const) + const vals = valsN.map((v) => [String(v), v] as const) expect(entries(obj)).toEqual(vals) expect([...map.values()]).toEqual(vals.map((v) => v[1])) diff --git a/packages/mobx-keystone-yjs/CHANGELOG.md b/packages/mobx-keystone-yjs/CHANGELOG.md index a2ba25ed..a41f4da8 100644 --- a/packages/mobx-keystone-yjs/CHANGELOG.md +++ b/packages/mobx-keystone-yjs/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log +## 1.5.0 + +- Added undefined to accepted primitive "JSON" types. + ## 1.4.0 - Added `YjsTextModel` as a way to use `Y.Text` as if it were a node. diff --git a/packages/mobx-keystone-yjs/package.json b/packages/mobx-keystone-yjs/package.json index 741ffa59..fa182c80 100644 --- a/packages/mobx-keystone-yjs/package.json +++ b/packages/mobx-keystone-yjs/package.json @@ -1,6 +1,6 @@ { "name": "mobx-keystone-yjs", - "version": "1.4.0", + "version": "1.5.0", "description": "Yjs bindings for mobx-keystone", "keywords": [ "mobx", @@ -70,7 +70,7 @@ "@babel/preset-env": "^7.24.4", "@babel/preset-typescript": "^7.24.1", "@types/jest": "^29.5.12", - "@types/node": "^20.12.5", + "@types/node": "^20.12.6", "babel-jest": "^29.7.0", "jest": "^29.7.0", "mobx-keystone": "workspace:packages/lib", diff --git a/packages/mobx-keystone-yjs/src/binding/YjsTextModel.ts b/packages/mobx-keystone-yjs/src/binding/YjsTextModel.ts index ebdfe7f9..538dc454 100644 --- a/packages/mobx-keystone-yjs/src/binding/YjsTextModel.ts +++ b/packages/mobx-keystone-yjs/src/binding/YjsTextModel.ts @@ -48,7 +48,7 @@ export class YjsTextModel extends Model({ @computed private get _yjsObjectPath() { const ctx = yjsBindingContext.get(this) - if (!ctx || ctx.boundObject == null) { + if (ctx?.boundObject == null) { throw failure( "the YjsTextModel instance must be part of a bound object before it can be accessed" ) @@ -100,6 +100,7 @@ export class YjsTextModel extends Model({ @computed get text(): string { this.yjsTextChangedAtom.reportObserved() + // eslint-disable-next-line @typescript-eslint/no-base-to-string return this.yjsText.toString() } @@ -119,31 +120,29 @@ export class YjsTextModel extends Model({ disposeObserveDeltaList?.() disposeObserveDeltaList = undefined - if (deltaList) { - disposeObserveDeltaList = observe(this.$.deltaList, (change) => { - if (reapplyDeltasToYjsText) { - // already gonna replace them all - return - } - if (!shouldReplicateToYjs(yjsBindingContext.get(this))) { - // yjs text is already up to date with these changes - return - } - - if ( - change.type === "splice" && - change.removedCount === 0 && - change.addedCount > 0 && - change.index === this.deltaList.length - ) { - // optimization, just adding new ones to the end - newDeltas.push(...change.added) - } else { - // any other change, we need to reapply all deltas - reapplyDeltasToYjsText = true - } - }) - } + disposeObserveDeltaList = observe(deltaList, (change) => { + if (reapplyDeltasToYjsText) { + // already gonna replace them all + return + } + if (!shouldReplicateToYjs(yjsBindingContext.get(this))) { + // yjs text is already up to date with these changes + return + } + + if ( + change.type === "splice" && + change.removedCount === 0 && + change.addedCount > 0 && + change.index === this.deltaList.length + ) { + // optimization, just adding new ones to the end + newDeltas.push(...change.added) + } else { + // any other change, we need to reapply all deltas + reapplyDeltasToYjsText = true + } + }) }, { fireImmediately: true } ) diff --git a/packages/mobx-keystone-yjs/src/binding/applyMobxKeystonePatchToYjsObject.ts b/packages/mobx-keystone-yjs/src/binding/applyMobxKeystonePatchToYjsObject.ts index 2f81c45d..fe2c21a5 100644 --- a/packages/mobx-keystone-yjs/src/binding/applyMobxKeystonePatchToYjsObject.ts +++ b/packages/mobx-keystone-yjs/src/binding/applyMobxKeystonePatchToYjsObject.ts @@ -2,13 +2,14 @@ import { Patch } from "mobx-keystone" import * as Y from "yjs" import { failure } from "../utils/error" import { convertJsonToYjsData } from "./convertJsonToYjsData" +import { JsonValueWithUndefined } from "jsonTypes" export function applyMobxKeystonePatchToYjsObject(patch: Patch, yjs: unknown): void { if (patch.path.length > 1) { const [key, ...rest] = patch.path if (yjs instanceof Y.Map) { - const child = yjs.get(String(key)) + const child = yjs.get(String(key)) as unknown if (child === undefined) { throw failure( `invalid patch path, key "${key}" not found in Yjs map - patch: ${JSON.stringify(patch)}` @@ -16,7 +17,7 @@ export function applyMobxKeystonePatchToYjsObject(patch: Patch, yjs: unknown): v } applyMobxKeystonePatchToYjsObject({ ...patch, path: rest }, child) } else if (yjs instanceof Y.Array) { - const child = yjs.get(Number(key)) + const child = yjs.get(Number(key)) as unknown if (child === undefined) { throw failure( `invalid patch path, key "${key}" not found in Yjs array - patch: ${JSON.stringify( @@ -41,7 +42,7 @@ export function applyMobxKeystonePatchToYjsObject(patch: Patch, yjs: unknown): v switch (patch.op) { case "add": case "replace": { - yjs.set(key, convertJsonToYjsData(patch.value)) + yjs.set(key, convertJsonToYjsData(patch.value as JsonValueWithUndefined)) break } case "remove": { @@ -58,21 +59,22 @@ export function applyMobxKeystonePatchToYjsObject(patch: Patch, yjs: unknown): v switch (patch.op) { case "replace": { if (key === "length") { - if (yjs.length > patch.value) { - const toDelete = yjs.length - patch.value - yjs.delete(patch.value, toDelete) + const newLength = patch.value as number + if (yjs.length > newLength) { + const toDelete = yjs.length - newLength + yjs.delete(newLength, toDelete) } else if (yjs.length < patch.value) { const toInsert = patch.value - yjs.length yjs.insert(yjs.length, Array(toInsert).fill(undefined)) } } else { yjs.delete(Number(key)) - yjs.insert(Number(key), [convertJsonToYjsData(patch.value)]) + yjs.insert(Number(key), [convertJsonToYjsData(patch.value as JsonValueWithUndefined)]) } break } case "add": { - yjs.insert(Number(key), [convertJsonToYjsData(patch.value)]) + yjs.insert(Number(key), [convertJsonToYjsData(patch.value as JsonValueWithUndefined)]) break } case "remove": { @@ -87,7 +89,7 @@ export function applyMobxKeystonePatchToYjsObject(patch: Patch, yjs: unknown): v // initialization of a YjsTextModel, do nothing } else { throw failure( - `invalid patch path, the Yjs object is of an unkown type, so key "${patch.path[0]}" cannot be found in it` + `invalid patch path, the Yjs object is of an unkown type, so key "${String(patch.path[0])}" cannot be found in it` ) } } else { diff --git a/packages/mobx-keystone-yjs/src/binding/bindYjsToMobxKeystone.ts b/packages/mobx-keystone-yjs/src/binding/bindYjsToMobxKeystone.ts index 0f3a56da..e97624f3 100644 --- a/packages/mobx-keystone-yjs/src/binding/bindYjsToMobxKeystone.ts +++ b/packages/mobx-keystone-yjs/src/binding/bindYjsToMobxKeystone.ts @@ -5,6 +5,7 @@ import { AnyStandardType, ModelClass, Patch, + SnapshotInOf, TypeToData, applyPatches, fromSnapshot, @@ -16,7 +17,7 @@ import { import * as Y from "yjs" import { getYjsCollectionAtom } from "../utils/getOrCreateYjsCollectionAtom" import { applyMobxKeystonePatchToYjsObject } from "./applyMobxKeystonePatchToYjsObject" -import { convertYjsDataToJson } from "./convertYjsDataToJson" +import { YjsData, convertYjsDataToJson } from "./convertYjsDataToJson" import { convertYjsEventToPatches } from "./convertYjsEventToPatches" import { YjsBindingContext, yjsBindingContext } from "./yjsBindingContext" @@ -50,7 +51,7 @@ export function bindYjsToMobxKeystone< /** * Disposes the binding. */ - dispose(): void + dispose: () => void /** * The Y.js origin symbol used for binding transactions. */ @@ -72,7 +73,7 @@ export function bindYjsToMobxKeystone< }, } - const yjsJson = convertYjsDataToJson(yjsObject) + const yjsJson = convertYjsDataToJson(yjsObject as YjsData) const initializationGlobalPatches: { target: object; patches: Patch[] }[] = [] @@ -83,7 +84,7 @@ export function bindYjsToMobxKeystone< try { const boundObject = yjsBindingContext.apply( - () => fromSnapshot(mobxKeystoneType, yjsJson as any), + () => fromSnapshot(mobxKeystoneType, yjsJson as unknown as SnapshotInOf>), bindingContext ) yjsBindingContext.set(boundObject, { ...bindingContext, boundObject }) diff --git a/packages/mobx-keystone-yjs/src/binding/convertJsonToYjsData.ts b/packages/mobx-keystone-yjs/src/binding/convertJsonToYjsData.ts index 38f4913e..2b159a40 100644 --- a/packages/mobx-keystone-yjs/src/binding/convertJsonToYjsData.ts +++ b/packages/mobx-keystone-yjs/src/binding/convertJsonToYjsData.ts @@ -1,19 +1,25 @@ import * as Y from "yjs" -import { JsonValue, JsonArray, JsonObject, JsonPrimitive } from "../jsonTypes" import { YjsTextModel, yjsTextModelId } from "./YjsTextModel" import { SnapshotOutOf } from "mobx-keystone" +import { YjsData } from "./convertYjsDataToJson" +import { + JsonArrayWithUndefined, + JsonObjectWithUndefined, + JsonPrimitiveWithUndefined, + JsonValueWithUndefined, +} from "jsonTypes" -function isJsonPrimitive(v: JsonValue): v is JsonPrimitive { +function isJsonPrimitiveWithUndefined(v: JsonValueWithUndefined): v is JsonPrimitiveWithUndefined { const t = typeof v - return t === "string" || t === "number" || t === "boolean" || v === null + return t === "string" || t === "number" || t === "boolean" || v === null || v === undefined } -function isJsonArray(v: JsonValue): v is JsonArray { +function isJsonArrayWithUndefined(v: JsonValueWithUndefined): v is JsonArrayWithUndefined { return Array.isArray(v) } -function isJsonObject(v: JsonValue): v is JsonObject { - return !isJsonArray(v) && typeof v === "object" +function isJsonObjectWithUndefined(v: JsonValueWithUndefined): v is JsonObjectWithUndefined { + return !isJsonArrayWithUndefined(v) && typeof v === "object" } /** @@ -21,18 +27,18 @@ function isJsonObject(v: JsonValue): v is JsonObject { * Objects are converted to Y.Maps, arrays to Y.Arrays, primitives are untouched. * Frozen values are a special case and they are kept as immutable plain values. */ -export function convertJsonToYjsData(v: JsonValue) { - if (v === undefined || isJsonPrimitive(v)) { +export function convertJsonToYjsData(v: JsonValueWithUndefined | undefined): YjsData { + if (v === undefined || isJsonPrimitiveWithUndefined(v)) { return v } - if (isJsonArray(v)) { + if (isJsonArrayWithUndefined(v)) { const arr = new Y.Array() applyJsonArrayToYArray(arr, v) - return arr + return arr as YjsData } - if (isJsonObject(v)) { + if (isJsonObjectWithUndefined(v)) { if (v.$frozen === true) { // frozen value, save as immutable object return v @@ -40,7 +46,7 @@ export function convertJsonToYjsData(v: JsonValue) { if (v.$modelType === yjsTextModelId) { const text = new Y.Text() - const yjsTextModel = v as SnapshotOutOf + const yjsTextModel = v as unknown as SnapshotOutOf yjsTextModel.deltaList.forEach((frozenDeltas) => { text.applyDelta(frozenDeltas.data) }) @@ -49,7 +55,7 @@ export function convertJsonToYjsData(v: JsonValue) { const map = new Y.Map() applyJsonObjectToYMap(map, v) - return map + return map as YjsData } throw new Error(`unsupported value type: ${v}`) @@ -58,14 +64,14 @@ export function convertJsonToYjsData(v: JsonValue) { /** * Applies a JSON array to a Y.Array, using the convertJsonToYjsData to convert the values. */ -export function applyJsonArrayToYArray(dest: Y.Array, source: JsonArray) { +export function applyJsonArrayToYArray(dest: Y.Array, source: JsonArrayWithUndefined) { dest.push(source.map(convertJsonToYjsData)) } /** * Applies a JSON object to a Y.Map, using the convertJsonToYjsData to convert the values. */ -export function applyJsonObjectToYMap(dest: Y.Map, source: JsonObject) { +export function applyJsonObjectToYMap(dest: Y.Map, source: JsonObjectWithUndefined) { Object.entries(source).forEach(([k, v]) => { dest.set(k, convertJsonToYjsData(v)) }) diff --git a/packages/mobx-keystone-yjs/src/binding/convertYjsDataToJson.ts b/packages/mobx-keystone-yjs/src/binding/convertYjsDataToJson.ts index 90d7bfbf..d6a3a018 100644 --- a/packages/mobx-keystone-yjs/src/binding/convertYjsDataToJson.ts +++ b/packages/mobx-keystone-yjs/src/binding/convertYjsDataToJson.ts @@ -1,17 +1,17 @@ import { modelSnapshotOutWithMetadata } from "mobx-keystone" import * as Y from "yjs" -import { JsonValue } from "../jsonTypes" +import { JsonObjectWithUndefined, JsonValueWithUndefined } from "../jsonTypes" import { YjsTextModel } from "./YjsTextModel" -export function convertYjsDataToJson( - yjsData: Y.Array | Y.Map | Y.Text | unknown -): JsonValue { +export type YjsData = Y.Array | Y.Map | Y.Text | JsonValueWithUndefined + +export function convertYjsDataToJson(yjsData: YjsData): JsonValueWithUndefined { if (yjsData instanceof Y.Array) { return yjsData.map((v) => convertYjsDataToJson(v)) } if (yjsData instanceof Y.Map) { - const obj: Record = {} + const obj: JsonObjectWithUndefined = {} yjsData.forEach((v, k) => { obj[k] = convertYjsDataToJson(v) }) @@ -19,13 +19,13 @@ export function convertYjsDataToJson( } if (yjsData instanceof Y.Text) { - const deltas = yjsData.toDelta() + const deltas = yjsData.toDelta() as unknown[] return modelSnapshotOutWithMetadata(YjsTextModel, { deltaList: deltas.length > 0 ? [{ $frozen: true, data: deltas }] : [], - }) as JsonValue + }) as unknown as JsonValueWithUndefined } // assume it's a primitive - return yjsData as JsonValue + return yjsData } diff --git a/packages/mobx-keystone-yjs/src/binding/convertYjsEventToPatches.ts b/packages/mobx-keystone-yjs/src/binding/convertYjsEventToPatches.ts index 35ef5ee0..c7ec021d 100644 --- a/packages/mobx-keystone-yjs/src/binding/convertYjsEventToPatches.ts +++ b/packages/mobx-keystone-yjs/src/binding/convertYjsEventToPatches.ts @@ -1,13 +1,17 @@ import { Patch } from "mobx-keystone" import * as Y from "yjs" -import { JsonArray, JsonObject, JsonValue } from "../jsonTypes" +import { + JsonArrayWithUndefined, + JsonObjectWithUndefined, + JsonValueWithUndefined, +} from "../jsonTypes" import { failure } from "../utils/error" export function convertYjsEventToPatches(event: Y.YEvent): Patch[] { const patches: Patch[] = [] if (event instanceof Y.YMapEvent) { - const source = event.target as Y.Map + const source = event.target event.changes.keys.forEach((change, key) => { const path = [...event.path, key] @@ -83,9 +87,9 @@ export function convertYjsEventToPatches(event: Y.YEvent): Patch[] { return patches } -function toPlainValue(v: Y.Map | Y.Array | JsonValue) { +function toPlainValue(v: Y.Map | Y.Array | JsonValueWithUndefined) { if (v instanceof Y.Map || v instanceof Y.Array) { - return v.toJSON() as JsonObject | JsonArray + return v.toJSON() as JsonObjectWithUndefined | JsonArrayWithUndefined } else { return v } diff --git a/packages/mobx-keystone-yjs/src/binding/yjsBindingContext.ts b/packages/mobx-keystone-yjs/src/binding/yjsBindingContext.ts index da6c6762..b34165d3 100644 --- a/packages/mobx-keystone-yjs/src/binding/yjsBindingContext.ts +++ b/packages/mobx-keystone-yjs/src/binding/yjsBindingContext.ts @@ -28,7 +28,7 @@ export interface YjsBindingContext { /** * The bound mobx-keystone instance. */ - boundObject: unknown | undefined + boundObject: unknown /** * Whether we are currently applying Y.js changes to the mobx-keystone model. diff --git a/packages/mobx-keystone-yjs/src/jsonTypes.ts b/packages/mobx-keystone-yjs/src/jsonTypes.ts index d5f9f644..69580d75 100644 --- a/packages/mobx-keystone-yjs/src/jsonTypes.ts +++ b/packages/mobx-keystone-yjs/src/jsonTypes.ts @@ -1,4 +1,9 @@ -export type JsonPrimitive = string | number | boolean | null -export type JsonValue = JsonPrimitive | JsonObject | JsonArray -export type JsonObject = { [key: string]: JsonValue } -export interface JsonArray extends Array {} +export type JsonPrimitiveWithUndefined = string | number | boolean | null | undefined +export type JsonValueWithUndefined = + | JsonPrimitiveWithUndefined + | JsonObjectWithUndefined + | JsonArrayWithUndefined +// eslint-disable-next-line @typescript-eslint/consistent-type-definitions +export type JsonObjectWithUndefined = { [key: string]: JsonValueWithUndefined } +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface JsonArrayWithUndefined extends Array {} diff --git a/packages/mobx-keystone-yjs/test/binding/YjsTextModel.test.ts b/packages/mobx-keystone-yjs/test/binding/YjsTextModel.test.ts index c90eacbd..9a95466b 100644 --- a/packages/mobx-keystone-yjs/test/binding/YjsTextModel.test.ts +++ b/packages/mobx-keystone-yjs/test/binding/YjsTextModel.test.ts @@ -14,7 +14,9 @@ test("bind a text as root object", () => { yjsObject: yTestText, mobxKeystoneType: YjsTextModel, }) - autoDispose(() => dispose()) + autoDispose(() => { + dispose() + }) expect(boundObject).toBeDefined() expect(boundObject.yjsText).toBe(yTestText) @@ -86,7 +88,9 @@ test("load a pre-exiting text", () => { yjsObject: yTestText, mobxKeystoneType: YjsTextModel, }) - autoDispose(() => dispose()) + autoDispose(() => { + dispose() + }) expect(boundObject).toBeDefined() expect(boundObject.yjsText).toBe(yTestText) @@ -127,7 +131,9 @@ test("bind a text as a sub-object (text starts undefined)", () => { yjsObject: yTestModel, mobxKeystoneType: TestModel, }) - autoDispose(() => dispose()) + autoDispose(() => { + dispose() + }) expect(boundObject).toBeDefined() expect(boundObject.text).toBeUndefined() @@ -170,7 +176,9 @@ const createSubobjectWithText = () => { yjsObject: yTestModel, mobxKeystoneType: TestModel, }) - autoDispose(() => dispose()) + autoDispose(() => { + dispose() + }) const textChanges: string[] = [] autoDispose( diff --git a/packages/mobx-keystone-yjs/test/binding/binding.test.ts b/packages/mobx-keystone-yjs/test/binding/binding.test.ts index 3d28bb38..f4c3bdf3 100644 --- a/packages/mobx-keystone-yjs/test/binding/binding.test.ts +++ b/packages/mobx-keystone-yjs/test/binding/binding.test.ts @@ -48,7 +48,9 @@ test("bind a model", () => { yjsObject: yTestModel, mobxKeystoneType: TestModel, }) - autoDispose(() => dispose()) + autoDispose(() => { + dispose() + }) expect(boundObject).toBeDefined() @@ -192,7 +194,9 @@ test("bind a simple array", () => { yjsObject: yTestArray, mobxKeystoneType: types.array(types.number), }) - autoDispose(() => dispose()) + autoDispose(() => { + dispose() + }) expect(boundObject).toBeDefined() diff --git a/packages/mobx-keystone-yjs/test/utils.ts b/packages/mobx-keystone-yjs/test/utils.ts index c8b368a2..b591f918 100644 --- a/packages/mobx-keystone-yjs/test/utils.ts +++ b/packages/mobx-keystone-yjs/test/utils.ts @@ -5,7 +5,9 @@ type Disposer = () => void const disposers: Disposer[] = [] afterEach(() => { - disposers.forEach((d) => d()) + disposers.forEach((d) => { + d() + }) disposers.length = 0 }) @@ -14,7 +16,11 @@ export function autoDispose(disposer: Disposer) { } export async function delay(x: number) { - return new Promise((r) => setTimeout(() => r(x), x)) + return new Promise((r) => + setTimeout(() => { + r(x) + }, x) + ) } export const testModel = (name: string) => { diff --git a/yarn.lock b/yarn.lock index 77f11a7c..02983f51 100644 --- a/yarn.lock +++ b/yarn.lock @@ -214,44 +214,14 @@ __metadata: languageName: node linkType: hard -"@babel/compat-data@npm:^7.22.6, @babel/compat-data@npm:^7.23.5, @babel/compat-data@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/compat-data@npm:7.24.1" - checksum: 10c0/8a1935450345c326b14ea632174696566ef9b353bd0d6fb682456c0774342eeee7654877ced410f24a731d386fdcbf980b75083fc764964d6f816b65792af2f5 - languageName: node - linkType: hard - -"@babel/compat-data@npm:^7.24.4": +"@babel/compat-data@npm:^7.22.6, @babel/compat-data@npm:^7.23.5, @babel/compat-data@npm:^7.24.4": version: 7.24.4 resolution: "@babel/compat-data@npm:7.24.4" checksum: 10c0/9cd8a9cd28a5ca6db5d0e27417d609f95a8762b655e8c9c97fd2de08997043ae99f0139007083c5e607601c6122e8432c85fe391731b19bf26ad458fa0c60dd3 languageName: node linkType: hard -"@babel/core@npm:^7.11.6, @babel/core@npm:^7.12.3, @babel/core@npm:^7.19.6, @babel/core@npm:^7.21.3, @babel/core@npm:^7.23.3": - version: 7.24.3 - resolution: "@babel/core@npm:7.24.3" - dependencies: - "@ampproject/remapping": "npm:^2.2.0" - "@babel/code-frame": "npm:^7.24.2" - "@babel/generator": "npm:^7.24.1" - "@babel/helper-compilation-targets": "npm:^7.23.6" - "@babel/helper-module-transforms": "npm:^7.23.3" - "@babel/helpers": "npm:^7.24.1" - "@babel/parser": "npm:^7.24.1" - "@babel/template": "npm:^7.24.0" - "@babel/traverse": "npm:^7.24.1" - "@babel/types": "npm:^7.24.0" - convert-source-map: "npm:^2.0.0" - debug: "npm:^4.1.0" - gensync: "npm:^1.0.0-beta.2" - json5: "npm:^2.2.3" - semver: "npm:^6.3.1" - checksum: 10c0/e6e756b6de27d0312514a005688fa1915c521ad4269a388913eff2120a546538078f8488d6d16e86f851872f263cb45a6bbae08738297afb9382600d2ac342a9 - languageName: node - linkType: hard - -"@babel/core@npm:^7.24.4": +"@babel/core@npm:^7.11.6, @babel/core@npm:^7.12.3, @babel/core@npm:^7.19.6, @babel/core@npm:^7.21.3, @babel/core@npm:^7.23.3, @babel/core@npm:^7.24.4": version: 7.24.4 resolution: "@babel/core@npm:7.24.4" dependencies: @@ -274,19 +244,7 @@ __metadata: languageName: node linkType: hard -"@babel/generator@npm:^7.23.3, @babel/generator@npm:^7.24.1, @babel/generator@npm:^7.7.2": - version: 7.24.1 - resolution: "@babel/generator@npm:7.24.1" - dependencies: - "@babel/types": "npm:^7.24.0" - "@jridgewell/gen-mapping": "npm:^0.3.5" - "@jridgewell/trace-mapping": "npm:^0.3.25" - jsesc: "npm:^2.5.1" - checksum: 10c0/f0eea7497657cdf68cfb4b7d181588e1498eefd1f303d73b0d8ca9b21a6db27136a6f5beb8f988b6bdcd4249870826080950450fd310951de42ecf36df274881 - languageName: node - linkType: hard - -"@babel/generator@npm:^7.24.4": +"@babel/generator@npm:^7.23.3, @babel/generator@npm:^7.24.1, @babel/generator@npm:^7.24.4, @babel/generator@npm:^7.7.2": version: 7.24.4 resolution: "@babel/generator@npm:7.24.4" dependencies: @@ -329,26 +287,7 @@ __metadata: languageName: node linkType: hard -"@babel/helper-create-class-features-plugin@npm:^7.18.6, @babel/helper-create-class-features-plugin@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/helper-create-class-features-plugin@npm:7.24.1" - dependencies: - "@babel/helper-annotate-as-pure": "npm:^7.22.5" - "@babel/helper-environment-visitor": "npm:^7.22.20" - "@babel/helper-function-name": "npm:^7.23.0" - "@babel/helper-member-expression-to-functions": "npm:^7.23.0" - "@babel/helper-optimise-call-expression": "npm:^7.22.5" - "@babel/helper-replace-supers": "npm:^7.24.1" - "@babel/helper-skip-transparent-expression-wrappers": "npm:^7.22.5" - "@babel/helper-split-export-declaration": "npm:^7.22.6" - semver: "npm:^6.3.1" - peerDependencies: - "@babel/core": ^7.0.0 - checksum: 10c0/45372890634c37deefc81f44b7d958fe210f7da7d8a2239c9849c6041a56536f74bf3aa2d115bc06d5680d0dc49c1303f74a045d76ae0dd1592c7d5c0c268ebc - languageName: node - linkType: hard - -"@babel/helper-create-class-features-plugin@npm:^7.24.4": +"@babel/helper-create-class-features-plugin@npm:^7.18.6, @babel/helper-create-class-features-plugin@npm:^7.24.1, @babel/helper-create-class-features-plugin@npm:^7.24.4": version: 7.24.4 resolution: "@babel/helper-create-class-features-plugin@npm:7.24.4" dependencies: @@ -585,17 +524,6 @@ __metadata: languageName: node linkType: hard -"@babel/helpers@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/helpers@npm:7.24.1" - dependencies: - "@babel/template": "npm:^7.24.0" - "@babel/traverse": "npm:^7.24.1" - "@babel/types": "npm:^7.24.0" - checksum: 10c0/b3445860ae749fc664682b291f092285e949114e8336784ae29f88eb4c176279b01cc6740005a017a0389ae4b4e928d5bbbc01de7da7e400c972e3d6f792063a - languageName: node - linkType: hard - "@babel/helpers@npm:^7.24.4": version: 7.24.4 resolution: "@babel/helpers@npm:7.24.4" @@ -619,16 +547,7 @@ __metadata: languageName: node linkType: hard -"@babel/parser@npm:^7.1.0, @babel/parser@npm:^7.14.7, @babel/parser@npm:^7.20.7, @babel/parser@npm:^7.21.8, @babel/parser@npm:^7.22.5, @babel/parser@npm:^7.22.7, @babel/parser@npm:^7.24.0, @babel/parser@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/parser@npm:7.24.1" - bin: - parser: ./bin/babel-parser.js - checksum: 10c0/d2a8b99aa5f33182b69d5569367403a40e7c027ae3b03a1f81fd8ac9b06ceb85b31f6ee4267fb90726dc2ac99909c6bdaa9cf16c379efab73d8dfe85cee32c50 - languageName: node - linkType: hard - -"@babel/parser@npm:^7.24.4": +"@babel/parser@npm:^7.1.0, @babel/parser@npm:^7.14.7, @babel/parser@npm:^7.20.7, @babel/parser@npm:^7.21.8, @babel/parser@npm:^7.22.5, @babel/parser@npm:^7.24.0, @babel/parser@npm:^7.24.1, @babel/parser@npm:^7.24.4": version: 7.24.4 resolution: "@babel/parser@npm:7.24.4" bin: @@ -1011,17 +930,6 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-block-scoping@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/plugin-transform-block-scoping@npm:7.24.1" - dependencies: - "@babel/helper-plugin-utils": "npm:^7.24.0" - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 10c0/1a230ad95d9672626831e22df9b4838901681fa11d44c3811d71ca64ea53f5e87de2abef865f70fe62657053278d9034cc4ea3bab0fd3300bdf9e73b3f85f97a - languageName: node - linkType: hard - "@babel/plugin-transform-block-scoping@npm:^7.24.4": version: 7.24.4 resolution: "@babel/plugin-transform-block-scoping@npm:7.24.4" @@ -1045,19 +953,6 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-class-static-block@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/plugin-transform-class-static-block@npm:7.24.1" - dependencies: - "@babel/helper-create-class-features-plugin": "npm:^7.24.1" - "@babel/helper-plugin-utils": "npm:^7.24.0" - "@babel/plugin-syntax-class-static-block": "npm:^7.14.5" - peerDependencies: - "@babel/core": ^7.12.0 - checksum: 10c0/3095d02b7932890b82346d42200a89a56b6ca7d25a69a94242ab5b1772f18138b8e639358dd70d23add2df8b0d1640e1e13729c2c275ecce550cbe89048ba85f - languageName: node - linkType: hard - "@babel/plugin-transform-class-static-block@npm:^7.24.4": version: 7.24.4 resolution: "@babel/plugin-transform-class-static-block@npm:7.24.4" @@ -1655,97 +1550,7 @@ __metadata: languageName: node linkType: hard -"@babel/preset-env@npm:^7.19.4, @babel/preset-env@npm:^7.20.2, @babel/preset-env@npm:^7.22.9": - version: 7.24.3 - resolution: "@babel/preset-env@npm:7.24.3" - dependencies: - "@babel/compat-data": "npm:^7.24.1" - "@babel/helper-compilation-targets": "npm:^7.23.6" - "@babel/helper-plugin-utils": "npm:^7.24.0" - "@babel/helper-validator-option": "npm:^7.23.5" - "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "npm:^7.24.1" - "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "npm:^7.24.1" - "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": "npm:^7.24.1" - "@babel/plugin-proposal-private-property-in-object": "npm:7.21.0-placeholder-for-preset-env.2" - "@babel/plugin-syntax-async-generators": "npm:^7.8.4" - "@babel/plugin-syntax-class-properties": "npm:^7.12.13" - "@babel/plugin-syntax-class-static-block": "npm:^7.14.5" - "@babel/plugin-syntax-dynamic-import": "npm:^7.8.3" - "@babel/plugin-syntax-export-namespace-from": "npm:^7.8.3" - "@babel/plugin-syntax-import-assertions": "npm:^7.24.1" - "@babel/plugin-syntax-import-attributes": "npm:^7.24.1" - "@babel/plugin-syntax-import-meta": "npm:^7.10.4" - "@babel/plugin-syntax-json-strings": "npm:^7.8.3" - "@babel/plugin-syntax-logical-assignment-operators": "npm:^7.10.4" - "@babel/plugin-syntax-nullish-coalescing-operator": "npm:^7.8.3" - "@babel/plugin-syntax-numeric-separator": "npm:^7.10.4" - "@babel/plugin-syntax-object-rest-spread": "npm:^7.8.3" - "@babel/plugin-syntax-optional-catch-binding": "npm:^7.8.3" - "@babel/plugin-syntax-optional-chaining": "npm:^7.8.3" - "@babel/plugin-syntax-private-property-in-object": "npm:^7.14.5" - "@babel/plugin-syntax-top-level-await": "npm:^7.14.5" - "@babel/plugin-syntax-unicode-sets-regex": "npm:^7.18.6" - "@babel/plugin-transform-arrow-functions": "npm:^7.24.1" - "@babel/plugin-transform-async-generator-functions": "npm:^7.24.3" - "@babel/plugin-transform-async-to-generator": "npm:^7.24.1" - "@babel/plugin-transform-block-scoped-functions": "npm:^7.24.1" - "@babel/plugin-transform-block-scoping": "npm:^7.24.1" - "@babel/plugin-transform-class-properties": "npm:^7.24.1" - "@babel/plugin-transform-class-static-block": "npm:^7.24.1" - "@babel/plugin-transform-classes": "npm:^7.24.1" - "@babel/plugin-transform-computed-properties": "npm:^7.24.1" - "@babel/plugin-transform-destructuring": "npm:^7.24.1" - "@babel/plugin-transform-dotall-regex": "npm:^7.24.1" - "@babel/plugin-transform-duplicate-keys": "npm:^7.24.1" - "@babel/plugin-transform-dynamic-import": "npm:^7.24.1" - "@babel/plugin-transform-exponentiation-operator": "npm:^7.24.1" - "@babel/plugin-transform-export-namespace-from": "npm:^7.24.1" - "@babel/plugin-transform-for-of": "npm:^7.24.1" - "@babel/plugin-transform-function-name": "npm:^7.24.1" - "@babel/plugin-transform-json-strings": "npm:^7.24.1" - "@babel/plugin-transform-literals": "npm:^7.24.1" - "@babel/plugin-transform-logical-assignment-operators": "npm:^7.24.1" - "@babel/plugin-transform-member-expression-literals": "npm:^7.24.1" - "@babel/plugin-transform-modules-amd": "npm:^7.24.1" - "@babel/plugin-transform-modules-commonjs": "npm:^7.24.1" - "@babel/plugin-transform-modules-systemjs": "npm:^7.24.1" - "@babel/plugin-transform-modules-umd": "npm:^7.24.1" - "@babel/plugin-transform-named-capturing-groups-regex": "npm:^7.22.5" - "@babel/plugin-transform-new-target": "npm:^7.24.1" - "@babel/plugin-transform-nullish-coalescing-operator": "npm:^7.24.1" - "@babel/plugin-transform-numeric-separator": "npm:^7.24.1" - "@babel/plugin-transform-object-rest-spread": "npm:^7.24.1" - "@babel/plugin-transform-object-super": "npm:^7.24.1" - "@babel/plugin-transform-optional-catch-binding": "npm:^7.24.1" - "@babel/plugin-transform-optional-chaining": "npm:^7.24.1" - "@babel/plugin-transform-parameters": "npm:^7.24.1" - "@babel/plugin-transform-private-methods": "npm:^7.24.1" - "@babel/plugin-transform-private-property-in-object": "npm:^7.24.1" - "@babel/plugin-transform-property-literals": "npm:^7.24.1" - "@babel/plugin-transform-regenerator": "npm:^7.24.1" - "@babel/plugin-transform-reserved-words": "npm:^7.24.1" - "@babel/plugin-transform-shorthand-properties": "npm:^7.24.1" - "@babel/plugin-transform-spread": "npm:^7.24.1" - "@babel/plugin-transform-sticky-regex": "npm:^7.24.1" - "@babel/plugin-transform-template-literals": "npm:^7.24.1" - "@babel/plugin-transform-typeof-symbol": "npm:^7.24.1" - "@babel/plugin-transform-unicode-escapes": "npm:^7.24.1" - "@babel/plugin-transform-unicode-property-regex": "npm:^7.24.1" - "@babel/plugin-transform-unicode-regex": "npm:^7.24.1" - "@babel/plugin-transform-unicode-sets-regex": "npm:^7.24.1" - "@babel/preset-modules": "npm:0.1.6-no-external-plugins" - babel-plugin-polyfill-corejs2: "npm:^0.4.10" - babel-plugin-polyfill-corejs3: "npm:^0.10.4" - babel-plugin-polyfill-regenerator: "npm:^0.6.1" - core-js-compat: "npm:^3.31.0" - semver: "npm:^6.3.1" - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 10c0/abd6f3b6c6a71d4ff766cda5b51467677a811240d022492e651065e26ce1a8eb2067eabe5653fce80dda9c5c204fb7b89b419578d7e86eaaf7970929ee7b4885 - languageName: node - linkType: hard - -"@babel/preset-env@npm:^7.24.4": +"@babel/preset-env@npm:^7.19.4, @babel/preset-env@npm:^7.20.2, @babel/preset-env@npm:^7.22.9, @babel/preset-env@npm:^7.24.4": version: 7.24.4 resolution: "@babel/preset-env@npm:7.24.4" dependencies: @@ -2118,88 +1923,6 @@ __metadata: languageName: node linkType: hard -"@docusaurus/core@npm:3.1.1": - version: 3.1.1 - resolution: "@docusaurus/core@npm:3.1.1" - dependencies: - "@babel/core": "npm:^7.23.3" - "@babel/generator": "npm:^7.23.3" - "@babel/plugin-syntax-dynamic-import": "npm:^7.8.3" - "@babel/plugin-transform-runtime": "npm:^7.22.9" - "@babel/preset-env": "npm:^7.22.9" - "@babel/preset-react": "npm:^7.22.5" - "@babel/preset-typescript": "npm:^7.22.5" - "@babel/runtime": "npm:^7.22.6" - "@babel/runtime-corejs3": "npm:^7.22.6" - "@babel/traverse": "npm:^7.22.8" - "@docusaurus/cssnano-preset": "npm:3.1.1" - "@docusaurus/logger": "npm:3.1.1" - "@docusaurus/mdx-loader": "npm:3.1.1" - "@docusaurus/react-loadable": "npm:5.5.2" - "@docusaurus/utils": "npm:3.1.1" - "@docusaurus/utils-common": "npm:3.1.1" - "@docusaurus/utils-validation": "npm:3.1.1" - "@slorber/static-site-generator-webpack-plugin": "npm:^4.0.7" - "@svgr/webpack": "npm:^6.5.1" - autoprefixer: "npm:^10.4.14" - babel-loader: "npm:^9.1.3" - babel-plugin-dynamic-import-node: "npm:^2.3.3" - boxen: "npm:^6.2.1" - chalk: "npm:^4.1.2" - chokidar: "npm:^3.5.3" - clean-css: "npm:^5.3.2" - cli-table3: "npm:^0.6.3" - combine-promises: "npm:^1.1.0" - commander: "npm:^5.1.0" - copy-webpack-plugin: "npm:^11.0.0" - core-js: "npm:^3.31.1" - css-loader: "npm:^6.8.1" - css-minimizer-webpack-plugin: "npm:^4.2.2" - cssnano: "npm:^5.1.15" - del: "npm:^6.1.1" - detect-port: "npm:^1.5.1" - escape-html: "npm:^1.0.3" - eta: "npm:^2.2.0" - file-loader: "npm:^6.2.0" - fs-extra: "npm:^11.1.1" - html-minifier-terser: "npm:^7.2.0" - html-tags: "npm:^3.3.1" - html-webpack-plugin: "npm:^5.5.3" - leven: "npm:^3.1.0" - lodash: "npm:^4.17.21" - mini-css-extract-plugin: "npm:^2.7.6" - postcss: "npm:^8.4.26" - postcss-loader: "npm:^7.3.3" - prompts: "npm:^2.4.2" - react-dev-utils: "npm:^12.0.1" - react-helmet-async: "npm:^1.3.0" - react-loadable: "npm:@docusaurus/react-loadable@5.5.2" - react-loadable-ssr-addon-v5-slorber: "npm:^1.0.1" - react-router: "npm:^5.3.4" - react-router-config: "npm:^5.1.1" - react-router-dom: "npm:^5.3.4" - rtl-detect: "npm:^1.0.4" - semver: "npm:^7.5.4" - serve-handler: "npm:^6.1.5" - shelljs: "npm:^0.8.5" - terser-webpack-plugin: "npm:^5.3.9" - tslib: "npm:^2.6.0" - update-notifier: "npm:^6.0.2" - url-loader: "npm:^4.1.1" - webpack: "npm:^5.88.1" - webpack-bundle-analyzer: "npm:^4.9.0" - webpack-dev-server: "npm:^4.15.1" - webpack-merge: "npm:^5.9.0" - webpackbar: "npm:^5.0.2" - peerDependencies: - react: ^18.0.0 - react-dom: ^18.0.0 - bin: - docusaurus: bin/docusaurus.mjs - checksum: 10c0/7e7310258fd60bde11eb94a6240c469ddeaf7e55ec35e2f23878a201f25971b016cfd334c2bf0a7a6aa9340bbfedf781b4d875905519597439b88b2b32a54d73 - languageName: node - linkType: hard - "@docusaurus/core@npm:3.2.1, @docusaurus/core@npm:^3.2.1": version: 3.2.1 resolution: "@docusaurus/core@npm:3.2.1" @@ -2283,18 +2006,6 @@ __metadata: languageName: node linkType: hard -"@docusaurus/cssnano-preset@npm:3.1.1": - version: 3.1.1 - resolution: "@docusaurus/cssnano-preset@npm:3.1.1" - dependencies: - cssnano-preset-advanced: "npm:^5.3.10" - postcss: "npm:^8.4.26" - postcss-sort-media-queries: "npm:^4.4.1" - tslib: "npm:^2.6.0" - checksum: 10c0/8f3e2f495cb5420437478b6c6b9d83f509f8f17ab06db124ee751749d35f56408d2bad48b56439bc42c02e7faf49b12920bc1e078bbe28143e423ac10d421478 - languageName: node - linkType: hard - "@docusaurus/cssnano-preset@npm:3.2.1": version: 3.2.1 resolution: "@docusaurus/cssnano-preset@npm:3.2.1" @@ -2307,16 +2018,6 @@ __metadata: languageName: node linkType: hard -"@docusaurus/logger@npm:3.1.1": - version: 3.1.1 - resolution: "@docusaurus/logger@npm:3.1.1" - dependencies: - chalk: "npm:^4.1.2" - tslib: "npm:^2.6.0" - checksum: 10c0/a70814e8a54b800aadd2c76f34411c9ab4b0907287ae3cee775c7ebb15c797f5807d3a25bd30519361654e667a81c496c8e0229cce989ba92028f76fde73f9e4 - languageName: node - linkType: hard - "@docusaurus/logger@npm:3.2.1": version: 3.2.1 resolution: "@docusaurus/logger@npm:3.2.1" @@ -2327,43 +2028,6 @@ __metadata: languageName: node linkType: hard -"@docusaurus/mdx-loader@npm:3.1.1": - version: 3.1.1 - resolution: "@docusaurus/mdx-loader@npm:3.1.1" - dependencies: - "@babel/parser": "npm:^7.22.7" - "@babel/traverse": "npm:^7.22.8" - "@docusaurus/logger": "npm:3.1.1" - "@docusaurus/utils": "npm:3.1.1" - "@docusaurus/utils-validation": "npm:3.1.1" - "@mdx-js/mdx": "npm:^3.0.0" - "@slorber/remark-comment": "npm:^1.0.0" - escape-html: "npm:^1.0.3" - estree-util-value-to-estree: "npm:^3.0.1" - file-loader: "npm:^6.2.0" - fs-extra: "npm:^11.1.1" - image-size: "npm:^1.0.2" - mdast-util-mdx: "npm:^3.0.0" - mdast-util-to-string: "npm:^4.0.0" - rehype-raw: "npm:^7.0.0" - remark-directive: "npm:^3.0.0" - remark-emoji: "npm:^4.0.0" - remark-frontmatter: "npm:^5.0.0" - remark-gfm: "npm:^4.0.0" - stringify-object: "npm:^3.3.0" - tslib: "npm:^2.6.0" - unified: "npm:^11.0.3" - unist-util-visit: "npm:^5.0.0" - url-loader: "npm:^4.1.1" - vfile: "npm:^6.0.1" - webpack: "npm:^5.88.1" - peerDependencies: - react: ^18.0.0 - react-dom: ^18.0.0 - checksum: 10c0/b73185dd2a77edfc2a0e840ac339ed90cf66a359861b1e79cfdf678737c26d20a96a186511cf8eac2c17bdb336bec7fa2028341c8c28d862410778ef855c433e - languageName: node - linkType: hard - "@docusaurus/mdx-loader@npm:3.2.1": version: 3.2.1 resolution: "@docusaurus/mdx-loader@npm:3.2.1" @@ -2399,25 +2063,6 @@ __metadata: languageName: node linkType: hard -"@docusaurus/module-type-aliases@npm:3.1.1": - version: 3.1.1 - resolution: "@docusaurus/module-type-aliases@npm:3.1.1" - dependencies: - "@docusaurus/react-loadable": "npm:5.5.2" - "@docusaurus/types": "npm:3.1.1" - "@types/history": "npm:^4.7.11" - "@types/react": "npm:*" - "@types/react-router-config": "npm:*" - "@types/react-router-dom": "npm:*" - react-helmet-async: "npm:*" - react-loadable: "npm:@docusaurus/react-loadable@5.5.2" - peerDependencies: - react: "*" - react-dom: "*" - checksum: 10c0/d3b79548b995b99db19cbff69b9b83493d901c080582e76a44237336e8409177cb2628f9e0eaa4c6cc336278e52c89e89aca84e41c1870b96c0d642868570d96 - languageName: node - linkType: hard - "@docusaurus/module-type-aliases@npm:3.2.1, @docusaurus/module-type-aliases@npm:^3.2.1": version: 3.2.1 resolution: "@docusaurus/module-type-aliases@npm:3.2.1" @@ -2465,7 +2110,7 @@ __metadata: languageName: node linkType: hard -"@docusaurus/plugin-content-docs@npm:3.2.1": +"@docusaurus/plugin-content-docs@npm:3.2.1, @docusaurus/plugin-content-docs@npm:^2 || ^3": version: 3.2.1 resolution: "@docusaurus/plugin-content-docs@npm:3.2.1" dependencies: @@ -2492,32 +2137,6 @@ __metadata: languageName: node linkType: hard -"@docusaurus/plugin-content-docs@npm:^2 || ^3": - version: 3.1.1 - resolution: "@docusaurus/plugin-content-docs@npm:3.1.1" - dependencies: - "@docusaurus/core": "npm:3.1.1" - "@docusaurus/logger": "npm:3.1.1" - "@docusaurus/mdx-loader": "npm:3.1.1" - "@docusaurus/module-type-aliases": "npm:3.1.1" - "@docusaurus/types": "npm:3.1.1" - "@docusaurus/utils": "npm:3.1.1" - "@docusaurus/utils-validation": "npm:3.1.1" - "@types/react-router-config": "npm:^5.0.7" - combine-promises: "npm:^1.1.0" - fs-extra: "npm:^11.1.1" - js-yaml: "npm:^4.1.0" - lodash: "npm:^4.17.21" - tslib: "npm:^2.6.0" - utility-types: "npm:^3.10.0" - webpack: "npm:^5.88.1" - peerDependencies: - react: ^18.0.0 - react-dom: ^18.0.0 - checksum: 10c0/affb37111782ad3f79ce1e8964cf57c1b4d44bb5525d37d06a188a7615a0d94af5140e93f6d65b8f1365e8b6347a9dd0436f510083bd97a5f4b7a3df799d3b9c - languageName: node - linkType: hard - "@docusaurus/plugin-content-pages@npm:3.2.1": version: 3.2.1 resolution: "@docusaurus/plugin-content-pages@npm:3.2.1" @@ -2745,50 +2364,20 @@ __metadata: languageName: node linkType: hard -"@docusaurus/theme-translations@npm:3.2.1": +"@docusaurus/theme-translations@npm:3.2.1, @docusaurus/theme-translations@npm:^2 || ^3": version: 3.2.1 - resolution: "@docusaurus/theme-translations@npm:3.2.1" - dependencies: - fs-extra: "npm:^11.1.1" - tslib: "npm:^2.6.0" - checksum: 10c0/b364cf03ba353b7188533539935578c5f7be942a0164fe878bf92bb21bb53a5a36ba3ee9f1dc18ae1a6f7d93b765e57d067ee663c1c749302a92eb5fe17311cf - languageName: node - linkType: hard - -"@docusaurus/theme-translations@npm:^2 || ^3": - version: 3.1.1 - resolution: "@docusaurus/theme-translations@npm:3.1.1" - dependencies: - fs-extra: "npm:^11.1.1" - tslib: "npm:^2.6.0" - checksum: 10c0/8f118d6c8b1db719cd62bef0aceec6b1ebd1b0d00960a99360a0b7e337fddb689ca0f1a0f580b25fa4bbfce83966b6f9ddb6b607a105337f1d6388b4a1522e5f - languageName: node - linkType: hard - -"@docusaurus/tsconfig@npm:^3.2.1": - version: 3.2.1 - resolution: "@docusaurus/tsconfig@npm:3.2.1" - checksum: 10c0/6dc9d908d26b44bc02065437d6bdc29be278b6a6660565e53d0d38c72d8fd4a8ddaf77602652ed7f0fe518498ea85b9949b81c62b7773b96089bafc647b3abfd - languageName: node - linkType: hard - -"@docusaurus/types@npm:3.1.1": - version: 3.1.1 - resolution: "@docusaurus/types@npm:3.1.1" - dependencies: - "@mdx-js/mdx": "npm:^3.0.0" - "@types/history": "npm:^4.7.11" - "@types/react": "npm:*" - commander: "npm:^5.1.0" - joi: "npm:^17.9.2" - react-helmet-async: "npm:^1.3.0" - utility-types: "npm:^3.10.0" - webpack: "npm:^5.88.1" - webpack-merge: "npm:^5.9.0" - peerDependencies: - react: ^18.0.0 - react-dom: ^18.0.0 - checksum: 10c0/7322d1f1c19f4c869fe29af58cb8d1fc59b6a7173fc9a019ed75c70a850a89701a0ec77cd3e12c0979f86c18078430f62f72f30cbebad1e19802c5c7f2bed079 + resolution: "@docusaurus/theme-translations@npm:3.2.1" + dependencies: + fs-extra: "npm:^11.1.1" + tslib: "npm:^2.6.0" + checksum: 10c0/b364cf03ba353b7188533539935578c5f7be942a0164fe878bf92bb21bb53a5a36ba3ee9f1dc18ae1a6f7d93b765e57d067ee663c1c749302a92eb5fe17311cf + languageName: node + linkType: hard + +"@docusaurus/tsconfig@npm:^3.2.1": + version: 3.2.1 + resolution: "@docusaurus/tsconfig@npm:3.2.1" + checksum: 10c0/6dc9d908d26b44bc02065437d6bdc29be278b6a6660565e53d0d38c72d8fd4a8ddaf77602652ed7f0fe518498ea85b9949b81c62b7773b96089bafc647b3abfd languageName: node linkType: hard @@ -2812,21 +2401,7 @@ __metadata: languageName: node linkType: hard -"@docusaurus/utils-common@npm:3.1.1, @docusaurus/utils-common@npm:^2 || ^3": - version: 3.1.1 - resolution: "@docusaurus/utils-common@npm:3.1.1" - dependencies: - tslib: "npm:^2.6.0" - peerDependencies: - "@docusaurus/types": "*" - peerDependenciesMeta: - "@docusaurus/types": - optional: true - checksum: 10c0/b483b4626c521e01a4b8ef1e65636e3a99eedae29177f9ee1052268bd5f5f56e12e9a89563792719f3493909e2afc91a1f36532e3e7e290fc933be1e5fed7d01 - languageName: node - linkType: hard - -"@docusaurus/utils-common@npm:3.2.1": +"@docusaurus/utils-common@npm:3.2.1, @docusaurus/utils-common@npm:^2 || ^3": version: 3.2.1 resolution: "@docusaurus/utils-common@npm:3.2.1" dependencies: @@ -2840,20 +2415,7 @@ __metadata: languageName: node linkType: hard -"@docusaurus/utils-validation@npm:3.1.1, @docusaurus/utils-validation@npm:^2 || ^3": - version: 3.1.1 - resolution: "@docusaurus/utils-validation@npm:3.1.1" - dependencies: - "@docusaurus/logger": "npm:3.1.1" - "@docusaurus/utils": "npm:3.1.1" - joi: "npm:^17.9.2" - js-yaml: "npm:^4.1.0" - tslib: "npm:^2.6.0" - checksum: 10c0/7075de973c06b0a87ba6ec73ce4f3e79cd1d572823b65f6ebb974459b34353e72a085feaf1358c4841e9ccebc1426c5489dc28e694a47fe177f6270e6979d563 - languageName: node - linkType: hard - -"@docusaurus/utils-validation@npm:3.2.1": +"@docusaurus/utils-validation@npm:3.2.1, @docusaurus/utils-validation@npm:^2 || ^3": version: 3.2.1 resolution: "@docusaurus/utils-validation@npm:3.2.1" dependencies: @@ -2867,37 +2429,7 @@ __metadata: languageName: node linkType: hard -"@docusaurus/utils@npm:3.1.1, @docusaurus/utils@npm:^2 || ^3": - version: 3.1.1 - resolution: "@docusaurus/utils@npm:3.1.1" - dependencies: - "@docusaurus/logger": "npm:3.1.1" - "@svgr/webpack": "npm:^6.5.1" - escape-string-regexp: "npm:^4.0.0" - file-loader: "npm:^6.2.0" - fs-extra: "npm:^11.1.1" - github-slugger: "npm:^1.5.0" - globby: "npm:^11.1.0" - gray-matter: "npm:^4.0.3" - jiti: "npm:^1.20.0" - js-yaml: "npm:^4.1.0" - lodash: "npm:^4.17.21" - micromatch: "npm:^4.0.5" - resolve-pathname: "npm:^3.0.0" - shelljs: "npm:^0.8.5" - tslib: "npm:^2.6.0" - url-loader: "npm:^4.1.1" - webpack: "npm:^5.88.1" - peerDependencies: - "@docusaurus/types": "*" - peerDependenciesMeta: - "@docusaurus/types": - optional: true - checksum: 10c0/063219351c630be7f16b51aa989f4dd479bb3f941ff44f7b857d4713d954e4c64626e17404eb11b3bd6ef218bd5a4a1412b9c42a30c53fd9748bb04a0aa31faf - languageName: node - linkType: hard - -"@docusaurus/utils@npm:3.2.1": +"@docusaurus/utils@npm:3.2.1, @docusaurus/utils@npm:^2 || ^3": version: 3.2.1 resolution: "@docusaurus/utils@npm:3.2.1" dependencies: @@ -3461,7 +2993,7 @@ __metadata: languageName: node linkType: hard -"@eslint-community/regexpp@npm:^4.5.1, @eslint-community/regexpp@npm:^4.6.1": +"@eslint-community/regexpp@npm:^4.10.0, @eslint-community/regexpp@npm:^4.6.1": version: 4.10.0 resolution: "@eslint-community/regexpp@npm:4.10.0" checksum: 10c0/c5f60ef1f1ea7649fa7af0e80a5a79f64b55a8a8fa5086de4727eb4c86c652aedee407a9c143b8995d2c0b2d75c1222bec9ba5d73dbfc1f314550554f0979ef4 @@ -3485,6 +3017,23 @@ __metadata: languageName: node linkType: hard +"@eslint/eslintrc@npm:^3.0.2": + version: 3.0.2 + resolution: "@eslint/eslintrc@npm:3.0.2" + dependencies: + ajv: "npm:^6.12.4" + debug: "npm:^4.3.2" + espree: "npm:^10.0.1" + globals: "npm:^14.0.0" + ignore: "npm:^5.2.0" + import-fresh: "npm:^3.2.1" + js-yaml: "npm:^4.1.0" + minimatch: "npm:^3.1.2" + strip-json-comments: "npm:^3.1.1" + checksum: 10c0/d8c92f06bdf8e2be9fcc0eeac4a9351745174adfcc72571ef3d179101cb55e19f15f6385c2a4f4945a3ba9245802d3371208e2e1e4f00f6bcf6b8711656af85a + languageName: node + linkType: hard + "@eslint/js@npm:8.57.0": version: 8.57.0 resolution: "@eslint/js@npm:8.57.0" @@ -3492,6 +3041,13 @@ __metadata: languageName: node linkType: hard +"@eslint/js@npm:^9.0.0": + version: 9.0.0 + resolution: "@eslint/js@npm:9.0.0" + checksum: 10c0/ec3242a60a2525d2785d96d1e95b8060235f47f3b953aa81626968591ef8c1eb4f7f8b3647db2c97fdfa524eace949a5695be50521f64b8dcc4ed3b493ee409e + languageName: node + linkType: hard + "@fastify/accept-negotiator@npm:^1.0.0, @fastify/accept-negotiator@npm:^1.1.0": version: 1.1.0 resolution: "@fastify/accept-negotiator@npm:1.1.0" @@ -3603,9 +3159,9 @@ __metadata: linkType: hard "@humanwhocodes/object-schema@npm:^2.0.2": - version: 2.0.2 - resolution: "@humanwhocodes/object-schema@npm:2.0.2" - checksum: 10c0/6fd83dc320231d71c4541d0244051df61f301817e9f9da9fd4cb7e44ec8aacbde5958c1665b0c419401ab935114fdf532a6ad5d4e7294b1af2f347dd91a6983f + version: 2.0.3 + resolution: "@humanwhocodes/object-schema@npm:2.0.3" + checksum: 10c0/80520eabbfc2d32fe195a93557cef50dfe8c8905de447f022675aaf66abc33ae54098f5ea78548d925aa671cd4ab7c7daa5ad704fe42358c9b5e7db60f80696c languageName: node linkType: hard @@ -4241,6 +3797,13 @@ __metadata: languageName: node linkType: hard +"@netlify/edge-functions@npm:2.5.1": + version: 2.5.1 + resolution: "@netlify/edge-functions@npm:2.5.1" + checksum: 10c0/e2a5014ca6a64112b557a6ea0f4e3d9d8e3b5371751e6a7d032e11b84178abe2e7766fb86e0a1ac043088b69cce6a374f7da66bfbba42679f0b4e541a0948e07 + languageName: node + linkType: hard + "@netlify/framework-info@npm:^9.8.11": version: 9.8.11 resolution: "@netlify/framework-info@npm:9.8.11" @@ -5247,17 +4810,6 @@ __metadata: languageName: node linkType: hard -"@slorber/static-site-generator-webpack-plugin@npm:^4.0.7": - version: 4.0.7 - resolution: "@slorber/static-site-generator-webpack-plugin@npm:4.0.7" - dependencies: - eval: "npm:^0.1.8" - p-map: "npm:^4.0.0" - webpack-sources: "npm:^3.2.2" - checksum: 10c0/6ba8abc2d99e8c513bb955502f9cd219c78b2c7b9b76668bf05067cf369cfa838089b52ee51c957e1e6e8442f9dd4f2bbd8df706a3c3388e9a0d41b09a895f97 - languageName: node - linkType: hard - "@svgr/babel-plugin-add-jsx-attribute@npm:8.0.0": version: 8.0.0 resolution: "@svgr/babel-plugin-add-jsx-attribute@npm:8.0.0" @@ -5552,90 +5104,90 @@ __metadata: languageName: node linkType: hard -"@swc/core-darwin-arm64@npm:1.4.12": - version: 1.4.12 - resolution: "@swc/core-darwin-arm64@npm:1.4.12" +"@swc/core-darwin-arm64@npm:1.4.13": + version: 1.4.13 + resolution: "@swc/core-darwin-arm64@npm:1.4.13" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@swc/core-darwin-x64@npm:1.4.12": - version: 1.4.12 - resolution: "@swc/core-darwin-x64@npm:1.4.12" +"@swc/core-darwin-x64@npm:1.4.13": + version: 1.4.13 + resolution: "@swc/core-darwin-x64@npm:1.4.13" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@swc/core-linux-arm-gnueabihf@npm:1.4.12": - version: 1.4.12 - resolution: "@swc/core-linux-arm-gnueabihf@npm:1.4.12" +"@swc/core-linux-arm-gnueabihf@npm:1.4.13": + version: 1.4.13 + resolution: "@swc/core-linux-arm-gnueabihf@npm:1.4.13" conditions: os=linux & cpu=arm languageName: node linkType: hard -"@swc/core-linux-arm64-gnu@npm:1.4.12": - version: 1.4.12 - resolution: "@swc/core-linux-arm64-gnu@npm:1.4.12" +"@swc/core-linux-arm64-gnu@npm:1.4.13": + version: 1.4.13 + resolution: "@swc/core-linux-arm64-gnu@npm:1.4.13" conditions: os=linux & cpu=arm64 & libc=glibc languageName: node linkType: hard -"@swc/core-linux-arm64-musl@npm:1.4.12": - version: 1.4.12 - resolution: "@swc/core-linux-arm64-musl@npm:1.4.12" +"@swc/core-linux-arm64-musl@npm:1.4.13": + version: 1.4.13 + resolution: "@swc/core-linux-arm64-musl@npm:1.4.13" conditions: os=linux & cpu=arm64 & libc=musl languageName: node linkType: hard -"@swc/core-linux-x64-gnu@npm:1.4.12": - version: 1.4.12 - resolution: "@swc/core-linux-x64-gnu@npm:1.4.12" +"@swc/core-linux-x64-gnu@npm:1.4.13": + version: 1.4.13 + resolution: "@swc/core-linux-x64-gnu@npm:1.4.13" conditions: os=linux & cpu=x64 & libc=glibc languageName: node linkType: hard -"@swc/core-linux-x64-musl@npm:1.4.12": - version: 1.4.12 - resolution: "@swc/core-linux-x64-musl@npm:1.4.12" +"@swc/core-linux-x64-musl@npm:1.4.13": + version: 1.4.13 + resolution: "@swc/core-linux-x64-musl@npm:1.4.13" conditions: os=linux & cpu=x64 & libc=musl languageName: node linkType: hard -"@swc/core-win32-arm64-msvc@npm:1.4.12": - version: 1.4.12 - resolution: "@swc/core-win32-arm64-msvc@npm:1.4.12" +"@swc/core-win32-arm64-msvc@npm:1.4.13": + version: 1.4.13 + resolution: "@swc/core-win32-arm64-msvc@npm:1.4.13" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"@swc/core-win32-ia32-msvc@npm:1.4.12": - version: 1.4.12 - resolution: "@swc/core-win32-ia32-msvc@npm:1.4.12" +"@swc/core-win32-ia32-msvc@npm:1.4.13": + version: 1.4.13 + resolution: "@swc/core-win32-ia32-msvc@npm:1.4.13" conditions: os=win32 & cpu=ia32 languageName: node linkType: hard -"@swc/core-win32-x64-msvc@npm:1.4.12": - version: 1.4.12 - resolution: "@swc/core-win32-x64-msvc@npm:1.4.12" +"@swc/core-win32-x64-msvc@npm:1.4.13": + version: 1.4.13 + resolution: "@swc/core-win32-x64-msvc@npm:1.4.13" conditions: os=win32 & cpu=x64 languageName: node linkType: hard -"@swc/core@npm:^1.4.12": - version: 1.4.12 - resolution: "@swc/core@npm:1.4.12" +"@swc/core@npm:^1.4.13": + version: 1.4.13 + resolution: "@swc/core@npm:1.4.13" dependencies: - "@swc/core-darwin-arm64": "npm:1.4.12" - "@swc/core-darwin-x64": "npm:1.4.12" - "@swc/core-linux-arm-gnueabihf": "npm:1.4.12" - "@swc/core-linux-arm64-gnu": "npm:1.4.12" - "@swc/core-linux-arm64-musl": "npm:1.4.12" - "@swc/core-linux-x64-gnu": "npm:1.4.12" - "@swc/core-linux-x64-musl": "npm:1.4.12" - "@swc/core-win32-arm64-msvc": "npm:1.4.12" - "@swc/core-win32-ia32-msvc": "npm:1.4.12" - "@swc/core-win32-x64-msvc": "npm:1.4.12" + "@swc/core-darwin-arm64": "npm:1.4.13" + "@swc/core-darwin-x64": "npm:1.4.13" + "@swc/core-linux-arm-gnueabihf": "npm:1.4.13" + "@swc/core-linux-arm64-gnu": "npm:1.4.13" + "@swc/core-linux-arm64-musl": "npm:1.4.13" + "@swc/core-linux-x64-gnu": "npm:1.4.13" + "@swc/core-linux-x64-musl": "npm:1.4.13" + "@swc/core-win32-arm64-msvc": "npm:1.4.13" + "@swc/core-win32-ia32-msvc": "npm:1.4.13" + "@swc/core-win32-x64-msvc": "npm:1.4.13" "@swc/counter": "npm:^0.1.2" "@swc/types": "npm:^0.1.5" peerDependencies: @@ -5664,7 +5216,7 @@ __metadata: peerDependenciesMeta: "@swc/helpers": optional: true - checksum: 10c0/e1517e3fa3f4ef25120785f393c73b43c97d4335f588f55d7bc43d42b9832ed6cd50be4b0cb17721cf56701cb9960fb1dabcaebac3fb10e2e1165049a12326b9 + checksum: 10c0/fa65a2e32a4a31c0fc42fec8991aa92fe96c0a66ab3339acc481a570f0be017e3ee672d5359ca2992c11256780985e81a19b7a2f6c9d56b859d57779cb0ea63b languageName: node linkType: hard @@ -6014,7 +5566,7 @@ __metadata: languageName: node linkType: hard -"@types/json-schema@npm:*, @types/json-schema@npm:^7.0.12, @types/json-schema@npm:^7.0.4, @types/json-schema@npm:^7.0.5, @types/json-schema@npm:^7.0.8, @types/json-schema@npm:^7.0.9": +"@types/json-schema@npm:*, @types/json-schema@npm:^7.0.15, @types/json-schema@npm:^7.0.4, @types/json-schema@npm:^7.0.5, @types/json-schema@npm:^7.0.8, @types/json-schema@npm:^7.0.9": version: 7.0.15 resolution: "@types/json-schema@npm:7.0.15" checksum: 10c0/a996a745e6c5d60292f36731dd41341339d4eeed8180bb09226e5c8d23759067692b1d88e5d91d72ee83dfc00d3aca8e7bd43ea120516c17922cbcb7c3e252db @@ -6074,12 +5626,12 @@ __metadata: languageName: node linkType: hard -"@types/node@npm:*": - version: 20.11.30 - resolution: "@types/node@npm:20.11.30" +"@types/node@npm:*, @types/node@npm:^20.12.6": + version: 20.12.6 + resolution: "@types/node@npm:20.12.6" dependencies: undici-types: "npm:~5.26.4" - checksum: 10c0/867cfaf969c6d8850d8d7304e7ab739898a50ecb1395b61ff2335644f5f48d7a46fbc4a14cee967aed65ec134b61a746edae70d1f32f11321ccf29165e3bc4e6 + checksum: 10c0/48ce732162cd6c02656aa5f996f0e695b57fdeb1ae762fbaa966afac2dcdcf52cb56be5ce1efb4babf8f97c2de545889aebc7f43c2e86f033487245c41fa1e6b languageName: node linkType: hard @@ -6090,15 +5642,6 @@ __metadata: languageName: node linkType: hard -"@types/node@npm:^20.12.5": - version: 20.12.5 - resolution: "@types/node@npm:20.12.5" - dependencies: - undici-types: "npm:~5.26.4" - checksum: 10c0/2da65516fba98f0417620e42bddbe53e144d4782d69cd37f99df2537c6850b9cfbdb8a017f02c61e9a074bcac84f9f3f221b250474ac8c6b95d507a47e8d53f9 - languageName: node - linkType: hard - "@types/normalize-package-data@npm:^2.4.1, @types/normalize-package-data@npm:^2.4.3": version: 2.4.4 resolution: "@types/normalize-package-data@npm:2.4.4" @@ -6182,24 +5725,13 @@ __metadata: languageName: node linkType: hard -"@types/react@npm:*": - version: 18.2.69 - resolution: "@types/react@npm:18.2.69" - dependencies: - "@types/prop-types": "npm:*" - "@types/scheduler": "npm:*" - csstype: "npm:^3.0.2" - checksum: 10c0/239b947ed8576a271057a6f571d0967098074b101a2bece244e88093dc8fb2f020872c463b8e78b2049334ba99158f6eef5960e51f73a389f86eee39b835d846 - languageName: node - linkType: hard - -"@types/react@npm:^18.2.74": - version: 18.2.74 - resolution: "@types/react@npm:18.2.74" +"@types/react@npm:*, @types/react@npm:^18.2.75": + version: 18.2.75 + resolution: "@types/react@npm:18.2.75" dependencies: "@types/prop-types": "npm:*" csstype: "npm:^3.0.2" - checksum: 10c0/347e38b4c5dc20d50ff71bf04b7caaef490e5ff695e74a0088a13fbb2a0c5d125a5ecfd142adfa30f0176da0e2734942c91ba61d95ce269c43b3265bd7379361 + checksum: 10c0/3c0d035d64007d38cf1b682108de8c5f042452025899280c5d2c040b9f53b1f81482d0d57fd93e6687c2c619f3b605d33a01569b1fbbbdeec7fb3a56c7a72af8 languageName: node linkType: hard @@ -6226,14 +5758,7 @@ __metadata: languageName: node linkType: hard -"@types/scheduler@npm:*": - version: 0.16.8 - resolution: "@types/scheduler@npm:0.16.8" - checksum: 10c0/f86de504945b8fc41b1f391f847444d542e2e4067cf7e5d9bfeb5d2d2393d3203b1161bc0ef3b1e104d828dabfb60baf06e8d2c27e27ff7e8258e6e618d8c4ec - languageName: node - linkType: hard - -"@types/semver@npm:^7.5.0": +"@types/semver@npm:^7.5.8": version: 7.5.8 resolution: "@types/semver@npm:7.5.8" checksum: 10c0/8663ff927234d1c5fcc04b33062cb2b9fcfbe0f5f351ed26c4d1e1581657deebd506b41ff7fdf89e787e3d33ce05854bc01686379b89e9c49b564c4cfa988efa @@ -6357,73 +5882,73 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/eslint-plugin@npm:^7.5.0": - version: 7.5.0 - resolution: "@typescript-eslint/eslint-plugin@npm:7.5.0" +"@typescript-eslint/eslint-plugin@npm:7.6.0": + version: 7.6.0 + resolution: "@typescript-eslint/eslint-plugin@npm:7.6.0" dependencies: - "@eslint-community/regexpp": "npm:^4.5.1" - "@typescript-eslint/scope-manager": "npm:7.5.0" - "@typescript-eslint/type-utils": "npm:7.5.0" - "@typescript-eslint/utils": "npm:7.5.0" - "@typescript-eslint/visitor-keys": "npm:7.5.0" + "@eslint-community/regexpp": "npm:^4.10.0" + "@typescript-eslint/scope-manager": "npm:7.6.0" + "@typescript-eslint/type-utils": "npm:7.6.0" + "@typescript-eslint/utils": "npm:7.6.0" + "@typescript-eslint/visitor-keys": "npm:7.6.0" debug: "npm:^4.3.4" graphemer: "npm:^1.4.0" - ignore: "npm:^5.2.4" + ignore: "npm:^5.3.1" natural-compare: "npm:^1.4.0" - semver: "npm:^7.5.4" - ts-api-utils: "npm:^1.0.1" + semver: "npm:^7.6.0" + ts-api-utils: "npm:^1.3.0" peerDependencies: "@typescript-eslint/parser": ^7.0.0 eslint: ^8.56.0 peerDependenciesMeta: typescript: optional: true - checksum: 10c0/932a7b5a09c0138ef5a0bf00f8e6039fa209d4047092ffc187de048543c21f7ce24dc14f25f4c87b6f3bbb62335fc952e259e271fde88baf793217bde6460cfa + checksum: 10c0/c3ca611c6658dfc05e6457e87c66cdc6f038cf9bbb345f3168d171491bc1439f815a49529a1511940141a387873e10dfc7ab68fd172cf54c34f8a3aa8c558e13 languageName: node linkType: hard -"@typescript-eslint/parser@npm:^7.5.0": - version: 7.5.0 - resolution: "@typescript-eslint/parser@npm:7.5.0" +"@typescript-eslint/parser@npm:7.6.0": + version: 7.6.0 + resolution: "@typescript-eslint/parser@npm:7.6.0" dependencies: - "@typescript-eslint/scope-manager": "npm:7.5.0" - "@typescript-eslint/types": "npm:7.5.0" - "@typescript-eslint/typescript-estree": "npm:7.5.0" - "@typescript-eslint/visitor-keys": "npm:7.5.0" + "@typescript-eslint/scope-manager": "npm:7.6.0" + "@typescript-eslint/types": "npm:7.6.0" + "@typescript-eslint/typescript-estree": "npm:7.6.0" + "@typescript-eslint/visitor-keys": "npm:7.6.0" debug: "npm:^4.3.4" peerDependencies: eslint: ^8.56.0 peerDependenciesMeta: typescript: optional: true - checksum: 10c0/65521202ff024e79594272fbb7e4731ecf9d2fdd2f58fc81450bfd2bca94ce9c17b0eadd7338c01701f5cf16d38b6c025ed3fc322380b1e4b5424b7484098cda + checksum: 10c0/69450c15180f7ee5a9d9c2e8ed7aa781a3b63635c099de1f102167c247d71c55b152934187e854baa5c9ea3dcbc0c9f5983379139e6cfa1ccbb900b9f23dab37 languageName: node linkType: hard -"@typescript-eslint/scope-manager@npm:7.5.0": - version: 7.5.0 - resolution: "@typescript-eslint/scope-manager@npm:7.5.0" +"@typescript-eslint/scope-manager@npm:7.6.0": + version: 7.6.0 + resolution: "@typescript-eslint/scope-manager@npm:7.6.0" dependencies: - "@typescript-eslint/types": "npm:7.5.0" - "@typescript-eslint/visitor-keys": "npm:7.5.0" - checksum: 10c0/a017b151a6b39ef591f8e2e65598e005e1b4b2d5494e4b91bddb5856b3a4d57dd8a58d2bc7a140e627eb574f93a2c8fe55f1307aa264c928ffd31d9e190bc5dd + "@typescript-eslint/types": "npm:7.6.0" + "@typescript-eslint/visitor-keys": "npm:7.6.0" + checksum: 10c0/1c1e75fd4fa2dabcab0457ca2ec872752c112fec27bf11edb5bf13c547ad5f3ca5a3b424e19c6916dfc8bd348cde258db8abfd12c9ed93b4bc4df9ef9e3db9f5 languageName: node linkType: hard -"@typescript-eslint/type-utils@npm:7.5.0": - version: 7.5.0 - resolution: "@typescript-eslint/type-utils@npm:7.5.0" +"@typescript-eslint/type-utils@npm:7.6.0": + version: 7.6.0 + resolution: "@typescript-eslint/type-utils@npm:7.6.0" dependencies: - "@typescript-eslint/typescript-estree": "npm:7.5.0" - "@typescript-eslint/utils": "npm:7.5.0" + "@typescript-eslint/typescript-estree": "npm:7.6.0" + "@typescript-eslint/utils": "npm:7.6.0" debug: "npm:^4.3.4" - ts-api-utils: "npm:^1.0.1" + ts-api-utils: "npm:^1.3.0" peerDependencies: eslint: ^8.56.0 peerDependenciesMeta: typescript: optional: true - checksum: 10c0/12915d4d1872638f5281e222a0d191676c478f250699c84864862e95a59e708222acefbf7ffdafc0872a007261219a3a2b1e667ff45eeafea7c4bcc5b955262c + checksum: 10c0/d5fa5856e24b593e8ae93f27049e7ea49c0725f9fe44e6252a8fc8228859e2db254a3c399bedaf1fdac76fae94aa9bae10a9d466032c7bdb5bdeb1da2e4e3a53 languageName: node linkType: hard @@ -6434,29 +5959,29 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/types@npm:7.5.0": - version: 7.5.0 - resolution: "@typescript-eslint/types@npm:7.5.0" - checksum: 10c0/f3394f71f422dbd89f63b230f20e9769c12e47a287ff30ca03a80714e57ea21279b6f12a8ab14bafb00b59926f20a88894b2d1e72679f7ff298bae112679d4b3 +"@typescript-eslint/types@npm:7.6.0": + version: 7.6.0 + resolution: "@typescript-eslint/types@npm:7.6.0" + checksum: 10c0/7ca2a307557d4d8fc9c7d43e4dc8c4841e6c5380b59dcc8b644b3d7b6a702968ff5a70b74cb7e3d3af3f3cef87e9775573b8272b1b2963d80441992ac4e7e951 languageName: node linkType: hard -"@typescript-eslint/typescript-estree@npm:7.5.0": - version: 7.5.0 - resolution: "@typescript-eslint/typescript-estree@npm:7.5.0" +"@typescript-eslint/typescript-estree@npm:7.6.0": + version: 7.6.0 + resolution: "@typescript-eslint/typescript-estree@npm:7.6.0" dependencies: - "@typescript-eslint/types": "npm:7.5.0" - "@typescript-eslint/visitor-keys": "npm:7.5.0" + "@typescript-eslint/types": "npm:7.6.0" + "@typescript-eslint/visitor-keys": "npm:7.6.0" debug: "npm:^4.3.4" globby: "npm:^11.1.0" is-glob: "npm:^4.0.3" - minimatch: "npm:9.0.3" - semver: "npm:^7.5.4" - ts-api-utils: "npm:^1.0.1" + minimatch: "npm:^9.0.4" + semver: "npm:^7.6.0" + ts-api-utils: "npm:^1.3.0" peerDependenciesMeta: typescript: optional: true - checksum: 10c0/ea3a270c725d6be273188b86110e0393052cd64d1c54a56eb5ea405e6d3fbbe84fb3b1ce1b8496a4078ac1eefd37aedcf12be91876764f6de31d5aa5131c7bcd + checksum: 10c0/ab54ce7a61928640bf036cc1d80394de92581d90666786603b566b9a44833603e017d7e739a37aee82a007c6d1dbdc6328d7e42d1732925cc53c111e7e38961e languageName: node linkType: hard @@ -6478,20 +6003,20 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/utils@npm:7.5.0": - version: 7.5.0 - resolution: "@typescript-eslint/utils@npm:7.5.0" +"@typescript-eslint/utils@npm:7.6.0": + version: 7.6.0 + resolution: "@typescript-eslint/utils@npm:7.6.0" dependencies: "@eslint-community/eslint-utils": "npm:^4.4.0" - "@types/json-schema": "npm:^7.0.12" - "@types/semver": "npm:^7.5.0" - "@typescript-eslint/scope-manager": "npm:7.5.0" - "@typescript-eslint/types": "npm:7.5.0" - "@typescript-eslint/typescript-estree": "npm:7.5.0" - semver: "npm:^7.5.4" + "@types/json-schema": "npm:^7.0.15" + "@types/semver": "npm:^7.5.8" + "@typescript-eslint/scope-manager": "npm:7.6.0" + "@typescript-eslint/types": "npm:7.6.0" + "@typescript-eslint/typescript-estree": "npm:7.6.0" + semver: "npm:^7.6.0" peerDependencies: eslint: ^8.56.0 - checksum: 10c0/c815ed6909769648953d6963c069038f7cac0c979051b25718feb30e0d3337b9647b75b8de00ac03fe960f0cc8dc4e8a81d4aac4719090a99785e0068712bd24 + checksum: 10c0/1552004d9c451347f11398648ec7b22381d5b335f10e8d2dfdfbcb024ef93c9a23ec5731ee271495b4b546ab5db0a817bd13c4c4db8be825ed90b80a89dfd0f7 languageName: node linkType: hard @@ -6505,13 +6030,13 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/visitor-keys@npm:7.5.0": - version: 7.5.0 - resolution: "@typescript-eslint/visitor-keys@npm:7.5.0" +"@typescript-eslint/visitor-keys@npm:7.6.0": + version: 7.6.0 + resolution: "@typescript-eslint/visitor-keys@npm:7.6.0" dependencies: - "@typescript-eslint/types": "npm:7.5.0" - eslint-visitor-keys: "npm:^3.4.1" - checksum: 10c0/eecf02b8dd54e83738a143aca87b902af4b357028a90fd34ed7a2f40a3ae2f6a188b9ba53903f23c80e868f1fffbb039e9ddb63525438d659707cc7bfb269317 + "@typescript-eslint/types": "npm:7.6.0" + eslint-visitor-keys: "npm:^3.4.3" + checksum: 10c0/b5ca6a9258889ef103165884e99b51124b2a3dad250cf7cee2fb13525f76922256a6146a8dcef74cad6548a52409ff89259809c7fa7c8be07059bb7454e7fa8f languageName: node linkType: hard @@ -7071,7 +6596,7 @@ __metadata: languageName: node linkType: hard -"ansi-escapes@npm:6.2.1": +"ansi-escapes@npm:6.2.1, ansi-escapes@npm:^6.0.0": version: 6.2.1 resolution: "ansi-escapes@npm:6.2.1" checksum: 10c0/a2c6f58b044be5f69662ee17073229b492daa2425a7fd99a665db6c22eab6e4ab42752807def7281c1c7acfed48f87f2362dda892f08c2c437f1b39c6b033103 @@ -7103,15 +6628,6 @@ __metadata: languageName: node linkType: hard -"ansi-escapes@npm:^6.0.0": - version: 6.2.0 - resolution: "ansi-escapes@npm:6.2.0" - dependencies: - type-fest: "npm:^3.0.0" - checksum: 10c0/3eec75deedd8b10192c5f98e4cd9715cc3ff268d33fc463c24b7d22446668bfcd4ad1803993ea89c0f51f88b5a3399572bacb7c8cb1a067fc86e189c5f3b0c7e - languageName: node - linkType: hard - "ansi-html-community@npm:^0.0.8": version: 0.0.8 resolution: "ansi-html-community@npm:0.0.8" @@ -7392,15 +6908,16 @@ __metadata: linkType: hard "array.prototype.findlastindex@npm:^1.2.3": - version: 1.2.3 - resolution: "array.prototype.findlastindex@npm:1.2.3" + version: 1.2.5 + resolution: "array.prototype.findlastindex@npm:1.2.5" dependencies: - call-bind: "npm:^1.0.2" - define-properties: "npm:^1.2.0" - es-abstract: "npm:^1.22.1" - es-shim-unscopables: "npm:^1.0.0" - get-intrinsic: "npm:^1.2.1" - checksum: 10c0/2c5c4d3f07512d6729f728f6260a314c00f2eb0a243123092661fa1bc65dce90234c3b483b5f978396eccef6f69c50f0bea248448aaf9cdfcd1cedad6217acbb + call-bind: "npm:^1.0.7" + define-properties: "npm:^1.2.1" + es-abstract: "npm:^1.23.2" + es-errors: "npm:^1.3.0" + es-object-atoms: "npm:^1.0.0" + es-shim-unscopables: "npm:^1.0.2" + checksum: 10c0/962189487728b034f3134802b421b5f39e42ee2356d13b42d2ddb0e52057ffdcc170b9524867f4f0611a6f638f4c19b31e14606e8bcbda67799e26685b195aa3 languageName: node linkType: hard @@ -9647,7 +9164,7 @@ __metadata: languageName: node linkType: hard -"data-view-byte-length@npm:^1.0.0": +"data-view-byte-length@npm:^1.0.1": version: 1.0.1 resolution: "data-view-byte-length@npm:1.0.1" dependencies: @@ -10458,19 +9975,20 @@ __metadata: languageName: node linkType: hard -"es-abstract@npm:^1.22.1, es-abstract@npm:^1.22.3, es-abstract@npm:^1.23.0": - version: 1.23.0 - resolution: "es-abstract@npm:1.23.0" +"es-abstract@npm:^1.22.1, es-abstract@npm:^1.22.3, es-abstract@npm:^1.23.0, es-abstract@npm:^1.23.2": + version: 1.23.3 + resolution: "es-abstract@npm:1.23.3" dependencies: array-buffer-byte-length: "npm:^1.0.1" arraybuffer.prototype.slice: "npm:^1.0.3" available-typed-arrays: "npm:^1.0.7" call-bind: "npm:^1.0.7" data-view-buffer: "npm:^1.0.1" - data-view-byte-length: "npm:^1.0.0" + data-view-byte-length: "npm:^1.0.1" data-view-byte-offset: "npm:^1.0.0" es-define-property: "npm:^1.0.0" es-errors: "npm:^1.3.0" + es-object-atoms: "npm:^1.0.0" es-set-tostringtag: "npm:^2.0.3" es-to-primitive: "npm:^1.2.1" function.prototype.name: "npm:^1.1.6" @@ -10481,7 +9999,7 @@ __metadata: has-property-descriptors: "npm:^1.0.2" has-proto: "npm:^1.0.3" has-symbols: "npm:^1.0.3" - hasown: "npm:^2.0.1" + hasown: "npm:^2.0.2" internal-slot: "npm:^1.0.7" is-array-buffer: "npm:^3.0.4" is-callable: "npm:^1.2.7" @@ -10496,18 +10014,18 @@ __metadata: object-keys: "npm:^1.1.1" object.assign: "npm:^4.1.5" regexp.prototype.flags: "npm:^1.5.2" - safe-array-concat: "npm:^1.1.0" + safe-array-concat: "npm:^1.1.2" safe-regex-test: "npm:^1.0.3" - string.prototype.trim: "npm:^1.2.8" - string.prototype.trimend: "npm:^1.0.7" - string.prototype.trimstart: "npm:^1.0.7" + string.prototype.trim: "npm:^1.2.9" + string.prototype.trimend: "npm:^1.0.8" + string.prototype.trimstart: "npm:^1.0.8" typed-array-buffer: "npm:^1.0.2" typed-array-byte-length: "npm:^1.0.1" typed-array-byte-offset: "npm:^1.0.2" - typed-array-length: "npm:^1.0.5" + typed-array-length: "npm:^1.0.6" unbox-primitive: "npm:^1.0.2" - which-typed-array: "npm:^1.1.14" - checksum: 10c0/afda67ce205fedbd080b435a07cf479b257dc2f762dbab32d0a2011f1cf507326f8bbc41619754ad0ab5e6c88d0ec2e96e6bd7aed9511bfe04fdb1e08cad1c20 + which-typed-array: "npm:^1.1.15" + checksum: 10c0/d27e9afafb225c6924bee9971a7f25f20c314f2d6cb93a63cada4ac11dcf42040896a6c22e5fb8f2a10767055ed4ddf400be3b1eb12297d281726de470b75666 languageName: node linkType: hard @@ -10556,6 +10074,15 @@ __metadata: languageName: node linkType: hard +"es-object-atoms@npm:^1.0.0": + version: 1.0.0 + resolution: "es-object-atoms@npm:1.0.0" + dependencies: + es-errors: "npm:^1.3.0" + checksum: 10c0/1fed3d102eb27ab8d983337bb7c8b159dd2a1e63ff833ec54eea1311c96d5b08223b433060ba240541ca8adba9eee6b0a60cdbf2f80634b784febc9cc8b687b4 + languageName: node + linkType: hard + "es-set-tostringtag@npm:^2.0.3": version: 2.0.3 resolution: "es-set-tostringtag@npm:2.0.3" @@ -10924,14 +10451,14 @@ __metadata: linkType: hard "eslint-module-utils@npm:^2.8.0": - version: 2.8.0 - resolution: "eslint-module-utils@npm:2.8.0" + version: 2.8.1 + resolution: "eslint-module-utils@npm:2.8.1" dependencies: debug: "npm:^3.2.7" peerDependenciesMeta: eslint: optional: true - checksum: 10c0/c7a8d1a58d76ec8217a8fea49271ec8132d1b9390965a75f6a4ecbc9e5983d742195b46d2e4378231d2186801439fe1aa5700714b0bfd4eb17aac6e1b65309df + checksum: 10c0/1aeeb97bf4b688d28de136ee57c824480c37691b40fa825c711a4caf85954e94b99c06ac639d7f1f6c1d69223bd21bcb991155b3e589488e958d5b83dfd0f882 languageName: node linkType: hard @@ -11026,6 +10553,13 @@ __metadata: languageName: node linkType: hard +"eslint-visitor-keys@npm:^4.0.0": + version: 4.0.0 + resolution: "eslint-visitor-keys@npm:4.0.0" + checksum: 10c0/76619f42cf162705a1515a6868e6fc7567e185c7063a05621a8ac4c3b850d022661262c21d9f1fc1d144ecf0d5d64d70a3f43c15c3fc969a61ace0fb25698cf5 + languageName: node + linkType: hard + "eslint@npm:^8.57.0": version: 8.57.0 resolution: "eslint@npm:8.57.0" @@ -11074,6 +10608,17 @@ __metadata: languageName: node linkType: hard +"espree@npm:^10.0.1": + version: 10.0.1 + resolution: "espree@npm:10.0.1" + dependencies: + acorn: "npm:^8.11.3" + acorn-jsx: "npm:^5.3.2" + eslint-visitor-keys: "npm:^4.0.0" + checksum: 10c0/7c0f84afa0f9db7bb899619e6364ed832ef13fe8943691757ddde9a1805ae68b826ed66803323015f707a629a5507d0d290edda2276c25131fe0ad883b8b5636 + languageName: node + linkType: hard + "espree@npm:^9.6.0, espree@npm:^9.6.1": version: 9.6.1 resolution: "espree@npm:9.6.1" @@ -11370,7 +10915,7 @@ __metadata: languageName: node linkType: hard -"express@npm:4.19.2": +"express@npm:4.19.2, express@npm:^4.17.3": version: 4.19.2 resolution: "express@npm:4.19.2" dependencies: @@ -11409,45 +10954,6 @@ __metadata: languageName: node linkType: hard -"express@npm:^4.17.3": - version: 4.19.1 - resolution: "express@npm:4.19.1" - dependencies: - accepts: "npm:~1.3.8" - array-flatten: "npm:1.1.1" - body-parser: "npm:1.20.2" - content-disposition: "npm:0.5.4" - content-type: "npm:~1.0.4" - cookie: "npm:0.6.0" - cookie-signature: "npm:1.0.6" - debug: "npm:2.6.9" - depd: "npm:2.0.0" - encodeurl: "npm:~1.0.2" - escape-html: "npm:~1.0.3" - etag: "npm:~1.8.1" - finalhandler: "npm:1.2.0" - fresh: "npm:0.5.2" - http-errors: "npm:2.0.0" - merge-descriptors: "npm:1.0.1" - methods: "npm:~1.1.2" - on-finished: "npm:2.4.1" - parseurl: "npm:~1.3.3" - path-to-regexp: "npm:0.1.7" - proxy-addr: "npm:~2.0.7" - qs: "npm:6.11.0" - range-parser: "npm:~1.2.1" - safe-buffer: "npm:5.2.1" - send: "npm:0.18.0" - serve-static: "npm:1.15.0" - setprototypeof: "npm:1.2.0" - statuses: "npm:2.0.1" - type-is: "npm:~1.6.18" - utils-merge: "npm:1.0.1" - vary: "npm:~1.1.2" - checksum: 10c0/1cf6d3c095131f0d730105fac23a713083604d4f3ad9364df53cade50662abcfee2f6f8a955fdf164a5ee63f09f457da0b70cbed435ad302fa6f14162a9757f9 - languageName: node - linkType: hard - "ext-list@npm:^2.0.0": version: 2.2.2 resolution: "ext-list@npm:2.2.2" @@ -12640,11 +12146,25 @@ __metadata: linkType: hard "globals@npm:^13.19.0": - version: 13.23.0 - resolution: "globals@npm:13.23.0" + version: 13.24.0 + resolution: "globals@npm:13.24.0" dependencies: type-fest: "npm:^0.20.2" - checksum: 10c0/fc05e184b3be59bffa2580f28551a12a758c3a18df4be91444202982c76f13f52821ad54ffaf7d3f2a4d2498fdf54aeaca8d4540fd9e860a9edb09d34ef4c507 + checksum: 10c0/d3c11aeea898eb83d5ec7a99508600fbe8f83d2cf00cbb77f873dbf2bcb39428eff1b538e4915c993d8a3b3473fa71eeebfe22c9bb3a3003d1e26b1f2c8a42cd + languageName: node + linkType: hard + +"globals@npm:^14.0.0": + version: 14.0.0 + resolution: "globals@npm:14.0.0" + checksum: 10c0/b96ff42620c9231ad468d4c58ff42afee7777ee1c963013ff8aabe095a451d0ceeb8dcd8ef4cbd64d2538cef45f787a78ba3a9574f4a634438963e334471302d + languageName: node + linkType: hard + +"globals@npm:^15.0.0": + version: 15.0.0 + resolution: "globals@npm:15.0.0" + checksum: 10c0/b93e356a7bd4562d73a9defa95a0ff5e8a0b7726a4e2af16bd8ad019e14cd21d85e0a27b46e7e270d34e25df0bc0f9473ca21b47266c406c0e40973956085777 languageName: node linkType: hard @@ -12922,7 +12442,7 @@ __metadata: languageName: node linkType: hard -"hasown@npm:^2.0.0, hasown@npm:^2.0.1": +"hasown@npm:^2.0.0, hasown@npm:^2.0.1, hasown@npm:^2.0.2": version: 2.0.2 resolution: "hasown@npm:2.0.2" dependencies: @@ -13467,10 +12987,10 @@ __metadata: languageName: node linkType: hard -"ignore@npm:^5.2.0, ignore@npm:^5.2.4": - version: 5.3.0 - resolution: "ignore@npm:5.3.0" - checksum: 10c0/dc06bea5c23aae65d0725a957a0638b57e235ae4568dda51ca142053ed2c352de7e3bc93a69b2b32ac31966a1952e9a93c5ef2e2ab7c6b06aef9808f6b55b571 +"ignore@npm:^5.2.0, ignore@npm:^5.2.4, ignore@npm:^5.3.1": + version: 5.3.1 + resolution: "ignore@npm:5.3.1" + checksum: 10c0/703f7f45ffb2a27fb2c5a8db0c32e7dee66b33a225d28e8db4e1be6474795f606686a6e3bcc50e1aa12f2042db4c9d4a7d60af3250511de74620fbed052ea4cd languageName: node linkType: hard @@ -16917,21 +16437,21 @@ __metadata: languageName: node linkType: hard -"minimatch@npm:9.0.3, minimatch@npm:^9.0.0, minimatch@npm:^9.0.1, minimatch@npm:^9.0.3": - version: 9.0.3 - resolution: "minimatch@npm:9.0.3" +"minimatch@npm:^5.0.1, minimatch@npm:^5.1.0": + version: 5.1.6 + resolution: "minimatch@npm:5.1.6" dependencies: brace-expansion: "npm:^2.0.1" - checksum: 10c0/85f407dcd38ac3e180f425e86553911d101455ca3ad5544d6a7cec16286657e4f8a9aa6695803025c55e31e35a91a2252b5dc8e7d527211278b8b65b4dbd5eac + checksum: 10c0/3defdfd230914f22a8da203747c42ee3c405c39d4d37ffda284dac5e45b7e1f6c49aa8be606509002898e73091ff2a3bbfc59c2c6c71d4660609f63aa92f98e3 languageName: node linkType: hard -"minimatch@npm:^5.0.1, minimatch@npm:^5.1.0": - version: 5.1.6 - resolution: "minimatch@npm:5.1.6" +"minimatch@npm:^9.0.0, minimatch@npm:^9.0.1, minimatch@npm:^9.0.3, minimatch@npm:^9.0.4": + version: 9.0.4 + resolution: "minimatch@npm:9.0.4" dependencies: brace-expansion: "npm:^2.0.1" - checksum: 10c0/3defdfd230914f22a8da203747c42ee3c405c39d4d37ffda284dac5e45b7e1f6c49aa8be606509002898e73091ff2a3bbfc59c2c6c71d4660609f63aa92f98e3 + checksum: 10c0/2c16f21f50e64922864e560ff97c587d15fd491f65d92a677a344e970fe62aafdbeafe648965fa96d33c061b4d0eabfe0213466203dd793367e7f28658cf6414 languageName: node linkType: hard @@ -17085,7 +16605,7 @@ __metadata: "@babel/preset-env": "npm:^7.24.4" "@babel/preset-typescript": "npm:^7.24.1" "@types/jest": "npm:^29.5.12" - "@types/node": "npm:^20.12.5" + "@types/node": "npm:^20.12.6" babel-jest: "npm:^29.7.0" jest: "npm:^29.7.0" mobx-keystone: "workspace:packages/lib" @@ -17113,10 +16633,10 @@ __metadata: "@babel/plugin-proposal-decorators": "npm:^7.24.1" "@babel/preset-env": "npm:^7.24.4" "@babel/preset-typescript": "npm:^7.24.1" - "@swc/core": "npm:^1.4.12" + "@swc/core": "npm:^1.4.13" "@swc/jest": "npm:^0.2.36" "@types/jest": "npm:^29.5.12" - "@types/node": "npm:^20.12.5" + "@types/node": "npm:^20.12.6" babel-jest: "npm:^29.7.0" fast-deep-equal: "npm:^3.1.3" jest: "npm:^29.7.0" @@ -17130,7 +16650,7 @@ __metadata: ts-node: "npm:^10.9.2" ts-toolbelt: "npm:^9.6.0" tslib: "npm:^2.6.2" - typedoc: "npm:^0.25.12" + typedoc: "npm:^0.25.13" typescript: "npm:^5.4.4" vite: "npm:^5.2.8" peerDependencies: @@ -17377,9 +16897,9 @@ __metadata: languageName: node linkType: hard -"netlify-cli@npm:^17.21.2": - version: 17.21.2 - resolution: "netlify-cli@npm:17.21.2" +"netlify-cli@npm:^17.22.0": + version: 17.22.0 + resolution: "netlify-cli@npm:17.22.0" dependencies: "@bugsnag/js": "npm:7.20.2" "@fastify/static": "npm:6.10.2" @@ -17388,6 +16908,7 @@ __metadata: "@netlify/build-info": "npm:7.13.2" "@netlify/config": "npm:20.12.1" "@netlify/edge-bundler": "npm:11.3.0" + "@netlify/edge-functions": "npm:2.5.1" "@netlify/local-functions-proxy": "npm:1.1.1" "@netlify/zip-it-and-ship-it": "npm:9.31.1" "@octokit/rest": "npm:19.0.13" @@ -17495,7 +17016,7 @@ __metadata: bin: netlify: bin/run.js ntl: bin/run.js - checksum: 10c0/c0aa83d196478f8c8ec6dab4392d2df34ca8b25ee8a95f30fe8685b462d0f7d346012672b24bff5d5dfdb54e57532a78d27bdba5722d2ade1eda2259c8f9dace + checksum: 10c0/2a4b148508965216e3ed272ef30e399e8c451ca80f1132ab67092de95e37a2c230d568a7ced83b1cb4f3a73f3638ae8f3b6fb47c1b326cefe2e22aa71859abac languageName: node linkType: hard @@ -17955,14 +17476,13 @@ __metadata: linkType: hard "object.groupby@npm:^1.0.1": - version: 1.0.1 - resolution: "object.groupby@npm:1.0.1" + version: 1.0.3 + resolution: "object.groupby@npm:1.0.3" dependencies: - call-bind: "npm:^1.0.2" - define-properties: "npm:^1.2.0" - es-abstract: "npm:^1.22.1" - get-intrinsic: "npm:^1.2.1" - checksum: 10c0/61e41fbf08cc04ed860363db9629eedeaa590fce243c0960e948fd7b11f78a9d4350065c339936d118a2dd8775d7259e26207340cc8ce688bec66cb615fec6fe + call-bind: "npm:^1.0.7" + define-properties: "npm:^1.2.1" + es-abstract: "npm:^1.23.2" + checksum: 10c0/60d0455c85c736fbfeda0217d1a77525956f76f7b2495edeca9e9bbf8168a45783199e77b894d30638837c654d0cc410e0e02cbfcf445bc8de71c3da1ede6a9c languageName: node linkType: hard @@ -19238,18 +18758,7 @@ __metadata: languageName: node linkType: hard -"postcss@npm:^8.4.17, postcss@npm:^8.4.21, postcss@npm:^8.4.23, postcss@npm:^8.4.26": - version: 8.4.37 - resolution: "postcss@npm:8.4.37" - dependencies: - nanoid: "npm:^3.3.7" - picocolors: "npm:^1.0.0" - source-map-js: "npm:^1.2.0" - checksum: 10c0/0b5730ad0ccbceaf0faaa4a283a144adefd23254f17dbdd63be5e0b37193c7df58003f88742c04c3ae6fd60d1a5158b331a4ce926797fb21e94833ae83c6bf69 - languageName: node - linkType: hard - -"postcss@npm:^8.4.38": +"postcss@npm:^8.4.17, postcss@npm:^8.4.21, postcss@npm:^8.4.23, postcss@npm:^8.4.26, postcss@npm:^8.4.38": version: 8.4.38 resolution: "postcss@npm:8.4.38" dependencies: @@ -20646,20 +20155,22 @@ __metadata: version: 0.0.0-use.local resolution: "root@workspace:." dependencies: - "@typescript-eslint/eslint-plugin": "npm:^7.5.0" - "@typescript-eslint/parser": "npm:^7.5.0" + "@eslint/eslintrc": "npm:^3.0.2" + "@eslint/js": "npm:^9.0.0" codecov: "npm:^3.8.3" eslint: "npm:^8.57.0" eslint-config-prettier: "npm:^9.1.0" eslint-plugin-import: "npm:^2.29.1" eslint-plugin-react: "npm:^7.34.1" eslint-plugin-react-hooks: "npm:^4.6.0" + globals: "npm:^15.0.0" mobx: "npm:^6.12.3" - netlify-cli: "npm:^17.21.2" + netlify-cli: "npm:^17.22.0" prettier: "npm:^3.2.5" prettier-plugin-organize-imports: "npm:^3.2.4" turbo: "npm:^1.13.2" typescript: "npm:^5.4.4" + typescript-eslint: "npm:^7.6.0" yjs: "npm:^13.6.14" languageName: unknown linkType: soft @@ -20710,7 +20221,7 @@ __metadata: languageName: node linkType: hard -"safe-array-concat@npm:^1.1.0, safe-array-concat@npm:^1.1.2": +"safe-array-concat@npm:^1.1.2": version: 1.1.2 resolution: "safe-array-concat@npm:1.1.2" dependencies: @@ -20914,7 +20425,7 @@ __metadata: languageName: node linkType: hard -"semver@npm:7.5.4, semver@npm:^7.0.0, semver@npm:^7.3.2, semver@npm:^7.3.4, semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.3.8, semver@npm:^7.5.3, semver@npm:^7.5.4": +"semver@npm:7.5.4": version: 7.5.4 resolution: "semver@npm:7.5.4" dependencies: @@ -20934,6 +20445,17 @@ __metadata: languageName: node linkType: hard +"semver@npm:^7.0.0, semver@npm:^7.3.2, semver@npm:^7.3.4, semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.3.8, semver@npm:^7.5.3, semver@npm:^7.5.4, semver@npm:^7.6.0": + version: 7.6.0 + resolution: "semver@npm:7.6.0" + dependencies: + lru-cache: "npm:^6.0.0" + bin: + semver: bin/semver.js + checksum: 10c0/fbfe717094ace0aa8d6332d7ef5ce727259815bd8d8815700853f4faf23aacbd7192522f0dc5af6df52ef4fa85a355ebd2f5d39f554bd028200d6cf481ab9b53 + languageName: node + linkType: hard + "send@npm:0.18.0": version: 0.18.0 resolution: "send@npm:0.18.0" @@ -21261,7 +20783,7 @@ __metadata: "@docusaurus/tsconfig": "npm:^3.2.1" "@easyops-cn/docusaurus-search-local": "npm:^0.40.1" "@svgr/webpack": "npm:^8.1.0" - "@types/react": "npm:^18.2.74" + "@types/react": "npm:^18.2.75" "@types/react-dom": "npm:^18.2.24" "@types/uuid": "npm:^9.0.8" bootstrap-icons: "npm:^1.11.3" @@ -21824,36 +21346,37 @@ __metadata: languageName: node linkType: hard -"string.prototype.trim@npm:^1.2.8": - version: 1.2.8 - resolution: "string.prototype.trim@npm:1.2.8" +"string.prototype.trim@npm:^1.2.9": + version: 1.2.9 + resolution: "string.prototype.trim@npm:1.2.9" dependencies: - call-bind: "npm:^1.0.2" - define-properties: "npm:^1.2.0" - es-abstract: "npm:^1.22.1" - checksum: 10c0/4f76c583908bcde9a71208ddff38f67f24c9ec8093631601666a0df8b52fad44dad2368c78895ce83eb2ae8e7068294cc96a02fc971ab234e4d5c9bb61ea4e34 + call-bind: "npm:^1.0.7" + define-properties: "npm:^1.2.1" + es-abstract: "npm:^1.23.0" + es-object-atoms: "npm:^1.0.0" + checksum: 10c0/dcef1a0fb61d255778155006b372dff8cc6c4394bc39869117e4241f41a2c52899c0d263ffc7738a1f9e61488c490b05c0427faa15151efad721e1a9fb2663c2 languageName: node linkType: hard -"string.prototype.trimend@npm:^1.0.7": - version: 1.0.7 - resolution: "string.prototype.trimend@npm:1.0.7" +"string.prototype.trimend@npm:^1.0.8": + version: 1.0.8 + resolution: "string.prototype.trimend@npm:1.0.8" dependencies: - call-bind: "npm:^1.0.2" - define-properties: "npm:^1.2.0" - es-abstract: "npm:^1.22.1" - checksum: 10c0/53c24911c7c4d8d65f5ef5322de23a3d5b6b4db73273e05871d5ab4571ae5638f38f7f19d71d09116578fb060e5a145cc6a208af2d248c8baf7a34f44d32ce57 + call-bind: "npm:^1.0.7" + define-properties: "npm:^1.2.1" + es-object-atoms: "npm:^1.0.0" + checksum: 10c0/0a0b54c17c070551b38e756ae271865ac6cc5f60dabf2e7e343cceae7d9b02e1a1120a824e090e79da1b041a74464e8477e2da43e2775c85392be30a6f60963c languageName: node linkType: hard -"string.prototype.trimstart@npm:^1.0.7": - version: 1.0.7 - resolution: "string.prototype.trimstart@npm:1.0.7" +"string.prototype.trimstart@npm:^1.0.8": + version: 1.0.8 + resolution: "string.prototype.trimstart@npm:1.0.8" dependencies: - call-bind: "npm:^1.0.2" - define-properties: "npm:^1.2.0" - es-abstract: "npm:^1.22.1" - checksum: 10c0/0bcf391b41ea16d4fda9c9953d0a7075171fe090d33b4cf64849af94944c50862995672ac03e0c5dba2940a213ad7f53515a668dac859ce22a0276289ae5cf4f + call-bind: "npm:^1.0.7" + define-properties: "npm:^1.2.1" + es-object-atoms: "npm:^1.0.0" + checksum: 10c0/d53af1899959e53c83b64a5fd120be93e067da740e7e75acb433849aa640782fb6c7d4cd5b84c954c84413745a3764df135a8afeb22908b86a835290788d8366 languageName: node linkType: hard @@ -22587,7 +22110,7 @@ __metadata: languageName: node linkType: hard -"ts-api-utils@npm:^1.0.1": +"ts-api-utils@npm:^1.3.0": version: 1.3.0 resolution: "ts-api-utils@npm:1.3.0" peerDependencies: @@ -22842,13 +22365,6 @@ __metadata: languageName: node linkType: hard -"type-fest@npm:^3.0.0": - version: 3.13.1 - resolution: "type-fest@npm:3.13.1" - checksum: 10c0/547d22186f73a8c04590b70dcf63baff390078c75ea8acd366bbd510fd0646e348bd1970e47ecf795b7cff0b41d26e9c475c1fedd6ef5c45c82075fbf916b629 - languageName: node - linkType: hard - "type-fest@npm:^4.6.0, type-fest@npm:^4.7.1": version: 4.12.0 resolution: "type-fest@npm:4.12.0" @@ -22904,9 +22420,9 @@ __metadata: languageName: node linkType: hard -"typed-array-length@npm:^1.0.5": - version: 1.0.5 - resolution: "typed-array-length@npm:1.0.5" +"typed-array-length@npm:^1.0.6": + version: 1.0.6 + resolution: "typed-array-length@npm:1.0.6" dependencies: call-bind: "npm:^1.0.7" for-each: "npm:^0.3.3" @@ -22914,7 +22430,7 @@ __metadata: has-proto: "npm:^1.0.3" is-typed-array: "npm:^1.1.13" possible-typed-array-names: "npm:^1.0.0" - checksum: 10c0/5cc0f79196e70a92f8f40846cfa62b3de6be51e83f73655e137116cf65e3c29a288502b18cc8faf33c943c2470a4569009e1d6da338441649a2db2f135761ad5 + checksum: 10c0/74253d7dc488eb28b6b2711cf31f5a9dcefc9c41b0681fd1c178ed0a1681b4468581a3626d39cd4df7aee3d3927ab62be06aa9ca74e5baf81827f61641445b77 languageName: node linkType: hard @@ -22927,9 +22443,9 @@ __metadata: languageName: node linkType: hard -"typedoc@npm:^0.25.12": - version: 0.25.12 - resolution: "typedoc@npm:0.25.12" +"typedoc@npm:^0.25.13": + version: 0.25.13 + resolution: "typedoc@npm:0.25.13" dependencies: lunr: "npm:^2.3.9" marked: "npm:^4.3.0" @@ -22939,21 +22455,27 @@ __metadata: typescript: 4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x bin: typedoc: bin/typedoc - checksum: 10c0/35157a90954ed67243bc1ad430781de381431959c62e24f8a8688c4ebae62c2ee11d404002dfd43a0df3bf96721d94fce928423fe1f91f1ed40c99f29c5276aa + checksum: 10c0/13878e6a9fc2b65d65e3b514efa11b43bdfd57149861cefc4a969ec213f4bc4b36ee9239d0b654ae18bcbbd5174206d409383f9000b7bdea22da1945f7ac91de languageName: node linkType: hard -"typescript@npm:^5.0.0, typescript@npm:^5.0.4": - version: 5.4.3 - resolution: "typescript@npm:5.4.3" - bin: - tsc: bin/tsc - tsserver: bin/tsserver - checksum: 10c0/22443a8760c3668e256c0b34b6b45c359ef6cecc10c42558806177a7d500ab1a7d7aac1f976d712e26989ddf6731d2fbdd3212b7c73290a45127c1c43ba2005a +"typescript-eslint@npm:^7.6.0": + version: 7.6.0 + resolution: "typescript-eslint@npm:7.6.0" + dependencies: + "@typescript-eslint/eslint-plugin": "npm:7.6.0" + "@typescript-eslint/parser": "npm:7.6.0" + "@typescript-eslint/utils": "npm:7.6.0" + peerDependencies: + eslint: ^8.56.0 + peerDependenciesMeta: + typescript: + optional: true + checksum: 10c0/1950ae59069860cc802de9c1c4f15013099b677b47cabc8dc24200dbe9a4a5a3db5ff9b88e6813658b089e16294d75835b6c17d13a445cf29c954a71eb27ff6f languageName: node linkType: hard -"typescript@npm:^5.4.4": +"typescript@npm:^5.0.0, typescript@npm:^5.0.4, typescript@npm:^5.4.4": version: 5.4.4 resolution: "typescript@npm:5.4.4" bin: @@ -22963,17 +22485,7 @@ __metadata: languageName: node linkType: hard -"typescript@patch:typescript@npm%3A^5.0.0#optional!builtin, typescript@patch:typescript@npm%3A^5.0.4#optional!builtin": - version: 5.4.3 - resolution: "typescript@patch:typescript@npm%3A5.4.3#optional!builtin::version=5.4.3&hash=5adc0c" - bin: - tsc: bin/tsc - tsserver: bin/tsserver - checksum: 10c0/6e51f8b7e6ec55b897b9e56b67e864fe8f44e30f4a14357aad5dc0f7432db2f01efc0522df0b6c36d361c51f2dc3dcac5c832efd96a404cfabf884e915d38828 - languageName: node - linkType: hard - -"typescript@patch:typescript@npm%3A^5.4.4#optional!builtin": +"typescript@patch:typescript@npm%3A^5.0.0#optional!builtin, typescript@patch:typescript@npm%3A^5.0.4#optional!builtin, typescript@patch:typescript@npm%3A^5.4.4#optional!builtin": version: 5.4.4 resolution: "typescript@patch:typescript@npm%3A5.4.4#optional!builtin::version=5.4.4&hash=5adc0c" bin: @@ -23845,7 +23357,7 @@ __metadata: languageName: node linkType: hard -"webpack-sources@npm:^3.2.2, webpack-sources@npm:^3.2.3": +"webpack-sources@npm:^3.2.3": version: 3.2.3 resolution: "webpack-sources@npm:3.2.3" checksum: 10c0/2ef63d77c4fad39de4a6db17323d75eb92897b32674e97d76f0a1e87c003882fc038571266ad0ef581ac734cbe20952912aaa26155f1905e96ce251adbb1eb4e @@ -23983,7 +23495,7 @@ __metadata: languageName: node linkType: hard -"which-typed-array@npm:^1.1.14, which-typed-array@npm:^1.1.9": +"which-typed-array@npm:^1.1.14, which-typed-array@npm:^1.1.15, which-typed-array@npm:^1.1.9": version: 1.1.15 resolution: "which-typed-array@npm:1.1.15" dependencies: