@xylabs/static-implements 2.11.11 → 2.11.13
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/package.json +4 -4
- package/dist/browser/spec/staticImplements.spec.js +0 -34
- package/dist/browser/spec/staticImplements.spec.js.map +0 -1
- package/dist/node/spec/staticImplements.spec.js +0 -35
- package/dist/node/spec/staticImplements.spec.js.map +0 -1
- package/dist/node/spec/staticImplements.spec.mjs +0 -34
- package/dist/node/spec/staticImplements.spec.mjs.map +0 -1
package/package.json
CHANGED
|
@@ -39,9 +39,9 @@
|
|
|
39
39
|
"esm"
|
|
40
40
|
],
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@xylabs/ts-scripts-yarn3": "^3.0.
|
|
43
|
-
"@xylabs/tsconfig": "^3.0.
|
|
44
|
-
"@xylabs/tsconfig-jest": "^3.0.
|
|
42
|
+
"@xylabs/ts-scripts-yarn3": "^3.0.62",
|
|
43
|
+
"@xylabs/tsconfig": "^3.0.62",
|
|
44
|
+
"@xylabs/tsconfig-jest": "^3.0.62",
|
|
45
45
|
"typescript": "^5.2.2"
|
|
46
46
|
},
|
|
47
47
|
"publishConfig": {
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"url": "https://github.com/xylabs/sdk-js.git"
|
|
53
53
|
},
|
|
54
54
|
"sideEffects": false,
|
|
55
|
-
"version": "2.11.
|
|
55
|
+
"version": "2.11.13"
|
|
56
56
|
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __decorateClass = (decorators, target, key, kind) => {
|
|
4
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
5
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
6
|
-
if (decorator = decorators[i])
|
|
7
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
8
|
-
if (kind && result)
|
|
9
|
-
__defProp(target, key, result);
|
|
10
|
-
return result;
|
|
11
|
-
};
|
|
12
|
-
import { staticImplements } from "../staticImplements";
|
|
13
|
-
let Concrete = class {
|
|
14
|
-
static foo() {
|
|
15
|
-
return "bar";
|
|
16
|
-
}
|
|
17
|
-
foo() {
|
|
18
|
-
return 1;
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
Concrete = __decorateClass([
|
|
22
|
-
staticImplements()
|
|
23
|
-
], Concrete);
|
|
24
|
-
describe("staticImplements", () => {
|
|
25
|
-
it("forces class to implement static methods", () => {
|
|
26
|
-
expect(Concrete.foo).toBeFunction();
|
|
27
|
-
expect(Concrete.foo()).toBeString();
|
|
28
|
-
});
|
|
29
|
-
it("does not allow instances to satisfy static constraints", () => {
|
|
30
|
-
expect(new Concrete().foo).toBeFunction();
|
|
31
|
-
expect(new Concrete().foo()).toBeNumber();
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
//# sourceMappingURL=staticImplements.spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/spec/staticImplements.spec.ts"],"sourcesContent":["import { staticImplements } from '../staticImplements'\n\ninterface StaticMethods {\n foo(): string\n}\n\n@staticImplements<StaticMethods>()\nclass Concrete {\n static foo() {\n return 'bar'\n }\n foo() {\n return 1\n }\n}\n\ndescribe('staticImplements', () => {\n it('forces class to implement static methods', () => {\n expect(Concrete.foo).toBeFunction()\n expect(Concrete.foo()).toBeString()\n })\n it('does not allow instances to satisfy static constraints', () => {\n expect(new Concrete().foo).toBeFunction()\n expect(new Concrete().foo()).toBeNumber()\n })\n})\n"],"mappings":";;;;;;;;;;;AAAA,SAAS,wBAAwB;AAOjC,IAAM,WAAN,MAAe;AAAA,EACb,OAAO,MAAM;AACX,WAAO;AAAA,EACT;AAAA,EACA,MAAM;AACJ,WAAO;AAAA,EACT;AACF;AAPM,WAAN;AAAA,EADC,iBAAgC;AAAA,GAC3B;AASN,SAAS,oBAAoB,MAAM;AACjC,KAAG,4CAA4C,MAAM;AACnD,WAAO,SAAS,GAAG,EAAE,aAAa;AAClC,WAAO,SAAS,IAAI,CAAC,EAAE,WAAW;AAAA,EACpC,CAAC;AACD,KAAG,0DAA0D,MAAM;AACjE,WAAO,IAAI,SAAS,EAAE,GAAG,EAAE,aAAa;AACxC,WAAO,IAAI,SAAS,EAAE,IAAI,CAAC,EAAE,WAAW;AAAA,EAC1C,CAAC;AACH,CAAC;","names":[]}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __decorateClass = (decorators, target, key, kind) => {
|
|
5
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
6
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
7
|
-
if (decorator = decorators[i])
|
|
8
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
9
|
-
if (kind && result)
|
|
10
|
-
__defProp(target, key, result);
|
|
11
|
-
return result;
|
|
12
|
-
};
|
|
13
|
-
var import_staticImplements = require("../staticImplements");
|
|
14
|
-
let Concrete = class {
|
|
15
|
-
static foo() {
|
|
16
|
-
return "bar";
|
|
17
|
-
}
|
|
18
|
-
foo() {
|
|
19
|
-
return 1;
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
Concrete = __decorateClass([
|
|
23
|
-
(0, import_staticImplements.staticImplements)()
|
|
24
|
-
], Concrete);
|
|
25
|
-
describe("staticImplements", () => {
|
|
26
|
-
it("forces class to implement static methods", () => {
|
|
27
|
-
expect(Concrete.foo).toBeFunction();
|
|
28
|
-
expect(Concrete.foo()).toBeString();
|
|
29
|
-
});
|
|
30
|
-
it("does not allow instances to satisfy static constraints", () => {
|
|
31
|
-
expect(new Concrete().foo).toBeFunction();
|
|
32
|
-
expect(new Concrete().foo()).toBeNumber();
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
//# sourceMappingURL=staticImplements.spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/spec/staticImplements.spec.ts"],"sourcesContent":["import { staticImplements } from '../staticImplements'\n\ninterface StaticMethods {\n foo(): string\n}\n\n@staticImplements<StaticMethods>()\nclass Concrete {\n static foo() {\n return 'bar'\n }\n foo() {\n return 1\n }\n}\n\ndescribe('staticImplements', () => {\n it('forces class to implement static methods', () => {\n expect(Concrete.foo).toBeFunction()\n expect(Concrete.foo()).toBeString()\n })\n it('does not allow instances to satisfy static constraints', () => {\n expect(new Concrete().foo).toBeFunction()\n expect(new Concrete().foo()).toBeNumber()\n })\n})\n"],"mappings":";;;;;;;;;;;;AAAA,8BAAiC;AAOjC,IAAM,WAAN,MAAe;AAAA,EACb,OAAO,MAAM;AACX,WAAO;AAAA,EACT;AAAA,EACA,MAAM;AACJ,WAAO;AAAA,EACT;AACF;AAPM,WAAN;AAAA,MADC,0CAAgC;AAAA,GAC3B;AASN,SAAS,oBAAoB,MAAM;AACjC,KAAG,4CAA4C,MAAM;AACnD,WAAO,SAAS,GAAG,EAAE,aAAa;AAClC,WAAO,SAAS,IAAI,CAAC,EAAE,WAAW;AAAA,EACpC,CAAC;AACD,KAAG,0DAA0D,MAAM;AACjE,WAAO,IAAI,SAAS,EAAE,GAAG,EAAE,aAAa;AACxC,WAAO,IAAI,SAAS,EAAE,IAAI,CAAC,EAAE,WAAW;AAAA,EAC1C,CAAC;AACH,CAAC;","names":[]}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __decorateClass = (decorators, target, key, kind) => {
|
|
4
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
5
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
6
|
-
if (decorator = decorators[i])
|
|
7
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
8
|
-
if (kind && result)
|
|
9
|
-
__defProp(target, key, result);
|
|
10
|
-
return result;
|
|
11
|
-
};
|
|
12
|
-
import { staticImplements } from "../staticImplements";
|
|
13
|
-
let Concrete = class {
|
|
14
|
-
static foo() {
|
|
15
|
-
return "bar";
|
|
16
|
-
}
|
|
17
|
-
foo() {
|
|
18
|
-
return 1;
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
Concrete = __decorateClass([
|
|
22
|
-
staticImplements()
|
|
23
|
-
], Concrete);
|
|
24
|
-
describe("staticImplements", () => {
|
|
25
|
-
it("forces class to implement static methods", () => {
|
|
26
|
-
expect(Concrete.foo).toBeFunction();
|
|
27
|
-
expect(Concrete.foo()).toBeString();
|
|
28
|
-
});
|
|
29
|
-
it("does not allow instances to satisfy static constraints", () => {
|
|
30
|
-
expect(new Concrete().foo).toBeFunction();
|
|
31
|
-
expect(new Concrete().foo()).toBeNumber();
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
//# sourceMappingURL=staticImplements.spec.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/spec/staticImplements.spec.ts"],"sourcesContent":["import { staticImplements } from '../staticImplements'\n\ninterface StaticMethods {\n foo(): string\n}\n\n@staticImplements<StaticMethods>()\nclass Concrete {\n static foo() {\n return 'bar'\n }\n foo() {\n return 1\n }\n}\n\ndescribe('staticImplements', () => {\n it('forces class to implement static methods', () => {\n expect(Concrete.foo).toBeFunction()\n expect(Concrete.foo()).toBeString()\n })\n it('does not allow instances to satisfy static constraints', () => {\n expect(new Concrete().foo).toBeFunction()\n expect(new Concrete().foo()).toBeNumber()\n })\n})\n"],"mappings":";;;;;;;;;;;AAAA,SAAS,wBAAwB;AAOjC,IAAM,WAAN,MAAe;AAAA,EACb,OAAO,MAAM;AACX,WAAO;AAAA,EACT;AAAA,EACA,MAAM;AACJ,WAAO;AAAA,EACT;AACF;AAPM,WAAN;AAAA,EADC,iBAAgC;AAAA,GAC3B;AASN,SAAS,oBAAoB,MAAM;AACjC,KAAG,4CAA4C,MAAM;AACnD,WAAO,SAAS,GAAG,EAAE,aAAa;AAClC,WAAO,SAAS,IAAI,CAAC,EAAE,WAAW;AAAA,EACpC,CAAC;AACD,KAAG,0DAA0D,MAAM;AACjE,WAAO,IAAI,SAAS,EAAE,GAAG,EAAE,aAAa;AACxC,WAAO,IAAI,SAAS,EAAE,IAAI,CAAC,EAAE,WAAW;AAAA,EAC1C,CAAC;AACH,CAAC;","names":[]}
|