@final-hill/decorator-contracts 0.24.1 → 0.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/README.md +22 -143
  2. package/dist/{AssertionError.d.ts → AssertionError.d.mts} +10 -10
  3. package/dist/Contract.d.mts +39 -0
  4. package/dist/Contracted.d.mts +21 -0
  5. package/dist/Messages.d.mts +16 -0
  6. package/dist/{assert.d.ts → assert.d.mts} +8 -8
  7. package/dist/{iff.d.ts → iff.d.mts} +7 -7
  8. package/dist/{implies.d.ts → implies.d.mts} +7 -7
  9. package/dist/index.d.mts +13 -0
  10. package/dist/index.mjs +3 -0
  11. package/dist/{index.js.LICENSE.txt → index.mjs.LICENSE.txt} +1 -1
  12. package/dist/index.mjs.map +1 -0
  13. package/dist/lib/{CLASS_REGISTRY.d.ts → CLASS_REGISTRY.d.mts} +12 -12
  14. package/dist/lib/{ClassRegistration.d.ts → ClassRegistration.d.mts} +23 -24
  15. package/dist/lib/ClassType.d.mts +10 -0
  16. package/dist/lib/{Feature.d.ts → Feature.d.mts} +26 -29
  17. package/dist/lib/{assertDemands.d.ts → assertDemands.d.mts} +9 -9
  18. package/dist/lib/assertEnsures.d.mts +10 -0
  19. package/dist/lib/{assertInvariants.d.ts → assertInvariants.d.mts} +9 -9
  20. package/dist/lib/{deepFreeze.d.ts → deepFreeze.d.mts} +8 -8
  21. package/dist/lib/index.d.mts +18 -0
  22. package/dist/lib/{takeWhile.d.ts → takeWhile.d.mts} +8 -8
  23. package/dist/lib/{unChecked.d.ts → unChecked.d.mts} +9 -9
  24. package/dist/tests/{deepFreeze.test.d.ts → Contract.test.d.mts} +7 -7
  25. package/dist/tests/{Contract.test.d.ts → Stack.test.d.mts} +7 -7
  26. package/dist/tests/{assert.test.d.ts → assert.test.d.mts} +7 -7
  27. package/dist/tests/{Stack.test.d.ts → deepFreeze.test.d.mts} +7 -7
  28. package/dist/tests/demands.test.d.mts +7 -0
  29. package/dist/tests/ensures.test.d.mts +7 -0
  30. package/dist/tests/factoryPattern.test.d.mts +7 -0
  31. package/dist/tests/iff.test.d.mts +7 -0
  32. package/dist/tests/implies.test.d.mts +7 -0
  33. package/dist/tests/invariant.test.d.mts +7 -0
  34. package/dist/tests/public-properties.test.d.mts +7 -0
  35. package/dist/tests/rescue.test.d.mts +7 -0
  36. package/dist/tests/within.test.d.mts +7 -0
  37. package/package.json +26 -46
  38. package/CHANGELOG.md +0 -282
  39. package/dist/Contract.d.ts +0 -39
  40. package/dist/Contracted.d.ts +0 -12
  41. package/dist/Messages.d.ts +0 -18
  42. package/dist/index.d.ts +0 -14
  43. package/dist/index.js +0 -3
  44. package/dist/index.js.map +0 -1
  45. package/dist/lib/ClassType.d.ts +0 -10
  46. package/dist/lib/assertEnsures.d.ts +0 -9
  47. package/dist/lib/index.d.ts +0 -18
  48. package/dist/override.d.ts +0 -8
  49. package/dist/tests/demands.test.d.ts +0 -7
  50. package/dist/tests/ensures.test.d.ts +0 -7
  51. package/dist/tests/factoryPattern.test.d.ts +0 -7
  52. package/dist/tests/iff.test.d.ts +0 -7
  53. package/dist/tests/implies.test.d.ts +0 -7
  54. package/dist/tests/invariant.test.d.ts +0 -7
  55. package/dist/tests/override.test.d.ts +0 -7
  56. package/dist/tests/public-properties.test.d.ts +0 -7
  57. package/dist/tests/rescue.test.d.ts +0 -7
  58. package/dist/tests/within.test.d.ts +0 -7
