Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

259 update dependencies #263

Merged
merged 2 commits into from
Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
[
"!",
" * @license",
" * Copyright (C) 2023 Final Hill LLC",
" * Copyright (C) 2024 Final Hill LLC",
" * SPDX-License-Identifier: AGPL-3.0-only",
" * @see <https://spdx.org/licenses/AGPL-3.0-only.html>",
" "
Expand Down Expand Up @@ -155,6 +155,13 @@
"regex": "^I[A-Z]",
"match": false
}
},
{
"selector": "import",
"format": [
"camelCase",
"PascalCase"
]
}
],
"@typescript-eslint/consistent-type-assertions": "error",
Expand Down
2,693 changes: 1,270 additions & 1,423 deletions package-lock.json

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,23 +47,23 @@
"author": "Michael L Haufe <michael.haufe@final-hill.com> (https://final-hill.com)",
"license": "AGPL-3.0-only",
"devDependencies": {
"@types/jest": "^29.5.4",
"@types/node": "^20.5.6",
"@typescript-eslint/eslint-plugin": "^6.4.1",
"@typescript-eslint/parser": "^6.4.1",
"eslint": "^8.48.0",
"@types/jest": "^29.5.11",
"@types/node": "^20.11.2",
"@typescript-eslint/eslint-plugin": "^6.19.0",
"@typescript-eslint/parser": "^6.19.0",
"eslint": "^8.56.0",
"eslint-plugin-header": "^3.1.1",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-import": "^2.29.1",
"eslint-webpack-plugin": "^4.0.1",
"jest": "^29.6.4",
"jest": "^29.7.0",
"jest-junit": "^16.0.0",
"ts-jest": "^29.1.1",
"ts-loader": "^9.4.4",
"typescript": "^5.2.2",
"webpack": "^5.88.2",
"ts-loader": "^9.5.1",
"typescript": "^5.3.3",
"webpack": "^5.89.0",
"webpack-cli": "^5.1.4"
},
"files": [
"dist"
]
}
}
2 changes: 1 addition & 1 deletion src/AssertionError.mts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* @license
* Copyright (C) 2023 Final Hill LLC
* Copyright (C) 2024 Final Hill LLC
* SPDX-License-Identifier: AGPL-3.0-only
* @see <https://spdx.org/licenses/AGPL-3.0-only.html>
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Contract.mts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* @license
* Copyright (C) 2023 Final Hill LLC
* Copyright (C) 2024 Final Hill LLC
* SPDX-License-Identifier: AGPL-3.0-only
* @see <https://spdx.org/licenses/AGPL-3.0-only.html>
*/
Expand Down
10 changes: 5 additions & 5 deletions src/Contracted.mts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*!
* @license
* Copyright (C) 2023 Final Hill LLC
* Copyright (C) 2024 Final Hill LLC
* SPDX-License-Identifier: AGPL-3.0-only
* @see <https://spdx.org/licenses/AGPL-3.0-only.html>
*/

import { ClassRegistration, CLASS_REGISTRY, ClassType, Feature, takeWhile, assertInvariants } from './lib/index.mjs';
import { ClassRegistration, classRegistry, ClassType, Feature, takeWhile, assertInvariants } from './lib/index.mjs';
import { assert, checkedMode, Contract, extend } from './index.mjs';
import { Messages } from './Messages.mjs';

Expand Down Expand Up @@ -64,14 +64,14 @@ function Contracted<
super(...args);

const Class = this.constructor as ClassType<any>,
classRegistration = CLASS_REGISTRY.getOrCreate(Class);
classRegistration = classRegistry.getOrCreate(Class);

assert(!hasProperties(classRegistration, this), Messages.MsgNoProperties);

