@jonloucks/contracts-ts 0.4.0 → 1.0.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.
- package/api/AutoClose.d.ts +3 -3
- package/api/AutoClose.d.ts.map +1 -1
- package/api/AutoClose.js +17 -9
- package/api/AutoClose.js.map +1 -1
- package/api/AutoCloseFactory.d.ts +5 -3
- package/api/AutoCloseFactory.d.ts.map +1 -1
- package/api/AutoCloseFactory.js +14 -20
- package/api/AutoCloseFactory.js.map +1 -1
- package/api/AutoOpen.d.ts +3 -2
- package/api/AutoOpen.d.ts.map +1 -1
- package/api/AutoOpen.js +3 -3
- package/api/AutoOpen.js.map +1 -1
- package/api/BasicContract.d.ts +8 -2
- package/api/BasicContract.d.ts.map +1 -1
- package/api/BasicContract.js +35 -7
- package/api/BasicContract.js.map +1 -1
- package/api/BindStrategy.d.ts +1 -1
- package/api/BindStrategy.d.ts.map +1 -1
- package/api/BindStrategy.js +2 -2
- package/api/BindStrategy.js.map +1 -1
- package/api/Contract.d.ts +21 -12
- package/api/Contract.d.ts.map +1 -1
- package/api/Contract.js +11 -0
- package/api/Contract.js.map +1 -1
- package/api/ContractException.d.ts +7 -0
- package/api/ContractException.d.ts.map +1 -1
- package/api/ContractException.js +11 -1
- package/api/ContractException.js.map +1 -1
- package/api/ContractFactory.d.ts +8 -1
- package/api/ContractFactory.d.ts.map +1 -1
- package/api/ContractFactory.js +11 -0
- package/api/ContractFactory.js.map +1 -1
- package/api/Contracts.d.ts +10 -3
- package/api/Contracts.d.ts.map +1 -1
- package/api/Contracts.js +12 -0
- package/api/Contracts.js.map +1 -1
- package/api/ContractsFactory.d.ts +8 -1
- package/api/ContractsFactory.d.ts.map +1 -1
- package/api/ContractsFactory.js +11 -0
- package/api/ContractsFactory.js.map +1 -1
- package/api/Open.d.ts +20 -0
- package/api/Open.d.ts.map +1 -0
- package/api/Open.js +14 -0
- package/api/Open.js.map +1 -0
- package/api/Promisor.d.ts +1 -6
- package/api/Promisor.d.ts.map +1 -1
- package/api/Promisor.js +5 -27
- package/api/Promisor.js.map +1 -1
- package/api/PromisorFactory.d.ts +5 -3
- package/api/PromisorFactory.d.ts.map +1 -1
- package/api/PromisorFactory.js +14 -20
- package/api/PromisorFactory.js.map +1 -1
- package/api/RatifiedContract.d.ts +2 -2
- package/api/RatifiedContract.d.ts.map +1 -1
- package/api/RatifiedContract.js +1 -4
- package/api/RatifiedContract.js.map +1 -1
- package/api/Repository.d.ts +8 -5
- package/api/Repository.d.ts.map +1 -1
- package/api/Repository.js +9 -20
- package/api/Repository.js.map +1 -1
- package/api/RepositoryFactory.d.ts +6 -4
- package/api/RepositoryFactory.d.ts.map +1 -1
- package/api/RepositoryFactory.js +13 -20
- package/api/RepositoryFactory.js.map +1 -1
- package/api/Types.d.ts +11 -66
- package/api/Types.d.ts.map +1 -1
- package/api/Types.js +14 -105
- package/api/Types.js.map +1 -1
- package/auxiliary/AtomicBoolean.d.ts +6 -3
- package/auxiliary/AtomicBoolean.d.ts.map +1 -1
- package/auxiliary/AtomicBoolean.js +8 -20
- package/auxiliary/AtomicBoolean.js.map +1 -1
- package/auxiliary/AtomicBooleanFactory.d.ts +6 -4
- package/auxiliary/AtomicBooleanFactory.d.ts.map +1 -1
- package/auxiliary/AtomicBooleanFactory.js +13 -20
- package/auxiliary/AtomicBooleanFactory.js.map +1 -1
- package/auxiliary/AtomicInteger.d.ts +6 -3
- package/auxiliary/AtomicInteger.d.ts.map +1 -1
- package/auxiliary/AtomicInteger.js +8 -20
- package/auxiliary/AtomicInteger.js.map +1 -1
- package/auxiliary/AtomicIntegerFactory.d.ts +6 -4
- package/auxiliary/AtomicIntegerFactory.d.ts.map +1 -1
- package/auxiliary/AtomicIntegerFactory.js +13 -20
- package/auxiliary/AtomicIntegerFactory.js.map +1 -1
- package/auxiliary/AtomicReference.d.ts +6 -4
- package/auxiliary/AtomicReference.d.ts.map +1 -1
- package/auxiliary/AtomicReference.js +8 -20
- package/auxiliary/AtomicReference.js.map +1 -1
- package/auxiliary/AtomicReferenceFactory.d.ts +6 -4
- package/auxiliary/AtomicReferenceFactory.d.ts.map +1 -1
- package/auxiliary/AtomicReferenceFactory.js +13 -20
- package/auxiliary/AtomicReferenceFactory.js.map +1 -1
- package/impl/AtomicBooleanFactory.impl.js +2 -2
- package/impl/AtomicBooleanFactory.impl.js.map +1 -1
- package/impl/AtomicIntegerFactory.impl.js +2 -2
- package/impl/AtomicIntegerFactory.impl.js.map +1 -1
- package/impl/AtomicReferenceFactory.impl.js +2 -2
- package/impl/AtomicReferenceFactory.impl.js.map +1 -1
- package/impl/ContractFactory.impl.js +2 -2
- package/impl/ContractFactory.impl.js.map +1 -1
- package/impl/Contracts.impl.d.ts.map +1 -1
- package/impl/Contracts.impl.js +7 -1
- package/impl/Contracts.impl.js.map +1 -1
- package/impl/ContractsFactory.impl.js +4 -4
- package/impl/ContractsFactory.impl.js.map +1 -1
- package/impl/ContractsWrapper.impl.d.ts.map +1 -1
- package/impl/ContractsWrapper.impl.js +3 -0
- package/impl/ContractsWrapper.impl.js.map +1 -1
- package/impl/Events.d.ts +2 -2
- package/impl/Events.d.ts.map +1 -1
- package/impl/Events.impl.d.ts.map +1 -1
- package/impl/Events.impl.js +3 -0
- package/impl/Events.impl.js.map +1 -1
- package/impl/LifeCyclePromisor.impl.js +2 -2
- package/impl/LifeCyclePromisor.impl.js.map +1 -1
- package/impl/Repository.impl.d.ts.map +1 -1
- package/impl/Repository.impl.js +7 -1
- package/impl/Repository.impl.js.map +1 -1
- package/impl/RepositoryFactory.impl.js +1 -1
- package/impl/RepositoryFactory.impl.js.map +1 -1
- package/index.d.ts +3 -3
- package/index.d.ts.map +1 -1
- package/index.js +7 -7
- package/index.js.map +1 -1
- package/package.json +3 -2
- package/version.d.ts.map +1 -1
- package/version.js +14 -8
- package/version.js.map +1 -1
- package/api/Lawyer.d.ts +0 -19
- package/api/Lawyer.d.ts.map +0 -1
- package/api/Lawyer.js +0 -3
- package/api/Lawyer.js.map +0 -1
- package/auxiliary/ClassCastException.d.ts +0 -8
- package/auxiliary/ClassCastException.d.ts.map +0 -1
- package/auxiliary/ClassCastException.js +0 -18
- package/auxiliary/ClassCastException.js.map +0 -1
package/index.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CONTRACTS = exports.createContractsFactory = exports.createContracts = exports.createContractFactory = exports.createContract = exports.
|
|
3
|
+
exports.CONTRACTS = exports.VERSION = exports.createContractsFactory = exports.createContracts = exports.createContractFactory = exports.createContract = exports.validateContracts = exports.isString = exports.isPresent = exports.isNumber = exports.isNotPresent = exports.hasFunctions = exports.REPOSITORY_FACTORY = exports.PROMISOR_FACTORY = exports.typeToPromisor = exports.ContractException = exports.DEFAULT_BIND_STRATEGY = exports.AUTO_CLOSE_FACTORY = exports.typeToAutoClose = void 0;
|
|
4
4
|
const Validate_1 = require("@jonloucks/contracts-ts/auxiliary/Validate");
|
|
5
|
+
const ContractsFactory_impl_1 = require("./impl/ContractsFactory.impl");
|
|
5
6
|
var AutoClose_1 = require("@jonloucks/contracts-ts/api/AutoClose");
|
|
6
7
|
Object.defineProperty(exports, "typeToAutoClose", { enumerable: true, get: function () { return AutoClose_1.typeToAutoClose; } });
|
|
7
8
|
var AutoCloseFactory_1 = require("@jonloucks/contracts-ts/api/AutoCloseFactory");
|
|
8
9
|
Object.defineProperty(exports, "AUTO_CLOSE_FACTORY", { enumerable: true, get: function () { return AutoCloseFactory_1.CONTRACT; } });
|
|
9
|
-
var Validate_2 = require("@jonloucks/contracts-ts/auxiliary/Validate");
|
|
10
|
-
Object.defineProperty(exports, "validateContracts", { enumerable: true, get: function () { return Validate_2.validateContracts; } });
|
|
11
10
|
var BindStrategy_1 = require("@jonloucks/contracts-ts/api/BindStrategy");
|
|
12
11
|
Object.defineProperty(exports, "DEFAULT_BIND_STRATEGY", { enumerable: true, get: function () { return BindStrategy_1.DEFAULT_BIND_STRATEGY; } });
|
|
13
12
|
var ContractException_1 = require("@jonloucks/contracts-ts/api/ContractException");
|
|
@@ -19,21 +18,22 @@ Object.defineProperty(exports, "PROMISOR_FACTORY", { enumerable: true, get: func
|
|
|
19
18
|
var RepositoryFactory_1 = require("@jonloucks/contracts-ts/api/RepositoryFactory");
|
|
20
19
|
Object.defineProperty(exports, "REPOSITORY_FACTORY", { enumerable: true, get: function () { return RepositoryFactory_1.CONTRACT; } });
|
|
21
20
|
var Types_1 = require("@jonloucks/contracts-ts/api/Types");
|
|
22
|
-
Object.defineProperty(exports, "hasFunctions", { enumerable: true, get: function () { return Types_1.
|
|
21
|
+
Object.defineProperty(exports, "hasFunctions", { enumerable: true, get: function () { return Types_1.guardFunctions; } });
|
|
23
22
|
Object.defineProperty(exports, "isNotPresent", { enumerable: true, get: function () { return Types_1.isNotPresent; } });
|
|
24
23
|
Object.defineProperty(exports, "isNumber", { enumerable: true, get: function () { return Types_1.isNumber; } });
|
|
25
24
|
Object.defineProperty(exports, "isPresent", { enumerable: true, get: function () { return Types_1.isPresent; } });
|
|
26
25
|
Object.defineProperty(exports, "isString", { enumerable: true, get: function () { return Types_1.isString; } });
|
|
26
|
+
var Validate_2 = require("@jonloucks/contracts-ts/auxiliary/Validate");
|
|
27
|
+
Object.defineProperty(exports, "validateContracts", { enumerable: true, get: function () { return Validate_2.validateContracts; } });
|
|
27
28
|
// no qualified paths for things not exposed publicly
|
|
28
|
-
var version_1 = require("./version");
|
|
29
|
-
Object.defineProperty(exports, "VERSION", { enumerable: true, get: function () { return version_1.VERSION; } });
|
|
30
|
-
const ContractsFactory_impl_1 = require("./impl/ContractsFactory.impl");
|
|
31
29
|
var ContractFactory_impl_1 = require("./impl/ContractFactory.impl");
|
|
32
30
|
Object.defineProperty(exports, "createContract", { enumerable: true, get: function () { return ContractFactory_impl_1.createContract; } });
|
|
33
31
|
Object.defineProperty(exports, "createContractFactory", { enumerable: true, get: function () { return ContractFactory_impl_1.create; } });
|
|
34
32
|
var ContractsFactory_impl_2 = require("./impl/ContractsFactory.impl");
|
|
35
33
|
Object.defineProperty(exports, "createContracts", { enumerable: true, get: function () { return ContractsFactory_impl_2.createContracts; } });
|
|
36
34
|
Object.defineProperty(exports, "createContractsFactory", { enumerable: true, get: function () { return ContractsFactory_impl_2.create; } });
|
|
35
|
+
var version_1 = require("./version");
|
|
36
|
+
Object.defineProperty(exports, "VERSION", { enumerable: true, get: function () { return version_1.VERSION; } });
|
|
37
37
|
/**
|
|
38
38
|
* A shared global Contracts instance.
|
|
39
39
|
*
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AACA,yEAA+E;AAC/E,wEAA+D;AAE/D,mEAA+H;AAA/D,4GAAA,eAAe,OAAA;AAC/E,iFAAgH;AAAvG,sHAAA,QAAQ,OAAsB;AAEvC,yEAA+F;AAAxE,qHAAA,qBAAqB,OAAA;AAE5C,mFAAkF;AAAzE,sHAAA,iBAAiB,OAAA;AAG1B,iEAAgF;AAA7D,0GAAA,cAAc,OAAA;AACjC,+EAA4G;AAAnG,mHAAA,QAAQ,OAAoB;AAErC,mFAAkH;AAAzG,uHAAA,QAAQ,OAAsB;AACvC,2DAA4J;AAAnJ,qGAAA,cAAc,OAAgB;AAAE,qGAAA,YAAY,OAAA;AAAE,iGAAA,QAAQ,OAAA;AAAE,kGAAA,SAAS,OAAA;AAAE,iGAAA,QAAQ,OAAA;AACpF,uEAA+E;AAAtE,6GAAA,iBAAiB,OAAA;AAE1B,sDAAsD;AACtD,oEAA8F;AAArF,sHAAA,cAAc,OAAA;AAAE,6HAAA,MAAM,OAAyB;AACxD,sEAAiG;AAAxF,wHAAA,eAAe,OAAA;AAAE,+HAAA,MAAM,OAA0B;AAC1D,qCAAoC;AAA3B,kGAAA,OAAO,OAAA;AAEhB;;;;;;;;GAQG;AACU,QAAA,SAAS,GAAe,CAAC,GAAe,EAAE;IACnD,MAAM,YAAY,GAAqB;QACrC,QAAQ,EAAE,IAAI;QACd,cAAc,EAAE,CAAC,MAAM,CAAC;KACzB,CAAC;IACF,MAAM,SAAS,GAAG,IAAA,uCAAe,EAAC,YAAY,CAAC,CAAC;IAChD,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC,iBAAiB;IACnC,IAAA,4BAAiB,EAAC,SAAS,CAAC,CAAC;IAC7B,OAAO,SAAS,CAAC;AACrB,CAAC,CAAC,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jonloucks/contracts-ts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Typescript Dependency Contracts for dependency inversion",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -65,11 +65,12 @@
|
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"@types/jest": "^30.0.0",
|
|
68
|
-
"@types/node": "^25.0.
|
|
68
|
+
"@types/node": "^25.0.10",
|
|
69
69
|
"@typescript-eslint/eslint-plugin": "^8.51.0",
|
|
70
70
|
"@typescript-eslint/parser": "^8.53.1",
|
|
71
71
|
"eslint": "^9.39.2",
|
|
72
72
|
"jest": "^30.2.0",
|
|
73
|
+
"jest-mock-extended": "^4.0.0",
|
|
73
74
|
"ts-jest": "^29.4.6",
|
|
74
75
|
"typedoc": "^0.28.15",
|
|
75
76
|
"typescript": "^5.9.3"
|
package/version.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,OAAO,EAAE,MAalB,CAAC"}
|
package/version.js
CHANGED
|
@@ -3,15 +3,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.VERSION = void 0;
|
|
4
4
|
const fs_1 = require("fs");
|
|
5
5
|
const path_1 = require("path");
|
|
6
|
+
const DEVELOPMENT_PATH = (0, path_1.join)(__dirname, "..", "package.json");
|
|
7
|
+
const PRODUCTION_PATH = (0, path_1.resolve)(__dirname, 'package.json');
|
|
6
8
|
exports.VERSION = (() => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
for (const path of [PRODUCTION_PATH, DEVELOPMENT_PATH]) {
|
|
10
|
+
try {
|
|
11
|
+
const parsedJson = JSON.parse((0, fs_1.readFileSync)(path, 'utf8'));
|
|
12
|
+
const { version } = parsedJson;
|
|
13
|
+
if (version !== undefined && version !== null) {
|
|
14
|
+
return version;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
catch (_error) {
|
|
18
|
+
// continue to next path
|
|
19
|
+
}
|
|
15
20
|
}
|
|
21
|
+
return "unknown";
|
|
16
22
|
})();
|
|
17
23
|
//# sourceMappingURL=version.js.map
|
package/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":";;;AAAA,2BAAkC;AAClC,+
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":";;;AAAA,2BAAkC;AAClC,+BAAqC;AAErC,MAAM,gBAAgB,GAAW,IAAA,WAAI,EAAC,SAAS,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC;AACvE,MAAM,eAAe,GAAW,IAAA,cAAO,EAAC,SAAS,EAAE,cAAc,CAAC,CAAC;AAEtD,QAAA,OAAO,GAAW,CAAC,GAAW,EAAE;IAC3C,KAAK,MAAM,IAAI,IAAI,CAAC,eAAe,EAAE,gBAAgB,CAAC,EAAE,CAAC;QACvD,IAAI,CAAC;YACH,MAAM,UAAU,GAAY,IAAI,CAAC,KAAK,CAAC,IAAA,iBAAY,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;YACnE,MAAM,EAAE,OAAO,EAAE,GAAG,UAAkC,CAAC;YACvD,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;gBAC9C,OAAO,OAAO,CAAC;YACjB,CAAC;QACH,CAAC;QAAC,OAAO,MAAM,EAAE,CAAC;YAChB,wBAAwB;QAC1B,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC,EAAE,CAAC"}
|
package/api/Lawyer.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Contract, Config as ContractConfig } from "@jonloucks/contracts-ts/api/Contract";
|
|
2
|
-
import { OptionalType } from "@jonloucks/contracts-ts/api/Types";
|
|
3
|
-
/**
|
|
4
|
-
* Responsibility: A Lawyer creates Contracts for a specific type T, including duck-typing checks.
|
|
5
|
-
*/
|
|
6
|
-
export interface Lawyer<T> {
|
|
7
|
-
/**
|
|
8
|
-
* Create a Contract for this Lawyer's deliverable type.
|
|
9
|
-
* @param config
|
|
10
|
-
*/
|
|
11
|
-
createContract<X extends T>(config?: ContractConfig<X>): Contract<X>;
|
|
12
|
-
/**
|
|
13
|
-
* Duck-typing check
|
|
14
|
-
*
|
|
15
|
-
* @param instance
|
|
16
|
-
*/
|
|
17
|
-
isDeliverable<X extends T>(instance: unknown): instance is OptionalType<X>;
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=Lawyer.d.ts.map
|
package/api/Lawyer.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Lawyer.d.ts","sourceRoot":"","sources":["../../src/api/Lawyer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAC1F,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAEjE;;GAEG;AACH,MAAM,WAAW,MAAM,CAAC,CAAC;IAEvB;;;OAGG;IACH,cAAc,CAAC,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAErE;;;;OAIG;IACH,aAAa,CAAC,CAAC,SAAS,CAAC,EAAE,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,YAAY,CAAC,CAAC,CAAC,CAAC;CAC5E"}
|
package/api/Lawyer.js
DELETED
package/api/Lawyer.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Lawyer.js","sourceRoot":"","sources":["../../src/api/Lawyer.ts"],"names":[],"mappings":""}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Exception thrown when a class cast fails.
|
|
3
|
-
* Note: This can not extend ContractException due to circular dependency.
|
|
4
|
-
*/
|
|
5
|
-
export declare class ClassCastException extends Error {
|
|
6
|
-
constructor(message: string, _thrown?: Error | null);
|
|
7
|
-
}
|
|
8
|
-
//# sourceMappingURL=ClassCastException.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ClassCastException.d.ts","sourceRoot":"","sources":["../../src/auxiliary/ClassCastException.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,qBAAa,kBAAmB,SAAQ,KAAK;gBAC7B,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,KAAK,GAAG,IAAW;CAO5D"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ClassCastException = void 0;
|
|
4
|
-
const Checks_1 = require("@jonloucks/contracts-ts/auxiliary/Checks");
|
|
5
|
-
/**
|
|
6
|
-
* Exception thrown when a class cast fails.
|
|
7
|
-
* Note: This can not extend ContractException due to circular dependency.
|
|
8
|
-
*/
|
|
9
|
-
class ClassCastException extends Error {
|
|
10
|
-
constructor(message, _thrown = null) {
|
|
11
|
-
// super(messageCheck(message), thrown || undefined);
|
|
12
|
-
super((0, Checks_1.messageCheck)(message));
|
|
13
|
-
this.name = "ClassCastException";
|
|
14
|
-
Object.setPrototypeOf(this, ClassCastException.prototype);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
exports.ClassCastException = ClassCastException;
|
|
18
|
-
//# sourceMappingURL=ClassCastException.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ClassCastException.js","sourceRoot":"","sources":["../../src/auxiliary/ClassCastException.ts"],"names":[],"mappings":";;;AAAA,qEAAwE;AAExE;;;GAGG;AACH,MAAa,kBAAmB,SAAQ,KAAK;IACzC,YAAY,OAAe,EAAE,UAAwB,IAAI;QACrD,qDAAqD;QACrD,KAAK,CAAC,IAAA,qBAAY,EAAC,OAAO,CAAC,CAAC,CAAC;QAE7B,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;QACjC,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,kBAAkB,CAAC,SAAS,CAAC,CAAA;IAC7D,CAAC;CACJ;AARD,gDAQC"}
|