package/CHANGELOG.md DELETED
@@ -1,282 +0,0 @@
1
- # Changelog
2
-
3
- ## v0.24.1
4
-
5
- * Bugfix of generated type declaration (#238)
6
- * Updated README to reflect current features (#239)
7
- * Updated README to use mermaid diagram
8
-
9
- ## v0.24.0
10
-
11
- * Updated debugger settings to leverage modern VSCode
12
- * Fixed a subtle issue with subcontracting resolution (breaking change) ([#236](https://github.com/final-hill/decorator-contracts/issues/236))
13
- * Updated VSCode debug settings to support the modern IDE
14
- * Updated npm dependencies
15
-
16
- ## v0.23.1
17
-
18
- * Updated dependencies
19
- * Refactored code to leverage new TypeScript features
20
-
21
- ## v0.23.0
22
-
23
- * Fixed bug in README Stack example
24
- * Updated README instructions on webpage installation
25
- * Updated dependencies
26
- * Updated headers for 2022
27
- * Linting fixes
28
- * Added better error messaging for `@override` issues
29
-
30
- ## v0.22.0
31
-
32
- * Added `implies` function
33
- * Added `iff` function
34
- * Added topic tags to github repo
35
- * Updated `package.json` keywords
36
-
37
- ## v0.21.2
38
-
39
- * Audit fix of dependencies
40
- * Updated dependencies
41
- * Upgraded implementation to TypeScript 4.4.4
42
-
43
- ## v0.21.1
44
-
45
- * Audit fix of dependencies
46
- * Updated dependencies
47
- * Upgraded implementation to TypeScript 4.3.5
48
-
49
- ## v0.21.0
50
-
51
- * Audit fix of dependencies
52
- * Updated dependencies
53
- * Added support for contracting an abstract class
54
- * Fixed bug [#210](https://github.com/final-hill/decorator-contracts/issues/210) for supporting subcontract private fields
55
- * Added `within` feature for declaring timing requirements
56
- * Updated documentation
57
- * Third party features are subject to a class's `invariant` when apply/call is used
58
- * A contracted feature can not be applied to objects of a different base class
59
- * Subcontract `extends` are now enforced
60
- * Updated `retry` type declaration to support accessors.
61
-
62
- ## v0.20.5
63
-
64
- * Features named with a symbol now support `@override`
65
-
66
- ## v0.20.4
67
-
68
- * Improved error messaging with `@override` when feature is missing
69
- * Fixed source code typos
70
-
71
- ## v0.20.3
72
-
73
- * Fixed bug [#202](https://github.com/final-hill/decorator-contracts/issues/202)
74
-
75
- ## v0.20.2
76
-
77
- * Additional usability fix for [#197](https://github.com/final-hill/decorator-contracts/issues/197)
78
- * Updated README
79
-
80
- ## v0.20.1
81
-
82
- * Fixed bug [#197](https://github.com/final-hill/decorator-contracts/issues/197)
83
-
84
- ## v0.20.0
85
-
86
- * Updated license headers to reference Final Hill LLC
87
- * BREAKING CHANGE: contracts now managed separate from the class
88
- * Rewrote README to reflect the new architecture
89
- * Updated dependencies
90
- * Merged jest.config.js into package.json
91
- * Updated linting rules
92
- * Moved unit tests to separate folder
93
- * Public property definitions are now illegal
94
- * Fixed package.json debug command
95
- * Bugfix of invariant inheritance
96
-
97
- ## v0.19.0
98
-
99
- * Updated README to include unpkg reference
100
- * Enabled sourcemaps
101
- * npm audit fix
102
- * Updated dependencies
103
- * Linting fixes
104
- * Updated contact info in README and package.json
105
- * BREAKING CHANGE: Decorators now accept arrow functions instead of traditional functions. The first parameter is `self`.
106
- * BREAKING CHANGE: @ensures now provides `old` as a parameter to access instance property values before feature execution
107
-
108
- ## v0.18.1
109
-
110
- * Fixed webpack configuration issue
111
-
112
- ## v0.18.0
113
-
114
- * Fixed missing PredicateType issue
115
- * Reorganized README
116
- * Added NPM badges to README
117
- * Added package.json reference to github issues
118
- * Added licensing info to README
119
- * Removed extraneous build dependency
120
-
121
- ## v0.17.4
122
-
123
- * Additional fixes for Release configuration
124
-
125
- ## v0.17.3
126
-
127
- * Additional fixes for Release configuration
128
-
129
- ## v0.17.2
130
-
131
- * Bugfixed Release Configuration
132
-
133
- ## v0.17.1
134
-
135
- * Updated CI/CD configuration
136
-
137
- ## v0.17.0
138
-
139
- * Migrated repository from Azure Devops to GitHub
140
- * Migrated Azure Devops CI/CD workflows to GitHub actions
141
- * Created CHANGELOG.md and removed related build script
142
- * Replaced `#{YEAR}#` token with literal year. Removed related build script
143
- * Removed VSCode Azure DevOps suggested extensions
144
- * Changed license to AGPL-3.0-only
145
- * Updated repository url to point to GitHub url
146
- * Changed library namespace: `@thenewobjective` -> `@final-hill`
147
- * Updated README Dependencies table
148
- * Updated @rescue documentation
149
- * Replaced build versioning with explicit versioning
150
- * Enabled @rescue inheritance
151
- * Created CONTRIBUTING.md
152
-
153
- ## v0.16.0
154
-
155
- * If an exception is thrown in a class feature without a @rescue defined, then the exception is raised to its caller after the @invariant is checked
156
- * If an error is thrown in @demands, the error is raised to the caller
157
- * If an error is raised in a @ensures then the associated @rescue is executed
158
- * Updated README examples
159
- * Updated implementation to consolidate error messages
160
-
161
- ## v0.15.0
162
-
163
- * Switched from tslint to eslint
164
- * Updated assertions to support assertion types from TypeScript 3.7
165
- * Removed Babel dependency
166
- * Refactoring improvements
167
- * Private properties now work with contract inheritance
168
-
169
- ## v0.14.0
170
-
171
- * Updated YAML scripts to reference new Azure vm image
172
- * Refactored Unit Tests
173
- * Refactored implementation to prefer 'const' declarations
174
- * Refactored README examples
175
- * Refactored RescueType to separate file
176
- * Refactored Rescue Decorator
177
- * @rescue now preserves the invariant after execution
178
- * If a @rescue is executed and the retry argument is not called, then an error is thrown
179
-
180
- ## v0.13.0
181
-
182
- * Automated creation of CHANGELOG.md
183
-
184
- ## v0.12.0
185
-
186
- * Updated dependencies including TypeScript to 3.8.2
187
- * Refactored codebase to utilize new TypeScript features
188
- * Added Introduction to README
189
- * Updated package keywords
190
- * @invariant changed to accept functions directly instead of a record factory
191
- * Multiple @invariant declarations can be assigned to a class
192
-
193
- ## v0.11.0
194
-
195
- * Renamed @requires to @demands
196
- * npm audit fixes
197
- * Multiple @demands can be assigned to a class feature
198
- * Implementation of @ensures decorator
199
- * Reorganized README
200
-
201
- ## v0.10.0
202
-
203
- * Significant refactoring and efficiency improvements
204
- * @requires can not be strengthened in a subtype
205
-
206
- ## v0.9.0
207
-
208
- * Refactoring and efficiency improvements
209
- * @override requires @invariant declaration in class ancestry
210
- * Updated Jest configuration for reporting and VSCode debug support
211
- * Cleanup of documentation
212
- * Added checkMode support to @rescue
213
- * Added Babel compilation
214
- * @requires now works with inheritance
215
-
216
- ## v0.8.0
217
-
218
- * Implementation of @rescue decorator
219
- * Renamed debugMode to checkMode
220
- * Refactoring and efficiency improvements
221
- * @requires restricted to instance class features
222
- * Added linting rule to validate file license header
223
- * Updated TypeScript to 3.7.2
224
-
225
- ## v0.7.0
226
-
227
- * @invariant restricted to only one declaration per class
228
- * @override now supports accessors
229
- * Updated package.json metadata for discoverability
230
- * Added Further Reading section to README
231
-
232
- ## v0.6.0
233
-
234
- * @invariant signature changed to accept a function that returns a record of assertions
235
- * @override restricted to instance class features
236
- * @override extended with additional checks to support Substitutability
237
- * Added linting checks to the project
238
-
239
- ## v0.5.0
240
-
241
- * @override decorator implemented
242
-
243
- ## v0.4.0
244
-
245
- * License changed to AGPL-1.0-only
246
-
247
- ## v0.3.0
248
-
249
- * Table of Contents added to README
250
- * @invariant supports no arguments
251
-
252
- ## v0.2.0
253
-
254
- * Added assertion documentation to README
255
- * Assertions support debugMode flag
256
- * Assertions return a boolean
257
- * Assertions support throwing custom error types
258
-
259
- ## v0.1.0
260
-
261
- * Added installation instructions to README
262
- * Enabled project debugging
263
- * @invariant can accept multiple assertions
264
- * @invariant supports message : assertion pairs
265
- * Ancestor @invariant enforced in subclasses
266
- * Subclasses support additional @invariant declarations
267
- * Added built-types to tasks.json
268
- * Refactoring and typing improvements
269
-
270
- ## v0.0.2
271
-
272
- Updated package.json namespace to @thenewobjective prefix
273
-
274
- ## v0.0.1
275
-
276
- * Initial implementation
277
- * Initial Project Setup
278
- * Initial Branch configuration
279
- * Initial Release configuration
280
- * Build tokenization
281
- * Initial @invariant implementation
282
- * Initial Documentation
@@ -1,39 +0,0 @@
1
- /*!
2
- * @license
3
- * Copyright (C) 2022 Final Hill LLC
4
- * SPDX-License-Identifier: AGPL-3.0-only
5
- * @see <https://spdx.org/licenses/AGPL-3.0-only.html>
6
- */
7
- declare const checkedMode: unique symbol, invariant: unique symbol, extend: unique symbol;
8
- declare type AnyObject = Record<PropertyKey, any>;
9
- declare type AnyFunc = (...args: any[]) => any;
10
- declare type NonFunctionPropertyNames<T extends AnyObject> = {
11
- [K in keyof T]: T[K] extends AnyFunc ? never : K;
12
- }[keyof T];
13
- declare type Properties<T extends AnyObject> = Pick<T, NonFunctionPropertyNames<T>>;
14
- export declare type Invariant<T extends AnyObject> = (self: T) => boolean;
15
- export declare type Demands<T extends AnyObject, F extends T[any]> = (self: T, ...args: Parameters<F>) => boolean;
16
- export declare type Ensures<T extends AnyObject, F extends T[any]> = (self: T, old: Properties<T>, ...args: Parameters<F>) => boolean;
17
- export declare type Rescue<T extends AnyObject, F extends T[any]> = (self: T, error: Error, args: F extends AnyFunc ? Parameters<F> : [F], retry: F extends AnyFunc ? (...args: Parameters<F>) => any : (value: F) => void) => void;
18
- export declare type ContractOptions<T extends AnyObject> = {
19
- [extend]: Contract<T>;
20
- [invariant]: Invariant<T>;
21
- [checkedMode]: boolean;
22
- } & {
23
- [K in keyof T]?: FeatureOption<T, T[K]>;
24
- };
25
- export interface FeatureOption<T extends AnyObject, F extends T[any]> {
26
- demands?: Demands<T, F>;
27
- ensures?: Ensures<T, F>;
28
- rescue?: Rescue<T, F>;
29
- within?: number;
30
- }
31
- export declare class Contract<T extends AnyObject> {
32
- #private;
33
- [checkedMode]: boolean;
34
- readonly [extend]?: Contract<T>;
35
- readonly assertions: ContractOptions<T>;
36
- constructor(assertions?: Partial<ContractOptions<T>>);
37
- get [invariant](): Invariant<T>;
38
- }
39
- export { checkedMode, extend, invariant };
@@ -1,12 +0,0 @@
1
- /*!
2
- * @license
3
- * Copyright (C) 2022 Final Hill LLC
4
- * SPDX-License-Identifier: AGPL-3.0-only
5
- * @see <https://spdx.org/licenses/AGPL-3.0-only.html>
6
- */
7
- import { ClassType } from './lib';
8
- import { Contract } from './';
9
- declare const isContracted: unique symbol, innerContract: unique symbol;
10
- declare function Contracted<T extends Contract<any> = Contract<any>, U extends ClassType<any> = ClassType<any>>(contract?: T): ClassDecorator;
11
- export { isContracted, innerContract };
12
- export default Contracted;
@@ -1,18 +0,0 @@
1
- /*!
2
- * @license
3
- * Copyright (C) 2022 Final Hill LLC
4
- * SPDX-License-Identifier: AGPL-3.0-only
5
- * @see <https://spdx.org/licenses/AGPL-3.0-only.html>
6
- */
7
- export declare const ASSERTION_FAILED = "Assertion failure";
8
- export declare const MSG_INVALID_ARG_LENGTH = "An overridden method must have the same number of parameters as its ancestor method";
9
- export declare const MSG_NO_STATIC = "Only instance members can be decorated, not static members";
10
- export declare const MSG_NO_MATCHING_FEATURE = "This feature does not override an ancestor feature.";
11
- export declare const MSG_DUPLICATE_OVERRIDE = "Only a single @override decorator can be assigned to a class member";
12
- export declare const MSG_NO_PROPERTIES = "Public properties are forbidden";
13
- export declare const MSG_NOT_CONTRACTED = "The current class or one of its ancestors must declare @Contracted(...)";
14
- export declare const MSG_MISSING_FEATURE = "The requested feature is not registered";
15
- export declare const MSG_SINGLE_CONTRACT = "Only a single @Contracted decorator is allowed per class";
16
- export declare const MSG_SINGLE_RETRY = "retry can only be called once";
17
- export declare const MSG_INVALID_CONTEXT = "A contracted feature can not be applied to objects of a different base class";
18
- export declare const MSG_BAD_SUBCONTRACT = "A sub contract must extend a base contract";
package/dist/index.d.ts DELETED
@@ -1,14 +0,0 @@
1
- /*!
2
- * @license
3
- * Copyright (C) 2022 Final Hill LLC
4
- * SPDX-License-Identifier: AGPL-3.0-only
5
- * @see <https://spdx.org/licenses/AGPL-3.0-only.html>
6
- */
7
- import AssertionError from './AssertionError';
8
- import Contracted, { innerContract } from './Contracted';
9
- import override from './override';
10
- import assert from './assert';
11
- import implies from './implies';
12
- export { AssertionError, Contracted, implies, innerContract, override, assert };
13
- export { Contract, extend, invariant, Invariant, checkedMode, Rescue } from './Contract';
14
- export { Constructor, AbstractConstructor, ClassType } from './lib/ClassType';
package/dist/index.js DELETED
@@ -1,3 +0,0 @@
1
- /*! For license information please see index.js.LICENSE.txt */
2
- !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r=t();for(var s in r)("object"==typeof exports?exports:e)[s]=r[s]}}(this,(()=>(()=>{"use strict";var e={731:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});class r extends Error{constructor(e){super(e)}}t.default=r},822:function(e,t,r){var s,n=this&&this.__classPrivateFieldSet||function(e,t,r,s,n){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?n.call(e,r):n?n.value=r:t.set(e,r),r},a=this&&this.__classPrivateFieldGet||function(e,t,r,s){if("a"===r&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?s:"a"===r?s.call(e):s?s.value:t.get(e)};Object.defineProperty(t,"__esModule",{value:!0}),t.invariant=t.extend=t.checkedMode=t.Contract=void 0;const o=r(915),i=Symbol("checkedMode"),c=Symbol("invariant"),u=Symbol("extend");t.checkedMode=i,t.invariant=c,t.extend=u;class l{constructor(e=Object.create(null)){var t,r;s.set(this,void 0),this.assertions=Object.create(null),this[u]=e[u],this[i]=null===(t=e[i])||void 0===t||t,n(this,s,null!==(r=e[c])&&void 0!==r?r:o.fnTrue,"f"),Object.keys(e).forEach((t=>{var r,s;const n=e[t];Object.defineProperty(this.assertions,t,{value:{demands:null!==(r=n.demands)&&void 0!==r?r:o.fnTrue,ensures:null!==(s=n.ensures)&&void 0!==s?s:o.fnTrue,rescue:n.rescue,within:n.within}})})),(0,o.deepFreeze)(this.assertions)}get[(s=new WeakMap,c)](){return a(this,s,"f")}}t.Contract=l},879:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.innerContract=t.isContracted=void 0;const s=r(915),n=r(607),a=r(860),o=Symbol("isContracted"),i=Symbol("innerContract");t.isContracted=o,t.innerContract=i,t.default=function(e=new n.Contract){return function(t){var r;if((0,n.assert)(!Object.getOwnPropertySymbols(t).includes(o),a.MSG_SINGLE_CONTRACT),!1===e[n.checkedMode])return t;const c=t[i];(0,n.assert)(!c||c&&e[n.extend]instanceof c.constructor,a.MSG_BAD_SUBCONTRACT);class u extends t{constructor(...e){super(...e);const r=this.constructor,o=s.CLASS_REGISTRY.getOrCreate(r);var c;if((0,n.assert)((c=o,this,!Object.entries(Object.getOwnPropertyDescriptors(this)).some((([e,t])=>new s.Feature(c,e,t).isProperty))),a.MSG_NO_PROPERTIES),!o.contractsChecked){let e=o.ancestry().reverse();[...e,o].forEach((e=>{e.contractsChecked||(e.checkOverrides(),e.contractsChecked=!0)})),e=(0,s.takeWhile)(e.reverse(),(e=>e.Class!==t)),[o,...e,s.CLASS_REGISTRY.get(t)].forEach((e=>{e.bindContract(u[i])}))}return(0,s.assertInvariants)(this,u[i]),this}static get[(r=o,i)](){return e}get[i](){return e}}return u[r]=!0,s.CLASS_REGISTRY.getOrCreate(u).contractsChecked=!1,Object.freeze(t),u}}},860:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MSG_BAD_SUBCONTRACT=t.MSG_INVALID_CONTEXT=t.MSG_SINGLE_RETRY=t.MSG_SINGLE_CONTRACT=t.MSG_MISSING_FEATURE=t.MSG_NOT_CONTRACTED=t.MSG_NO_PROPERTIES=t.MSG_DUPLICATE_OVERRIDE=t.MSG_NO_MATCHING_FEATURE=t.MSG_NO_STATIC=t.MSG_INVALID_ARG_LENGTH=t.ASSERTION_FAILED=void 0,t.ASSERTION_FAILED="Assertion failure",t.MSG_INVALID_ARG_LENGTH="An overridden method must have the same number of parameters as its ancestor method",t.MSG_NO_STATIC="Only instance members can be decorated, not static members",t.MSG_NO_MATCHING_FEATURE="This feature does not override an ancestor feature.",t.MSG_DUPLICATE_OVERRIDE="Only a single @override decorator can be assigned to a class member",t.MSG_NO_PROPERTIES="Public properties are forbidden",t.MSG_NOT_CONTRACTED="The current class or one of its ancestors must declare @Contracted(...)",t.MSG_MISSING_FEATURE="The requested feature is not registered",t.MSG_SINGLE_CONTRACT="Only a single @Contracted decorator is allowed per class",t.MSG_SINGLE_RETRY="retry can only be called once",t.MSG_INVALID_CONTEXT="A contracted feature can not be applied to objects of a different base class",t.MSG_BAD_SUBCONTRACT="A sub contract must extend a base contract"},797:function(e,t,r){var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=s(r(731)),a=r(860);t.default=function(e,t=a.ASSERTION_FAILED,r=n.default){if(0==Boolean(e))throw new r(t)}},606:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return!e||t}},607:function(e,t,r){var s=this&&this.__createBinding||(Object.create?function(e,t,r,s){void 0===s&&(s=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,s,n)}:function(e,t,r,s){void 0===s&&(s=r),e[s]=t[r]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&s(t,e,r);return n(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.checkedMode=t.invariant=t.extend=t.Contract=t.assert=t.override=t.innerContract=t.implies=t.Contracted=t.AssertionError=void 0;const i=o(r(731));t.AssertionError=i.default;const c=a(r(879));t.Contracted=c.default,Object.defineProperty(t,"innerContract",{enumerable:!0,get:function(){return c.innerContract}});const u=o(r(47));t.override=u.default;const l=o(r(797));t.assert=l.default;const d=o(r(606));t.implies=d.default;var f=r(822);Object.defineProperty(t,"Contract",{enumerable:!0,get:function(){return f.Contract}}),Object.defineProperty(t,"extend",{enumerable:!0,get:function(){return f.extend}}),Object.defineProperty(t,"invariant",{enumerable:!0,get:function(){return f.invariant}}),Object.defineProperty(t,"checkedMode",{enumerable:!0,get:function(){return f.checkedMode}})},932:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const s=r(915);class n extends WeakMap{getOrCreate(e){return this.has(e)||this.set(e,new s.ClassRegistration(e)),this.get(e)}}const a=new n;t.default=a},359:function(e,t,r){var s,n=this&&this.__classPrivateFieldSet||function(e,t,r,s,n){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?n.call(e,r):n?n.value=r:t.set(e,r),r},a=this&&this.__classPrivateFieldGet||function(e,t,r,s){if("a"===r&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?s:"a"===r?s.call(e):s?s.value:t.get(e)},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(860),c=r(607),u=r(915),l=o(r(318));function d(e,t,r){return function s(...n){var a,o;const{Class:d}=r;(0,c.assert)(this instanceof d,i.MSG_INVALID_CONTEXT);const f=Reflect.get(this,c.innerContract),h=d.name;if(!f[c.checkedMode])return t.apply(this,n);let _;(0,u.assertInvariants)(this,f),(0,u.assertDemands)(this,f,h,e,n);try{const s=Object.create(null);(0,u.unChecked)(f,(()=>{r.features.forEach((({name:e,hasGetter:t})=>{t&&Object.defineProperty(s,e,{value:this[e]})}))}));const o=null===(a=Reflect.get(f.assertions,e))||void 0===a?void 0:a.within,i=Date.now();_=t.apply(this,n);const d=Date.now();o&&(0,c.assert)(d-i<o,`Timing constraint violated. Constraint: ${o}ms, actual: ${d-i}ms`),(0,l.default)(this,f,h,e,s,n)}catch(t){const r=null===(o=Reflect.get(f.assertions,e))||void 0===o?void 0:o.rescue;if(null==r)throw(0,u.assertInvariants)(this,f),t;let n=!1;if((0,u.unChecked)(f,(()=>{r.call(this,this,t,[],((...e)=>{(0,c.assert)(!n,i.MSG_SINGLE_RETRY),n=!0,f[c.checkedMode]=!0,_=s.call(this,...e)}))})),!n)throw(0,u.assertInvariants)(this,f),t}return(0,u.assertInvariants)(this,f),_}}s=new WeakMap,t.default=class{constructor(e){this.Class=e,s.set(this,void 0),this.contractsChecked=!1;const t=this.Class.prototype;n(this,s,Reflect.ownKeys(t).filter((e=>"constructor"!=e&&e!==c.innerContract)).map((e=>new u.Feature(this,e,Object.getOwnPropertyDescriptor(t,e)))),"f")}get features(){return[...a(this,s,"f")]}get ParentClass(){var e;return null===(e=Object.getPrototypeOf(this.Class.prototype))||void 0===e?void 0:e.constructor}get parentRegistration(){return null==this.ParentClass?null:u.CLASS_REGISTRY.getOrCreate(this.ParentClass)}ancestry(){if(null==this.ParentClass)return[];{const e=u.CLASS_REGISTRY.getOrCreate(this.ParentClass);return[e,...e.ancestry()]}}ancestryFeatures(){return this.ancestry().flatMap((({features:e})=>e))}bindContract(e){if(this.contract=e,!e[c.checkedMode])return;const t=this.Class.prototype;this.features.forEach((e=>{const{name:r,hasGetter:s,hasSetter:n,isMethod:a}=e;Object.defineProperty(t,r,Object.assign(Object.assign(Object.assign({enumerable:!0},s?{get:d(r,e.getter,this)}:{}),n?{set:d(r,e.setter,this)}:{}),a?{value:d(r,e.value,this)}:{})),e.descriptor=Object.getOwnPropertyDescriptor(t,r)}))}checkOverrides(){const e=new Set(this.ancestryFeatures().map((({name:e})=>e)));this.features.forEach((({name:t,hasOverrides:r})=>{const s=`${this.Class.name}.prototype.${String(t)}`;(0,c.assert)(!r||e.has(t),`Unnecessary @override declaration on ${s}`),(0,c.assert)(r||!e.has(t),`@override decorator missing on ${s}`)}))}findFeature(e){var t,r;return null!==(t=this.features.find((({name:t})=>t===e)))&&void 0!==t?t:null===(r=this.parentRegistration)||void 0===r?void 0:r.findFeature(e)}}},950:function(e,t){var r,s,n=this&&this.__classPrivateFieldSet||function(e,t,r,s,n){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?n.call(e,r):n?n.value=r:t.set(e,r),r},a=this&&this.__classPrivateFieldGet||function(e,t,r,s){if("a"===r&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?s:"a"===r?s.call(e):s?s.value:t.get(e)};Object.defineProperty(t,"__esModule",{value:!0}),r=new WeakMap,s=new WeakMap,t.default=class{constructor(e,t,a){this.classRegistration=e,this.name=t,r.set(this,void 0),s.set(this,void 0),this.hasOverrides=!1,n(this,r,a,"f")}get ancestorFeature(){return this.classRegistration.ancestryFeatures().filter((e=>e.name===this.name))[0]}get getter(){return a(this,r,"f").get}get hasGetter(){return this.isAccessor&&null!=a(this,r,"f").get}get hasSetter(){return this.isAccessor&&null!=a(this,r,"f").set}get isProperty(){return"function"!=typeof a(this,r,"f").value&&void 0!==a(this,r,"f").value}get isMethod(){return"function"==typeof a(this,r,"f").value}get isAccessor(){return void 0===a(this,r,"f").value}get memberType(){return this.isMethod?"method":this.isProperty?"property":"accessor"}get setter(){return a(this,r,"f").set}get value(){return a(this,r,"f").value}get overriddenOriginalDescriptor(){return a(this,s,"f")}set overriddenOriginalDescriptor(e){n(this,s,e,"f")}get descriptor(){return a(this,r,"f")}set descriptor(e){n(this,r,e,"f")}}},357:function(e,t,r){var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(822),a=r(607),o=s(r(71));t.default=function e(t,r,s,i,c){var u;let l=!0;const d=null===(u=Reflect.get(r.assertions,i))||void 0===u?void 0:u.demands,f=`demands not met on ${s}.prototype.${String(i)}\r\n${d}`;r[a.checkedMode]&&d&&(0,o.default)(r,(()=>l=d.call(t,t,...c))),r[n.extend]&&!l?e(t,r[n.extend],s,i,c):(0,a.assert)(l,f)}},318:function(e,t,r){var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(822),a=r(607),o=s(r(71));t.default=function e(t,r,s,i,c,u){var l;const d=null===(l=Reflect.get(r.assertions,i))||void 0===l?void 0:l.ensures,f=`ensures not met on ${s}.prototype.${String(i)}\r\n${d}`;r[a.checkedMode]&&d&&(0,o.default)(r,(()=>(0,a.assert)(d.call(t,t,c,...u),f))),r[n.extend]&&e(t,r[n.extend],s,i,c,u)}},732:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const s=r(915),n=r(607);t.default=function e(t,r){r[n.checkedMode]&&(0,s.unChecked)(r,(()=>{const e=r[n.invariant];(0,n.assert)(e.call(t,t),`Invariant violated. ${e.toString()}`)})),r[n.extend]&&e(t,r[n.extend])}},963:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t){for(const[,r]of Object.entries(t))null!=r&&"object"==typeof r&&e(r);Object.freeze(t)}},915:function(e,t,r){var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.unChecked=t.takeWhile=t.fnTrue=t.Feature=t.deepFreeze=t.ClassRegistration=t.CLASS_REGISTRY=t.assertInvariants=t.assertEnsures=t.assertDemands=void 0;const n=s(r(357));t.assertDemands=n.default;const a=s(r(318));t.assertEnsures=a.default;const o=s(r(732));t.assertInvariants=o.default;const i=s(r(932));t.CLASS_REGISTRY=i.default;const c=s(r(359));t.ClassRegistration=c.default;const u=s(r(963));t.deepFreeze=u.default;const l=s(r(950));t.Feature=l.default;const d=s(r(638));t.takeWhile=d.default;const f=s(r(71));t.unChecked=f.default,t.fnTrue=()=>!0},638:(e,t)=>{function r(e,t){return e.length&&t(e[0])?[e[0],...r(e.slice(1),t)]:[]}Object.defineProperty(t,"__esModule",{value:!0}),t.takeWhile=void 0,t.takeWhile=r,t.default=r},71:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const s=r(607);t.default=(e,t)=>{try{e[s.checkedMode]=!1,t()}finally{e[s.checkedMode]=!0}}},47:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const s=r(607),n=r(860),a=r(915),o=r(879);t.default=function(e,t,r){const i=e.constructor,c="function"==typeof e;(0,s.assert)(!c,n.MSG_NO_STATIC,TypeError);const u=a.CLASS_REGISTRY.getOrCreate(i),l=u.findFeature(t);(0,s.assert)(null!=l,`${n.MSG_MISSING_FEATURE}: ${u.Class.name}.prototype.${String(t)}`);const d=l.ancestorFeature;if((0,s.assert)(null!=d&&l.memberType===d.memberType,`${n.MSG_NO_MATCHING_FEATURE} '${u.Class.name}.prototype.${String(t)}'`),(0,s.assert)(!l.hasOverrides,n.MSG_DUPLICATE_OVERRIDE),l.hasOverrides=!0,l.isMethod){const e=l.value,t=d.value;(0,s.assert)(e.length==t.length,n.MSG_INVALID_ARG_LENGTH)}return l.overriddenOriginalDescriptor=r,Object.assign(Object.assign(Object.assign(Object.assign({enumerable:!0,configurable:!0},l.isAccessor?{}:{writable:!0}),l.hasGetter?{get(){(0,s.assert)(this.constructor[o.isContracted],n.MSG_NOT_CONTRACTED)}}:{}),l.hasSetter?{set(e){(0,s.assert)(this.constructor[o.isContracted],n.MSG_NOT_CONTRACTED)}}:{}),l.isMethod?{value(){(0,s.assert)(this.constructor[o.isContracted],n.MSG_NOT_CONTRACTED)}}:{})}}},t={};return function r(s){var n=t[s];if(void 0!==n)return n.exports;var a=t[s]={exports:{}};return e[s].call(a.exports,a,a.exports,r),a.exports}(607)})()));
3
- //# sourceMappingURL=index.js.map
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","mappings":";CAAA,SAA2CA,EAAMC,GAChD,GAAsB,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,SACb,GAAqB,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,OACP,CACJ,IAAIK,EAAIL,IACR,IAAI,IAAIM,KAAKD,GAAuB,iBAAZJ,QAAuBA,QAAUF,GAAMO,GAAKD,EAAEC,EACvE,CACA,CATD,CASGC,MAAM,2FCCT,MAAMC,UAAuBC,MAMzBC,YAAYC,GACRC,MAAMD,EACV,EAGJ,UAAeH,61BCdf,eAEMK,EAAcC,OAAO,eACrBC,EAAYD,OAAO,aACnBE,EAASF,OAAO,UAk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,EAAUR,OAAQ,EAAApF,wBAMlD,OAHAsD,EAAQkB,6BAA+BZ,EAGhC,OAAP,kDACIH,YAAY,EACZoC,cAAc,GACTvC,EAAQe,WAAgC,CAAC,EAApB,CAACyB,UAAU,IACjCxC,EAAQpB,UAAY,CAACvC,OAAO,IAAA7B,QAAQ9B,KAAKG,YAAoB,EAAAuB,cAAe,EAAA0C,mBAAqB,GAAM,CAAC,GACxGkD,EAAQC,UAAY,CAACpC,IAAI4E,IAAI,IAAAjI,QAAQ9B,KAAKG,YAAoB,EAAAuB,cAAe,EAAA0C,mBAAqB,GAAM,CAAC,GACzGkD,EAAQE,SAAW,CAACpG,SAAS,IAAAU,QAAQ9B,KAAKG,YAAoB,EAAAuB,cAAe,EAAA0C,mBAAqB,GAAM,CAAC,EAErH,ICzDI4F,EAA2B,CAAC,SAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqB5B,IAAjB6B,EACH,OAAOA,EAAazK,QAGrB,IAAIC,EAASqK,EAAyBE,GAAY,CAGjDxK,QAAS,CAAC,GAOX,OAHA0K,EAAoBF,GAAUzD,KAAK9G,EAAOD,QAASC,EAAQA,EAAOD,QAASuK,GAGpEtK,EAAOD,OACf,CCnB0BuK,CAAoB","sources":["webpack://@final-hill/decorator-contracts/webpack/universalModuleDefinition","webpack://@final-hill/decorator-contracts/./src/AssertionError.ts","webpack://@final-hill/decorator-contracts/./src/Contract.ts","webpack://@final-hill/decorator-contracts/./src/Contracted.ts","webpack://@final-hill/decorator-contracts/./src/Messages.ts","webpack://@final-hill/decorator-contracts/./src/assert.ts","webpack://@final-hill/decorator-contracts/./src/implies.ts","webpack://@final-hill/decorator-contracts/./src/index.ts","webpack://@final-hill/decorator-contracts/./src/lib/CLASS_REGISTRY.ts","webpack://@final-hill/decorator-contracts/./src/lib/ClassRegistration.ts","webpack://@final-hill/decorator-contracts/./src/lib/Feature.ts","webpack://@final-hill/decorator-contracts/./src/lib/assertDemands.ts","webpack://@final-hill/decorator-contracts/./src/lib/assertEnsures.ts","webpack://@final-hill/decorator-contracts/./src/lib/assertInvariants.ts","webpack://@final-hill/decorator-contracts/./src/lib/deepFreeze.ts","webpack://@final-hill/decorator-contracts/./src/lib/index.ts","webpack://@final-hill/decorator-contracts/./src/lib/takeWhile.ts","webpack://@final-hill/decorator-contracts/./src/lib/unChecked.ts","webpack://@final-hill/decorator-contracts/./src/override.ts","webpack://@final-hill/decorator-contracts/webpack/bootstrap","webpack://@final-hill/decorator-contracts/webpack/startup"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse {\n\t\tvar a = factory();\n\t\tfor(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];\n\t}\n})(this, () => {\nreturn ","/*!\r\n * @license\r\n * Copyright (C) 2022 Final Hill LLC\r\n * SPDX-License-Identifier: AGPL-3.0-only\r\n * @see <https://spdx.org/licenses/AGPL-3.0-only.html>\r\n */\r\n\r\n/**\r\n * An AssertionError represents a failed assertion with an associated message\r\n */\r\nclass AssertionError extends Error {\r\n /**\r\n * Constructs a new instance of AssertionError\r\n *\r\n * @param {string} message - The associated message\r\n */\r\n constructor(message: string) {\r\n super(message);\r\n }\r\n}\r\n\r\nexport default AssertionError;","/*!\r\n * @license\r\n * Copyright (C) 2022 Final Hill LLC\r\n * SPDX-License-Identifier: AGPL-3.0-only\r\n * @see <https://spdx.org/licenses/AGPL-3.0-only.html>\r\n */\r\n\r\nimport {deepFreeze, fnTrue} from './lib';\r\n\r\nconst checkedMode = Symbol('checkedMode'),\r\n invariant = Symbol('invariant'),\r\n extend = Symbol('extend');\r\n\r\ntype AnyObject = Record<PropertyKey, any>;\r\ntype AnyFunc = (...args: any[]) => any;\r\n\r\ntype NonFunctionPropertyNames<T extends AnyObject> = { [K in keyof T]: T[K] extends AnyFunc ? never : K }[keyof T];\r\ntype Properties<T extends AnyObject> = Pick<T, NonFunctionPropertyNames<T>>;\r\n\r\nexport type Invariant<T extends AnyObject> = (self: T) => boolean;\r\nexport type Demands<T extends AnyObject, F extends T[any]> = (self: T, ...args: Parameters<F>) => boolean;\r\nexport type Ensures<T extends AnyObject, F extends T[any]> = (self: T, old: Properties<T>, ...args: Parameters<F>) => boolean;\r\nexport type Rescue<T extends AnyObject, F extends T[any]> = (\r\n self: T,\r\n error: Error,\r\n args: F extends AnyFunc ? Parameters<F> : [F],\r\n retry: F extends AnyFunc ? (...args: Parameters<F>) => any : (value: F) => void\r\n) => void;\r\n\r\nexport type ContractOptions<\r\n T extends AnyObject\r\n> = {\r\n [extend]: Contract<T>;\r\n [invariant]: Invariant<T>;\r\n [checkedMode]: boolean;\r\n} & {\r\n [K in keyof T]?: FeatureOption<T, T[K]>\r\n};\r\n\r\nexport interface FeatureOption<T extends AnyObject, F extends T[any]> {\r\n demands?: Demands<T,F>;\r\n ensures?: Ensures<T,F>;\r\n rescue?: Rescue<T,F>;\r\n within?: number;\r\n}\r\n\r\nexport class Contract<T extends AnyObject> {\r\n #invariant: Invariant<T>;\r\n [checkedMode]: boolean;\r\n readonly [extend]?: Contract<T>;\r\n readonly assertions: ContractOptions<T> = Object.create(null);\r\n\r\n constructor(assertions: Partial<ContractOptions<T>> = Object.create(null)) {\r\n this[extend] = assertions[extend];\r\n this[checkedMode] = assertions[checkedMode] ?? true;\r\n this.#invariant = assertions[invariant] ?? fnTrue;\r\n\r\n Object.keys(assertions).forEach(propertyKey => {\r\n const featureOption = assertions[propertyKey]!;\r\n Object.defineProperty(this.assertions,propertyKey, {\r\n value: {\r\n demands: featureOption.demands ?? fnTrue,\r\n ensures: featureOption.ensures ?? fnTrue,\r\n rescue: featureOption.rescue,\r\n within: featureOption.within\r\n }\r\n });\r\n });\r\n\r\n deepFreeze(this.assertions);\r\n }\r\n\r\n get [invariant](): Invariant<T> {\r\n return this.#invariant;\r\n }\r\n}\r\n\r\nexport {checkedMode, extend, invariant};","/*!\r\n * @license\r\n * Copyright (C) 2022 Final Hill LLC\r\n * SPDX-License-Identifier: AGPL-3.0-only\r\n * @see <https://spdx.org/licenses/AGPL-3.0-only.html>\r\n */\r\n\r\nimport { ClassRegistration, CLASS_REGISTRY, ClassType, Feature, takeWhile, assertInvariants } from './lib';\r\nimport { assert, checkedMode, Contract, extend } from './';\r\nimport { MSG_BAD_SUBCONTRACT, MSG_NO_PROPERTIES, MSG_SINGLE_CONTRACT } from './Messages';\r\n\r\nconst isContracted = Symbol('isContracted'),\r\n innerContract = Symbol('innerContract');\r\n\r\n/**\r\n * Checks the features of the provided object for properties.\r\n * If any are found an exception is thrown\r\n * @param {ClassRegistration} registration - The ClassRegistration for the object\r\n * @param {U} obj - The object to check\r\n * @throws {AssertionError} - Throws if a property is found\r\n * @returns {boolean} - The result of the test\r\n */\r\nfunction hasProperties<U>(registration: ClassRegistration, obj: U): boolean {\r\n return Object.entries(Object.getOwnPropertyDescriptors(obj))\r\n .some(([key, desc]) => new Feature(registration, key, desc).isProperty);\r\n}\r\n\r\n/**\r\n * Associates a contract with a class via the mixin pattern.\r\n *\r\n * @param {Contract} contract The Contract definition\r\n * @param {T} Base An optional base class\r\n * @returns {T} The base class for extension\r\n * @example\r\n *\r\n * @Contracted(stackContract)\r\n * class Stack<T> { ... }\r\n */\r\nfunction Contracted<\r\n T extends Contract<any> = Contract<any>,\r\n U extends ClassType<any> = ClassType<any>\r\n>(contract: T = new Contract() as T): ClassDecorator {\r\n return function (Base: U & { [innerContract]?: Contract<any> }) {\r\n assert(!Object.getOwnPropertySymbols(Base).includes(isContracted), MSG_SINGLE_CONTRACT);\r\n\r\n if (contract[checkedMode] === false) {\r\n return Base;\r\n }\r\n\r\n const baseContract = Base[innerContract];\r\n assert(\r\n !baseContract ||\r\n baseContract && contract[extend] instanceof baseContract.constructor,\r\n MSG_BAD_SUBCONTRACT\r\n );\r\n\r\n abstract class InnerContracted extends Base {\r\n // prevents multiple @Contracted decorators from being applied\r\n static readonly [isContracted] = true;\r\n\r\n constructor(...args: any[]) {\r\n super(...args);\r\n\r\n const Class = this.constructor as ClassType<any>,\r\n classRegistration = CLASS_REGISTRY.getOrCreate(Class);\r\n\r\n assert(!hasProperties(classRegistration, this), MSG_NO_PROPERTIES);\r\n\r\n if (!classRegistration.contractsChecked) {\r\n let ancRegistrations = classRegistration.ancestry().reverse();\r\n // top-down check overrides and pre-existing properties\r\n [...ancRegistrations, classRegistration].forEach(ancRegistration => {\r\n if (!ancRegistration.contractsChecked) {\r\n ancRegistration.checkOverrides();\r\n ancRegistration.contractsChecked = true;\r\n }\r\n });\r\n\r\n // bottom-up to closest Contracted class bind contracts\r\n ancRegistrations = takeWhile(ancRegistrations.reverse(), (cr => cr.Class !== Base));\r\n [classRegistration, ...ancRegistrations, CLASS_REGISTRY.get(Base)!].forEach(registration => {\r\n registration.bindContract(InnerContracted[innerContract]);\r\n });\r\n }\r\n\r\n assertInvariants(this, InnerContracted[innerContract]);\r\n\r\n return this;\r\n }\r\n\r\n // FIXME: dirty hack. Possibly resolved by moving to contracts as classes\r\n // The static getter is used by the construction invariant check\r\n // The instance getter is used by the feature declarations\r\n static get [innerContract]() { return contract; }\r\n get [innerContract]() { return contract; }\r\n }\r\n\r\n const classRegistration = CLASS_REGISTRY.getOrCreate(InnerContracted);\r\n classRegistration.contractsChecked = false;\r\n\r\n Object.freeze(Base);\r\n\r\n return InnerContracted;\r\n } as ClassDecorator;\r\n}\r\n\r\nexport { isContracted, innerContract };\r\nexport default Contracted;","/*!\r\n * @license\r\n * Copyright (C) 2022 Final Hill LLC\r\n * SPDX-License-Identifier: AGPL-3.0-only\r\n * @see <https://spdx.org/licenses/AGPL-3.0-only.html>\r\n */\r\n\r\nexport const ASSERTION_FAILED = 'Assertion failure';\r\nexport const MSG_INVALID_ARG_LENGTH = 'An overridden method must have the same number of parameters as its ancestor method';\r\nexport const MSG_NO_STATIC = 'Only instance members can be decorated, not static members';\r\nexport const MSG_NO_MATCHING_FEATURE = 'This feature does not override an ancestor feature.';\r\nexport const MSG_DUPLICATE_OVERRIDE = 'Only a single @override decorator can be assigned to a class member';\r\nexport const MSG_NO_PROPERTIES = 'Public properties are forbidden';\r\nexport const MSG_NOT_CONTRACTED = 'The current class or one of its ancestors must declare @Contracted(...)';\r\nexport const MSG_MISSING_FEATURE = 'The requested feature is not registered';\r\nexport const MSG_SINGLE_CONTRACT = 'Only a single @Contracted decorator is allowed per class';\r\nexport const MSG_SINGLE_RETRY = 'retry can only be called once';\r\nexport const MSG_INVALID_CONTEXT = 'A contracted feature can not be applied to objects of a different base class';\r\nexport const MSG_BAD_SUBCONTRACT = 'A sub contract must extend a base contract';","/*!\r\n * @license\r\n * Copyright (C) 2022 Final Hill LLC\r\n * SPDX-License-Identifier: AGPL-3.0-only\r\n * @see <https://spdx.org/licenses/AGPL-3.0-only.html>\r\n */\r\n\r\nimport AssertionError from './AssertionError';\r\nimport { ASSERTION_FAILED } from './Messages';\r\nimport { Constructor } from './';\r\n\r\n/**\r\n * An assertion is an expression of a property that must be true at a particular\r\n * point of step of program execution. It consists of a boolean expression\r\n * and a message. This function tests the provided condition. If the condition\r\n * is false an AssertionError is raised with an optional message.\r\n * If the provided condition is true then the function returns without raising an error\r\n *\r\n * @param {boolean} condition - The condition to test\r\n * @param {string} message - A descriptive message to associate with the AssertionError\r\n * @param {ClassType<Error>} ErrorConstructor - The constructor of the Error to use\r\n * @throws {Error} - When the condition is false\r\n * @see AssertionError\r\n * @throws {AssertionError} - Throws an AssertionError by default if the condition is false\r\n *\r\n * @example\r\n * let x = 15;\r\n * assert(x > 5, `Expected: x > 5. Actual: x = ${x}`)\r\n *\r\n * @example\r\n * let name = \"Tom\"\r\n * assert(name.trim().length > 0, 'Name is required', TypeError)\r\n */\r\nexport default function assert(condition: unknown, message = ASSERTION_FAILED, ErrorConstructor: Constructor<Error> = AssertionError): asserts condition {\r\n if (Boolean(condition) == false) {\r\n throw new ErrorConstructor(message);\r\n }\r\n}","/*!\r\n * @license\r\n * Copyright (C) 2022 Final Hill LLC\r\n * SPDX-License-Identifier: AGPL-3.0-only\r\n * @see <https://spdx.org/licenses/AGPL-3.0-only.html>\r\n */\r\n\r\n/**\r\n * Material Implication.\r\n * `p → q`\r\n * Also referred to as `if-then`.\r\n * An example of usage is the encoding of \"sunny weather is a precondition of visiting the beach\"\r\n * This is logically equivalent to: !p || q\r\n *\r\n * @example\r\n * implies(weather.isSunny, person.visitsBeach)\r\n *\r\n * @param {boolean} p - The antecedent\r\n * @param {boolean} q - The consequent\r\n * @returns {boolean} - The result\r\n */\r\nexport default function implies(p: boolean, q: boolean): boolean {\r\n return !p || q;\r\n}","/*!\r\n * @license\r\n * Copyright (C) 2022 Final Hill LLC\r\n * SPDX-License-Identifier: AGPL-3.0-only\r\n * @see <https://spdx.org/licenses/AGPL-3.0-only.html>\r\n */\r\n\r\nimport AssertionError from './AssertionError';\r\nimport Contracted, { innerContract } from './Contracted';\r\nimport override from './override';\r\nimport assert from './assert';\r\nimport implies from './implies';\r\n\r\nexport { AssertionError, Contracted, implies, innerContract, override, assert };\r\nexport { Contract, extend, invariant, Invariant, checkedMode, Rescue } from './Contract';\r\nexport { Constructor, AbstractConstructor, ClassType } from './lib/ClassType';","/*!\r\n * @license\r\n * Copyright (C) 2022 Final Hill LLC\r\n * SPDX-License-Identifier: AGPL-3.0-only\r\n * @see <https://spdx.org/licenses/AGPL-3.0-only.html>\r\n */\r\n\r\nimport {ClassRegistration, ClassType} from './';\r\n\r\n/**\r\n * A WeakMap that tracks class registrations.\r\n * @see {@link ClassRegistration}\r\n */\r\nclass ClassRegistry extends WeakMap<ClassType<any>, ClassRegistration> {\r\n /**\r\n * Returns the class registry defined for the current class.\r\n * If the registry is undefined, a new one is created\r\n *\r\n * @param {ClassType<any>} Class - The class\r\n * @returns {ClassRegistration} - The ClassRegistration\r\n */\r\n getOrCreate(Class: ClassType<any>): ClassRegistration {\r\n if(this.has(Class)) {\r\n return this.get(Class)!;\r\n } else {\r\n this.set(Class, new ClassRegistration(Class));\r\n\r\n return this.get(Class)!;\r\n }\r\n }\r\n}\r\n\r\nconst CLASS_REGISTRY = new ClassRegistry();\r\n\r\nexport default CLASS_REGISTRY;","/*!\r\n * @license\r\n * Copyright (C) 2022 Final Hill LLC\r\n * SPDX-License-Identifier: AGPL-3.0-only\r\n * @see <https://spdx.org/licenses/AGPL-3.0-only.html>\r\n */\r\n\r\nimport { MSG_INVALID_CONTEXT, MSG_SINGLE_RETRY } from '../Messages';\r\nimport { assert, checkedMode, Contract, innerContract } from '../';\r\nimport { assertInvariants, assertDemands, CLASS_REGISTRY, ClassType, Feature, unChecked } from './';\r\nimport assertEnsures from './assertEnsures';\r\n\r\n/**\r\n * Manages the evaluation of contract assertions for a feature\r\n *\r\n * @param {string} featureName - The name of the feature\r\n * @param {function(...args: any[]): any} fnOrig - The original unchecked feature\r\n * @param {ClassRegistration} registration - The class registration\r\n *\r\n * @returns {function(...args: any[]): any} - The original function augments with assertion checks\r\n */\r\nfunction checkedFeature(\r\n featureName: PropertyKey,\r\n fnOrig: (...args: any[]) => any,\r\n registration: ClassRegistration\r\n) {\r\n return function innerCheckedFeature(this: any, ...args: any[]) {\r\n const { Class } = registration;\r\n\r\n assert(this instanceof Class, MSG_INVALID_CONTEXT);\r\n\r\n const contract = Reflect.get(this, innerContract),\r\n className = Class.name;\r\n if (!contract[checkedMode]) {\r\n return fnOrig.apply(this, args);\r\n }\r\n\r\n assertInvariants(this, contract);\r\n assertDemands(this, contract, className, featureName, args);\r\n\r\n let result;\r\n try {\r\n const old = Object.create(null);\r\n unChecked(contract, () => {\r\n registration.features.forEach(({ name, hasGetter }) => {\r\n if (hasGetter) {\r\n Object.defineProperty(old, name, { value: this[name] });\r\n }\r\n });\r\n });\r\n const within: number = Reflect.get(contract.assertions, featureName)?.within,\r\n // TODO:Not all environments currently support performance.now() as a global and conditional import is inconvenient\r\n t0 = Date.now();\r\n result = fnOrig.apply(this, args);\r\n const t1 = Date.now();\r\n if (within) {\r\n assert(t1 - t0 < within,\r\n `Timing constraint violated. Constraint: ${within}ms, actual: ${t1 - t0}ms`\r\n );\r\n }\r\n assertEnsures(this, contract, className, featureName, old, args);\r\n } catch (error) {\r\n const rescue = Reflect.get(contract.assertions, featureName)?.rescue;\r\n if (rescue == null) {\r\n assertInvariants(this, contract);\r\n throw error;\r\n }\r\n let hasRetried = false;\r\n unChecked(contract, () => {\r\n rescue.call(this, this, error, [], (...args: any[]) => {\r\n assert(!hasRetried, MSG_SINGLE_RETRY);\r\n hasRetried = true;\r\n contract[checkedMode] = true;\r\n result = innerCheckedFeature.call(this, ...args);\r\n });\r\n });\r\n if (!hasRetried) {\r\n assertInvariants(this, contract);\r\n throw error;\r\n }\r\n }\r\n\r\n assertInvariants(this, contract);\r\n\r\n return result;\r\n };\r\n}\r\n\r\nclass ClassRegistration {\r\n #features: Feature[];\r\n contract!: Contract<any>; // Assigned by the Contracted class via this.bindContract\r\n contractsChecked = false;\r\n\r\n constructor(readonly Class: ClassType<any>) {\r\n const proto = this.Class.prototype;\r\n this.#features =\r\n Reflect.ownKeys(proto)\r\n .filter(key => key != 'constructor' && key !== innerContract)\r\n .map(key => new Feature(this, key, Object.getOwnPropertyDescriptor(proto, key)!));\r\n }\r\n\r\n /**\r\n * Returns the features associated with the registered class.\r\n *\r\n * @returns {Set<Feature>} The set of features\r\n */\r\n get features(): Feature[] {\r\n return [...this.#features];\r\n }\r\n\r\n /**\r\n * Returns a reference to the parent class\r\n */\r\n get ParentClass(): ClassType<any> | null {\r\n return Object.getPrototypeOf(this.Class.prototype)?.constructor;\r\n }\r\n\r\n /**\r\n * Returns the classRegistration of the parent class\r\n */\r\n get parentRegistration(): ClassRegistration | null {\r\n return this.ParentClass == null ? null : CLASS_REGISTRY.getOrCreate(this.ParentClass);\r\n }\r\n\r\n /**\r\n * Returns the registered class's ancestor class registrations.\r\n * Does not include the current class.\r\n *\r\n * @returns {ClassRegistration[]} - The ancestor class registrations\r\n */\r\n ancestry(): ClassRegistration[] {\r\n if (this.ParentClass == null) {\r\n return [];\r\n } else {\r\n const parentRegistry = CLASS_REGISTRY.getOrCreate(this.ParentClass);\r\n\r\n return [parentRegistry, ...parentRegistry.ancestry()];\r\n }\r\n }\r\n\r\n /**\r\n * Returns the features associated with the registered class's ancestors.\r\n * Does not include the current class.\r\n *\r\n * @returns {Feature[]} - The feature names\r\n */\r\n ancestryFeatures(): Feature[] {\r\n return this.ancestry().flatMap(({ features }) => features);\r\n }\r\n\r\n bindContract<T extends Contract<any>>(contract: T) {\r\n this.contract = contract;\r\n if (!contract[checkedMode]) {\r\n return;\r\n }\r\n const proto = this.Class.prototype;\r\n this.features.forEach(feature => {\r\n const { name, hasGetter, hasSetter, isMethod } = feature;\r\n\r\n Object.defineProperty(proto, name, {\r\n enumerable: true,\r\n ...(hasGetter ? { get: checkedFeature(name, feature.getter!, this) } : {}),\r\n ...(hasSetter ? { set: checkedFeature(name, feature.setter!, this) } : {}),\r\n ...(isMethod ? { value: checkedFeature(name, feature.value, this) } : {})\r\n });\r\n\r\n feature.descriptor = Object.getOwnPropertyDescriptor(proto, name)!;\r\n });\r\n }\r\n\r\n /**\r\n * Checks the features of the registered class for missing override decorators\r\n * @throws {AssertionError} - Throws if the verification fails\r\n */\r\n checkOverrides(): void {\r\n const ancestryFeatureNames = new Set(this.ancestryFeatures().map(({ name }) => name));\r\n this.features.forEach(({ name, hasOverrides }) => {\r\n const str = `${this.Class.name}.prototype.${String(name)}`;\r\n assert(!hasOverrides || ancestryFeatureNames.has(name), `Unnecessary @override declaration on ${str}`);\r\n assert(hasOverrides || !ancestryFeatureNames.has(name), `@override decorator missing on ${str}`);\r\n });\r\n }\r\n\r\n /**\r\n * Searches the current class and its ancestors for the nearest feature\r\n * matching the provided propertyKey.\r\n *\r\n * @param {PropertyKey} propertyKey - The key being searched\r\n * @returns {Feature | undefined} - The feature if it exists else otherwise\r\n */\r\n findFeature(propertyKey: PropertyKey): Feature | undefined {\r\n return this.features.find(({ name }) => name === propertyKey) ??\r\n this.parentRegistration?.findFeature(propertyKey);\r\n }\r\n}\r\n\r\nexport default ClassRegistration;","/*!\r\n * @license\r\n * Copyright (C) 2022 Final Hill LLC\r\n * SPDX-License-Identifier: AGPL-3.0-only\r\n * @see <https://spdx.org/licenses/AGPL-3.0-only.html>\r\n */\r\n\r\nimport ClassRegistration from './ClassRegistration';\r\n\r\nclass Feature {\r\n #descriptor: PropertyDescriptor;\r\n #overriddenOriginalDescriptor: PropertyDescriptor | undefined;\r\n\r\n /**\r\n * Does the current feature have an `@override` declaration?\r\n */\r\n hasOverrides = false;\r\n\r\n constructor(readonly classRegistration: ClassRegistration, readonly name: PropertyKey, descriptor: PropertyDescriptor){\r\n this.#descriptor = descriptor;\r\n }\r\n\r\n /**\r\n * Finds the nearest ancestor feature of the same key if it exists\r\n */\r\n get ancestorFeature(): Feature | null {\r\n return this.classRegistration.ancestryFeatures().filter(feature => feature.name === this.name)[0];\r\n }\r\n\r\n /**\r\n * Returns a reference to the getter if it exists\r\n */\r\n get getter() {\r\n return this.#descriptor.get;\r\n }\r\n\r\n /**\r\n * Determines if the feature is an accessor with a getter defined\r\n */\r\n get hasGetter(): boolean {\r\n return this.isAccessor && this.#descriptor.get != undefined;\r\n }\r\n\r\n /**\r\n * Determines if the feature is an accessor with a setter defined\r\n */\r\n get hasSetter(): boolean {\r\n return this.isAccessor && this.#descriptor.set != undefined;\r\n }\r\n\r\n /**\r\n * Determines if the feature is a property\r\n */\r\n get isProperty(): boolean {\r\n return typeof this.#descriptor.value != 'function' &&\r\n typeof this.#descriptor.value != 'undefined';\r\n }\r\n\r\n /**\r\n * Determines if the feature is a method\r\n */\r\n get isMethod(): boolean {\r\n return typeof this.#descriptor.value == 'function';\r\n }\r\n\r\n /**\r\n * Determines if the feature is an accessor\r\n */\r\n get isAccessor(): boolean {\r\n return typeof this.#descriptor.value == 'undefined';\r\n }\r\n\r\n /**\r\n * Returns a string representing the type of feature.\r\n * @returns {string} 'method' | 'property' | 'accessor'\r\n */\r\n get memberType(): 'method' | 'property' | 'accessor' {\r\n return this.isMethod ? 'method' :\r\n this.isProperty ? 'property' :\r\n 'accessor';\r\n }\r\n\r\n /**\r\n * Returns a reference to the setter if it exists\r\n */\r\n get setter() {\r\n return this.#descriptor.set;\r\n }\r\n\r\n /**\r\n * If the feature is a method, returns a reference to the implementation.\r\n * If the feature is a property, returns the value of the property\r\n * Otherwise returns undefined\r\n */\r\n get value(): any {\r\n return this.#descriptor.value;\r\n }\r\n\r\n /**\r\n * The original feature descriptor which was replaced by the `override` decorator\r\n */\r\n get overriddenOriginalDescriptor(): PropertyDescriptor| undefined {\r\n return this.#overriddenOriginalDescriptor;\r\n }\r\n set overriddenOriginalDescriptor(value: PropertyDescriptor | undefined) {\r\n this.#overriddenOriginalDescriptor = value;\r\n }\r\n\r\n /**\r\n * Returns a reference to the descriptor\r\n */\r\n get descriptor() {\r\n return this.#descriptor;\r\n }\r\n set descriptor(desc: PropertyDescriptor) {\r\n this.#descriptor = desc;\r\n }\r\n}\r\n\r\nexport default Feature;","/*!\r\n * @license\r\n * Copyright (C) 2022 Final Hill LLC\r\n * SPDX-License-Identifier: AGPL-3.0-only\r\n * @see <https://spdx.org/licenses/AGPL-3.0-only.html>\r\n */\r\n\r\nimport { Demands, extend } from '../Contract';\r\nimport { assert, checkedMode, Contract } from '../';\r\nimport unChecked from './unChecked';\r\n\r\n/**\r\n * Applies invariant assertions to the provided class instance\r\n *\r\n * @param {U} ctx - The context class\r\n * @param {Contract<any>} contract - The contract\r\n * @param {string} className - The name of the class\r\n * @param {PropertyKey} featureName - The name of the feature\r\n * @param {any[]} args - The arguments of the feature to apply to the assertion\r\n * @throws {AssertionError}\r\n */\r\nfunction assertDemands<U extends object>(ctx: U, contract: Contract<U>, className: string, featureName: PropertyKey, args: any[]) {\r\n let result = true;\r\n const d: Demands<any, any> | undefined = Reflect.get(contract.assertions, featureName)?.demands,\r\n demandsError = `demands not met on ${className}.prototype.${String(featureName)}\\r\\n${d}`;\r\n if (contract[checkedMode]) {\r\n if (d) {\r\n unChecked(contract, () =>\r\n result = d.call(ctx, ctx, ...args)\r\n );\r\n }\r\n }\r\n\r\n if (contract[extend] && !result) {\r\n assertDemands(ctx, contract[extend], className, featureName, args);\r\n } else {\r\n assert(result, demandsError);\r\n }\r\n}\r\n\r\nexport default assertDemands;","/*!\r\n * @license\r\n * Copyright (C) 2022 Final Hill LLC\r\n * SPDX-License-Identifier: AGPL-3.0-only\r\n * @see <https://spdx.org/licenses/AGPL-3.0-only.html>\r\n */\r\n\r\nimport { Ensures, extend } from '../Contract';\r\nimport { assert, checkedMode, Contract } from '../';\r\nimport unChecked from './unChecked';\r\n\r\n/**\r\n * Applies invariant assertions to the provided class instance\r\n *\r\n * @param {U} ctx - The context class\r\n * @param {Contract<any>} contract - The contract\r\n * @param {string} className - The name of the class\r\n * @param {PropertyKey} featureName - The name of the feature\r\n * @param {U} old - The original properties before execution\r\n * @param {any[]} args - The arguments of the feature to apply to the assertion\r\n * @throws {AssertionError}\r\n */\r\nfunction assertEnsures<U>(\r\n ctx: U,\r\n contract: Contract<any>,\r\n className: string,\r\n featureName: PropertyKey,\r\n old: U,\r\n args: any[]\r\n){\r\n const e: Ensures<any, any> | undefined = Reflect.get(contract.assertions, featureName)?.ensures,\r\n ensuresError = `ensures not met on ${className}.prototype.${String(featureName)}\\r\\n${e}`;\r\n\r\n if(contract[checkedMode]) {\r\n if(e) {\r\n unChecked(contract, () =>\r\n assert(e.call(ctx, ctx, old, ...args), ensuresError)\r\n );\r\n }\r\n }\r\n\r\n if(contract[extend]) {\r\n assertEnsures(ctx, contract[extend]!, className, featureName, old, args);\r\n }\r\n}\r\n\r\nexport default assertEnsures;","/*!\r\n * @license\r\n * Copyright (C) 2022 Final Hill LLC\r\n * SPDX-License-Identifier: AGPL-3.0-only\r\n * @see <https://spdx.org/licenses/AGPL-3.0-only.html>\r\n */\r\n\r\nimport { unChecked } from './';\r\nimport { assert, checkedMode, Contract, extend, invariant } from '../';\r\n\r\n/**\r\n * Applies invariant assertions to the provided class instance\r\n *\r\n * @param {U} ctx - The context class\r\n * @param {Contract<any>} contract - The contract\r\n * @throws {AssertionError}\r\n */\r\nfunction assertInvariants<U>(ctx: U, contract: Contract<any>) {\r\n if (contract[checkedMode]) {\r\n unChecked(contract, () => {\r\n const iv = contract[invariant];\r\n assert(iv.call(ctx, ctx), `Invariant violated. ${iv.toString()}`);\r\n });\r\n }\r\n\r\n if (contract[extend]) {\r\n assertInvariants(ctx, contract[extend]!);\r\n }\r\n}\r\n\r\nexport default assertInvariants;","/*!\r\n * @license\r\n * Copyright (C) 2022 Final Hill LLC\r\n * SPDX-License-Identifier: AGPL-3.0-only\r\n * @see <https://spdx.org/licenses/AGPL-3.0-only.html>\r\n */\r\n\r\n /**\r\n * Apply Object.freeze recursively\r\n * @param {object} object - The object to freeze\r\n */\r\nfunction deepFreeze(object: Record<PropertyKey, any>): void {\r\n // Freeze properties before freezing self\r\n for (const [,value] of Object.entries(object)) {\r\n if (value != undefined && typeof value === 'object') {\r\n deepFreeze(value);\r\n }\r\n }\r\n\r\n Object.freeze(object);\r\n}\r\n\r\nexport default deepFreeze;","/*!\r\n * @license\r\n * Copyright (C) 2022 Final Hill LLC\r\n * SPDX-License-Identifier: AGPL-3.0-only\r\n * @see <https://spdx.org/licenses/AGPL-3.0-only.html>\r\n */\r\n\r\nimport assertDemands from './assertDemands';\r\nimport assertEnsures from './assertEnsures';\r\nimport assertInvariants from './assertInvariants';\r\nimport CLASS_REGISTRY from './CLASS_REGISTRY';\r\nimport ClassRegistration from './ClassRegistration';\r\nimport {ClassType} from './ClassType';\r\nimport deepFreeze from './deepFreeze';\r\nimport Feature from './Feature';\r\nimport takeWhile from './takeWhile';\r\nimport unChecked from './unChecked';\r\n\r\nconst fnTrue = () => true;\r\n\r\nexport {\r\n assertDemands,\r\n assertEnsures,\r\n assertInvariants,\r\n CLASS_REGISTRY,\r\n ClassRegistration,\r\n ClassType,\r\n deepFreeze,\r\n Feature,\r\n fnTrue,\r\n takeWhile,\r\n unChecked\r\n};","/*!\r\n * @license\r\n * Copyright (C) 2022 Final Hill LLC\r\n * SPDX-License-Identifier: AGPL-3.0-only\r\n * @see <https://spdx.org/licenses/AGPL-3.0-only.html>\r\n */\r\n\r\n /**\r\n * Creates a new array from another one. Items from the original array\r\n * are taken if the provided predicate succeed. When the predicate fails,\r\n * no new items are taken\r\n *\r\n * @param {T[]} xs - The array to evaluate\r\n * @param {function(x:T): T[]} pred - The condition to apply to every element\r\n * @returns {T[]} - The filtered list\r\n */\r\nexport function takeWhile<T>(xs: T[], pred: (x: T) => boolean): T[] {\r\n return xs.length && pred(xs[0]) ? [xs[0], ...takeWhile(xs.slice(1), pred)] : [];\r\n}\r\n\r\nexport default takeWhile;","/*!\r\n * @license\r\n * Copyright (C) 2022 Final Hill LLC\r\n * SPDX-License-Identifier: AGPL-3.0-only\r\n * @see <https://spdx.org/licenses/AGPL-3.0-only.html>\r\n */\r\n\r\nimport { checkedMode, Contract } from '../';\r\n\r\n/**\r\n * Disable contract checking for the provided function\r\n * @param {Contract<any>} contract - The code contract\r\n * @param {function(...args: any[]): any} fn - The function to execute\r\n */\r\nconst unChecked = (contract: Contract<any>, fn: () => any) => {\r\n try {\r\n contract[checkedMode] = false;\r\n fn();\r\n } finally {\r\n contract[checkedMode] = true;\r\n }\r\n};\r\n\r\nexport default unChecked;","/*!\r\n * @license\r\n * Copyright (C) 2022 Final Hill LLC\r\n * SPDX-License-Identifier: AGPL-3.0-only\r\n * @see <https://spdx.org/licenses/AGPL-3.0-only.html>\r\n */\r\n\r\nimport { assert } from './';\r\nimport { MSG_NO_STATIC, MSG_NO_MATCHING_FEATURE, MSG_DUPLICATE_OVERRIDE, MSG_INVALID_ARG_LENGTH, MSG_NOT_CONTRACTED, MSG_MISSING_FEATURE } from './Messages';\r\nimport { CLASS_REGISTRY } from './lib';\r\nimport { isContracted } from './Contracted';\r\n\r\n/**\r\n * The 'override' decorator asserts that the current class feature is a specialization or\r\n * replacement of an ancestor class's feature of the same name and argument count\r\n *\r\n * @param {object} target - The class\r\n * @param {PropertyKey} propertyKey - The property key\r\n * @param {PropertyDescriptor} descriptor - The property descriptor\r\n * @returns {PropertyDescriptor} - The PropertyDescriptor\r\n */\r\nfunction override(target: Record<PropertyKey, any>, propertyKey: PropertyKey, descriptor: PropertyDescriptor): PropertyDescriptor {\r\n const Class = (target as any).constructor,\r\n isStatic = typeof target == 'function';\r\n\r\n assert(!isStatic, MSG_NO_STATIC, TypeError);\r\n\r\n const registration = CLASS_REGISTRY.getOrCreate(Class),\r\n feature = registration.findFeature(propertyKey);\r\n\r\n assert(feature != null, `${MSG_MISSING_FEATURE}: ${registration.Class.name}.prototype.${String(propertyKey)}`);\r\n\r\n const ancFeature = feature.ancestorFeature;\r\n\r\n assert(\r\n ancFeature != null && feature.memberType === ancFeature.memberType,\r\n `${MSG_NO_MATCHING_FEATURE} '${registration.Class.name}.prototype.${String(propertyKey)}'`\r\n );\r\n assert(!feature.hasOverrides, MSG_DUPLICATE_OVERRIDE);\r\n feature.hasOverrides = true;\r\n\r\n if(feature.isMethod) {\r\n const thisMethod: (...args: any[]) => any = feature.value,\r\n ancMethod: (...args: any[]) => any = ancFeature.value;\r\n assert(thisMethod.length == ancMethod.length, MSG_INVALID_ARG_LENGTH);\r\n }\r\n\r\n feature.overriddenOriginalDescriptor = descriptor;\r\n\r\n // method decorators are evaluated before class decorators\r\n return {\r\n enumerable: true,\r\n configurable: true,\r\n ...(!feature.isAccessor ? {writable: true} : {}),\r\n ...(feature.hasGetter ? {get(){ assert((this.constructor as any)[isContracted], MSG_NOT_CONTRACTED); } } : {}),\r\n ...(feature.hasSetter ? {set(_){ assert((this.constructor as any)[isContracted], MSG_NOT_CONTRACTED); } } : {}),\r\n ...(feature.isMethod ? {value() {assert((this.constructor as any)[isContracted], MSG_NOT_CONTRACTED); } } : {})\r\n };\r\n}\r\n\r\nexport default override;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(607);\n"],"names":["root","factory","exports","module","define","amd","a","i","this","AssertionError","Error","constructor","message","super","checkedMode","Symbol","invariant","extend","Contract","assertions","Object","create","fnTrue","keys","forEach","propertyKey","featureOption","defineProperty","value","demands","ensures","rescue","within","deepFreeze","isContracted","innerContract","contract","Base","assert","getOwnPropertySymbols","includes","MSG_SINGLE_CONTRACT","baseContract","MSG_BAD_SUBCONTRACT","InnerContracted","args","Class","classRegistration","CLASS_REGISTRY","getOrCreate","registration","entries","getOwnPropertyDescriptors","some","key","desc","Feature","isProperty","MSG_NO_PROPERTIES","contractsChecked","ancRegistrations","ancestry","reverse","ancRegistration","checkOverrides","takeWhile","cr","get","bindContract","assertInvariants","freeze","ASSERTION_FAILED","MSG_INVALID_ARG_LENGTH","MSG_NO_STATIC","MSG_NO_MATCHING_FEATURE","MSG_DUPLICATE_OVERRIDE","MSG_NOT_CONTRACTED","MSG_MISSING_FEATURE","MSG_SINGLE_RETRY","MSG_INVALID_CONTEXT","condition","ErrorConstructor","Boolean","p","q","Contracted","override","implies","ClassRegistry","WeakMap","has","set","ClassRegistration","checkedFeature","featureName","fnOrig","innerCheckedFeature","Reflect","className","name","apply","result","assertDemands","old","unChecked","features","hasGetter","t0","Date","now","t1","error","hasRetried","call","proto","prototype","ownKeys","filter","map","getOwnPropertyDescriptor","ParentClass","getPrototypeOf","parentRegistration","parentRegistry","ancestryFeatures","flatMap","feature","hasSetter","isMethod","enumerable","getter","setter","descriptor","ancestryFeatureNames","Set","hasOverrides","str","String","findFeature","find","ancestorFeature","isAccessor","undefined","memberType","overriddenOriginalDescriptor","ctx","d","demandsError","assertEnsures","e","ensuresError","iv","toString","object","xs","pred","length","slice","fn","target","isStatic","TypeError","ancFeature","thisMethod","ancMethod","configurable","writable","_","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__"],"sourceRoot":""}
@@ -1,10 +0,0 @@
1
- /*!
2
- * @license
3
- * Copyright (C) 2022 Final Hill LLC
4
- * SPDX-License-Identifier: AGPL-3.0-only
5
- * @see <https://spdx.org/licenses/AGPL-3.0-only.html>
6
- */
7
- declare type Constructor<T> = new (...args: any[]) => T;
8
- declare type AbstractConstructor<T> = abstract new (...args: any[]) => T;
9
- declare type ClassType<T> = Constructor<T> | AbstractConstructor<T>;
10
- export { Constructor, AbstractConstructor, ClassType };
@@ -1,9 +0,0 @@
1
- /*!
2
- * @license
3
- * Copyright (C) 2022 Final Hill LLC
4
- * SPDX-License-Identifier: AGPL-3.0-only
5
- * @see <https://spdx.org/licenses/AGPL-3.0-only.html>
6
- */
7
- import { Contract } from '../';
8
- declare function assertEnsures<U>(ctx: U, contract: Contract<any>, className: string, featureName: PropertyKey, old: U, args: any[]): void;
9
- export default assertEnsures;
@@ -1,18 +0,0 @@
1
- /*!
2
- * @license
3
- * Copyright (C) 2022 Final Hill LLC
4
- * SPDX-License-Identifier: AGPL-3.0-only
5
- * @see <https://spdx.org/licenses/AGPL-3.0-only.html>
6
- */
7
- import assertDemands from './assertDemands';
8
- import assertEnsures from './assertEnsures';
9
- import assertInvariants from './assertInvariants';
10
- import CLASS_REGISTRY from './CLASS_REGISTRY';
11
- import ClassRegistration from './ClassRegistration';
12
- import { ClassType } from './ClassType';
13
- import deepFreeze from './deepFreeze';
14
- import Feature from './Feature';
15
- import takeWhile from './takeWhile';
16
- import unChecked from './unChecked';
17
- declare const fnTrue: () => boolean;
18
- export { assertDemands, assertEnsures, assertInvariants, CLASS_REGISTRY, ClassRegistration, ClassType, deepFreeze, Feature, fnTrue, takeWhile, unChecked };
@@ -1,8 +0,0 @@
1
- /*!
2
- * @license
3
- * Copyright (C) 2022 Final Hill LLC
4
- * SPDX-License-Identifier: AGPL-3.0-only
5
- * @see <https://spdx.org/licenses/AGPL-3.0-only.html>
6
- */
7
- declare function override(target: Record<PropertyKey, any>, propertyKey: PropertyKey, descriptor: PropertyDescriptor): PropertyDescriptor;
8
- export default override;
@@ -1,7 +0,0 @@
1
- /*!
2
- * @license
3
- * Copyright (C) 2022 Final Hill LLC
4
- * SPDX-License-Identifier: AGPL-3.0-only
5
- * @see <https://spdx.org/licenses/AGPL-3.0-only.html>
6
- */
7
- export {};
@@ -1,7 +0,0 @@
1
- /*!
2
- * @license
3
- * Copyright (C) 2022 Final Hill LLC
4
- * SPDX-License-Identifier: AGPL-3.0-only
5
- * @see <https://spdx.org/licenses/AGPL-3.0-only.html>
6
- */
7
- export {};
@@ -1,7 +0,0 @@
1
- /*!
2
- * @license
3
- * Copyright (C) 2022 Final Hill LLC
4
- * SPDX-License-Identifier: AGPL-3.0-only
5
- * @see <https://spdx.org/licenses/AGPL-3.0-only.html>
6
- */
7
- export {};
@@ -1,7 +0,0 @@
1
- /*!
2
- * @license
3
- * Copyright (C) 2022 Final Hill LLC
4
- * SPDX-License-Identifier: AGPL-3.0-only
5
- * @see <https://spdx.org/licenses/AGPL-3.0-only.html>
6
- */
7
- export {};
@@ -1,7 +0,0 @@
1
- /*!
2
- * @license
3
- * Copyright (C) 2022 Final Hill LLC
4
- * SPDX-License-Identifier: AGPL-3.0-only
5
- * @see <https://spdx.org/licenses/AGPL-3.0-only.html>
6
- */
7
- export {};
@@ -1,7 +0,0 @@
1
- /*!
2
- * @license
3
- * Copyright (C) 2022 Final Hill LLC
4
- * SPDX-License-Identifier: AGPL-3.0-only
5
- * @see <https://spdx.org/licenses/AGPL-3.0-only.html>
6
- */
7
- export {};
@@ -1,7 +0,0 @@
1
- /*!
2
- * @license
3
- * Copyright (C) 2022 Final Hill LLC
4
- * SPDX-License-Identifier: AGPL-3.0-only
5
- * @see <https://spdx.org/licenses/AGPL-3.0-only.html>
6
- */
7
- export {};