if (!classRegistration.contractsChecked) {
// bottom-up to closest Contracted class bind contracts
const ancRegistrations = takeWhile(classRegistration.ancestry(), (cr => cr.Class !== Clazz));
[classRegistration, ...ancRegistrations, CLASS_REGISTRY.get(Clazz)!].forEach(registration => {
[classRegistration, ...ancRegistrations, classRegistry.get(Clazz)!].forEach(registration => {
registration.bindContract(InnerContracted[innerContract]);
});
}
Expand All @@ -88,7 +88,7 @@ function Contracted<
get [innerContract]() { return contract; }
}

const classRegistration = CLASS_REGISTRY.getOrCreate(InnerContracted);
const classRegistration = classRegistry.getOrCreate(InnerContracted);
classRegistration.contractsChecked = false;

Object.freeze(Clazz);
Expand Down
2 changes: 1 addition & 1 deletion src/Messages.mts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* @license
* Copyright (C) 2023 Final Hill LLC
* Copyright (C) 2024 Final Hill LLC
* SPDX-License-Identifier: AGPL-3.0-only
* @see <https://spdx.org/licenses/AGPL-3.0-only.html>
*/
Expand Down
2 changes: 1 addition & 1 deletion src/assert.mts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* @license
* Copyright (C) 2023 Final Hill LLC
* Copyright (C) 2024 Final Hill LLC
* SPDX-License-Identifier: AGPL-3.0-only
* @see <https://spdx.org/licenses/AGPL-3.0-only.html>
*/
Expand Down
2 changes: 1 addition & 1 deletion src/iff.mts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* @license
* Copyright (C) 2023 Final Hill LLC
* Copyright (C) 2024 Final Hill LLC
* SPDX-License-Identifier: AGPL-3.0-only
* @see <https://spdx.org/licenses/AGPL-3.0-only.html>
*/
Expand Down
2 changes: 1 addition & 1 deletion src/implies.mts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* @license
* Copyright (C) 2023 Final Hill LLC
* Copyright (C) 2024 Final Hill LLC
* SPDX-License-Identifier: AGPL-3.0-only
* @see <https://spdx.org/licenses/AGPL-3.0-only.html>
*/
Expand Down
2 changes: 1 addition & 1 deletion src/index.mts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* @license
* Copyright (C) 2023 Final Hill LLC
* Copyright (C) 2024 Final Hill LLC
* SPDX-License-Identifier: AGPL-3.0-only
* @see <https://spdx.org/licenses/AGPL-3.0-only.html>
*/
Expand Down
8 changes: 4 additions & 4 deletions src/lib/ClassRegistration.mts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/*!
* @license
* Copyright (C) 2023 Final Hill LLC
* Copyright (C) 2024 Final Hill LLC
* SPDX-License-Identifier: AGPL-3.0-only
* @see <https://spdx.org/licenses/AGPL-3.0-only.html>
*/

import { Messages } from '../Messages.mjs';
import { assert, checkedMode, Contract, innerContract } from '../index.mjs';
import { assertInvariants, assertDemands, CLASS_REGISTRY, ClassType, Feature, unChecked } from './index.mjs';
import { assertInvariants, assertDemands, classRegistry, ClassType, Feature, unChecked } from './index.mjs';
import assertEnsures from './assertEnsures.mjs';

/**
Expand Down Expand Up @@ -117,7 +117,7 @@ class ClassRegistration {
* Returns the classRegistration of the parent class
*/
get parentRegistration(): ClassRegistration | null {
return this.ParentClass == null ? null : CLASS_REGISTRY.getOrCreate(this.ParentClass);
return this.ParentClass == null ? null : classRegistry.getOrCreate(this.ParentClass);
}

/**
Expand All @@ -130,7 +130,7 @@ class ClassRegistration {
if (this.ParentClass == null)
return [];
else {
const parentRegistry = CLASS_REGISTRY.getOrCreate(this.ParentClass);
const parentRegistry = classRegistry.getOrCreate(this.ParentClass);

return [parentRegistry, ...parentRegistry.ancestry()];
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/ClassType.mts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* @license
* Copyright (C) 2023 Final Hill LLC
* Copyright (C) 2024 Final Hill LLC
* SPDX-License-Identifier: AGPL-3.0-only
* @see <https://spdx.org/licenses/AGPL-3.0-only.html>
*/
Expand Down
2 changes: 1 addition & 1 deletion src/lib/Feature.mts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* @license
* Copyright (C) 2023 Final Hill LLC
* Copyright (C) 2024 Final Hill LLC
* SPDX-License-Identifier: AGPL-3.0-only
* @see <https://spdx.org/licenses/AGPL-3.0-only.html>
*/
Expand Down
2 changes: 1 addition & 1 deletion src/lib/assertDemands.mts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* @license
* Copyright (C) 2023 Final Hill LLC
* Copyright (C) 2024 Final Hill LLC
* SPDX-License-Identifier: AGPL-3.0-only
* @see <https://spdx.org/licenses/AGPL-3.0-only.html>
*/
Expand Down
2 changes: 1 addition & 1 deletion src/lib/assertEnsures.mts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* @license
* Copyright (C) 2023 Final Hill LLC
* Copyright (C) 2024 Final Hill LLC
* SPDX-License-Identifier: AGPL-3.0-only
* @see <https://spdx.org/licenses/AGPL-3.0-only.html>
*/
Expand Down
2 changes: 1 addition & 1 deletion src/lib/assertInvariants.mts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* @license
* Copyright (C) 2023 Final Hill LLC
* Copyright (C) 2024 Final Hill LLC
* SPDX-License-Identifier: AGPL-3.0-only
* @see <https://spdx.org/licenses/AGPL-3.0-only.html>
*/
Expand Down
8 changes: 3 additions & 5 deletions src/lib/CLASS_REGISTRY.mts → src/lib/classRegistry.mts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* @license
* Copyright (C) 2023 Final Hill LLC
* Copyright (C) 2024 Final Hill LLC
* SPDX-License-Identifier: AGPL-3.0-only
* @see <https://spdx.org/licenses/AGPL-3.0-only.html>
*/
Expand All @@ -22,14 +22,12 @@ class ClassRegistry extends WeakMap<ClassType<any>, ClassRegistration> {
getOrCreate(Class: ClassType<any>): ClassRegistration {
if (this.has(Class))
return this.get(Class)!;
else {
else {
this.set(Class, new ClassRegistration(Class));

return this.get(Class)!;
}
}
}

const CLASS_REGISTRY = new ClassRegistry();

export default CLASS_REGISTRY;
export default new ClassRegistry();
2 changes: 1 addition & 1 deletion src/lib/deepFreeze.mts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* @license
* Copyright (C) 2023 Final Hill LLC
* Copyright (C) 2024 Final Hill LLC
* SPDX-License-Identifier: AGPL-3.0-only
* @see <https://spdx.org/licenses/AGPL-3.0-only.html>
*/
Expand Down
6 changes: 3 additions & 3 deletions src/lib/index.mts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/*!
* @license
* Copyright (C) 2023 Final Hill LLC
* Copyright (C) 2024 Final Hill LLC
* SPDX-License-Identifier: AGPL-3.0-only
* @see <https://spdx.org/licenses/AGPL-3.0-only.html>
*/

import assertDemands from './assertDemands.mjs';
import assertEnsures from './assertEnsures.mjs';
import assertInvariants from './assertInvariants.mjs';
import CLASS_REGISTRY from './CLASS_REGISTRY.mjs';
import classRegistry from './classRegistry.mjs';
import ClassRegistration from './ClassRegistration.mjs';
import { ClassType } from './ClassType.mjs';
import deepFreeze from './deepFreeze.mjs';
Expand All @@ -22,7 +22,7 @@ export {
assertDemands,
assertEnsures,
assertInvariants,
CLASS_REGISTRY,
classRegistry,
ClassRegistration,
ClassType,
deepFreeze,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/takeWhile.mts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* @license
* Copyright (C) 2023 Final Hill LLC
* Copyright (C) 2024 Final Hill LLC
* SPDX-License-Identifier: AGPL-3.0-only
* @see <https://spdx.org/licenses/AGPL-3.0-only.html>
*/
Expand Down
2 changes: 1 addition & 1 deletion src/lib/unChecked.mts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* @license
* Copyright (C) 2023 Final Hill LLC
* Copyright (C) 2024 Final Hill LLC
* SPDX-License-Identifier: AGPL-3.0-only
* @see <https://spdx.org/licenses/AGPL-3.0-only.html>
*/
Expand Down
2 changes: 1 addition & 1 deletion src/tests/Contract.test.mts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* @license
* Copyright (C) 2023 Final Hill LLC
* Copyright (C) 2024 Final Hill LLC
* SPDX-License-Identifier: AGPL-3.0-only
* @see <https://spdx.org/licenses/AGPL-3.0-only.html>
*/
Expand Down
2 changes: 1 addition & 1 deletion src/tests/Stack.test.mts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* @license
* Copyright (C) 2023 Final Hill LLC
* Copyright (C) 2024 Final Hill LLC
* SPDX-License-Identifier: AGPL-3.0-only
* @see <https://spdx.org/licenses/AGPL-3.0-only.html>
*/
Expand Down
2 changes: 1 addition & 1 deletion src/tests/assert.test.mts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* @license
* Copyright (C) 2023 Final Hill LLC
* Copyright (C) 2024 Final Hill LLC
* SPDX-License-Identifier: AGPL-3.0-only
* @see <https://spdx.org/licenses/AGPL-3.0-only.html>
*/
Expand Down
2 changes: 1 addition & 1 deletion src/tests/deepFreeze.test.mts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* @license
* Copyright (C) 2023 Final Hill LLC
* Copyright (C) 2024 Final Hill LLC
* SPDX-License-Identifier: AGPL-3.0-only
* @see <https://spdx.org/licenses/AGPL-3.0-only.html>
*/
Expand Down
2 changes: 1 addition & 1 deletion src/tests/demands.test.mts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* @license
* Copyright (C) 2023 Final Hill LLC
* Copyright (C) 2024 Final Hill LLC
* SPDX-License-Identifier: AGPL-3.0-only
* @see <https://spdx.org/licenses/AGPL-3.0-only.html>
*/
Expand Down
2 changes: 1 addition & 1 deletion src/tests/ensures.test.mts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* @license
* Copyright (C) 2023 Final Hill LLC
* Copyright (C) 2024 Final Hill LLC
* SPDX-License-Identifier: AGPL-3.0-only
* @see <https://spdx.org/licenses/AGPL-3.0-only.html>
*/
Expand Down
2 changes: 1 addition & 1 deletion src/tests/factoryPattern.test.mts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* @license
* Copyright (C) 2023 Final Hill LLC
* Copyright (C) 2024 Final Hill LLC
* SPDX-License-Identifier: AGPL-3.0-only
* @see <https://spdx.org/licenses/AGPL-3.0-only.html>
*/
Expand Down
2 changes: 1 addition & 1 deletion src/tests/iff.test.mts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* @license
* Copyright (C) 2023 Final Hill LLC
* Copyright (C) 2024 Final Hill LLC
* SPDX-License-Identifier: AGPL-3.0-only
* @see <https://spdx.org/licenses/AGPL-3.0-only.html>
*/
Expand Down
2 changes: 1 addition & 1 deletion src/tests/implies.test.mts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* @license
* Copyright (C) 2023 Final Hill LLC
* Copyright (C) 2024 Final Hill LLC
* SPDX-License-Identifier: AGPL-3.0-only
* @see <https://spdx.org/licenses/AGPL-3.0-only.html>
*/
Expand Down
2 changes: 1 addition & 1 deletion src/tests/invariant.test.mts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* @license
* Copyright (C) 2023 Final Hill LLC
* Copyright (C) 2024 Final Hill LLC
* SPDX-License-Identifier: AGPL-3.0-only
* @see <https://spdx.org/licenses/AGPL-3.0-only.html>
*/
Expand Down
2 changes: 1 addition & 1 deletion src/tests/public-properties.test.mts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* @license
* Copyright (C) 2023 Final Hill LLC
* Copyright (C) 2024 Final Hill LLC
* SPDX-License-Identifier: AGPL-3.0-only
* @see <https://spdx.org/licenses/AGPL-3.0-only.html>
*/
Expand Down
Loading
Loading