@xylabs/static-implements 5.0.34 → 5.0.36

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xylabs/static-implements",
3
- "version": "5.0.34",
3
+ "version": "5.0.36",
4
4
  "description": "Base functionality used throughout XY Labs TypeScript/JavaScript libraries",
5
5
  "keywords": [
6
6
  "static",
@@ -40,12 +40,15 @@
40
40
  "types": "./dist/neutral/index.d.ts",
41
41
  "files": [
42
42
  "dist",
43
- "src"
43
+ "src",
44
+ "!**/*.bench.*",
45
+ "!**/*.spec.*",
46
+ "!**/*.test.*"
44
47
  ],
45
48
  "devDependencies": {
46
49
  "@xylabs/ts-scripts-yarn3": "~7.2.8",
47
50
  "@xylabs/tsconfig": "~7.2.8",
48
- "@xylabs/vitest-extended": "~5.0.34",
51
+ "@xylabs/vitest-extended": "~5.0.36",
49
52
  "tslib": "~2.8.1",
50
53
  "typescript": "~5.9.3",
51
54
  "vitest": "~4.0.9"
@@ -1,2 +0,0 @@
1
- import '@xylabs/vitest-extended';
2
- //# sourceMappingURL=staticImplements.spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"staticImplements.spec.d.ts","sourceRoot":"","sources":["../../../src/spec/staticImplements.spec.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAA"}
@@ -1,33 +0,0 @@
1
- import '@xylabs/vitest-extended'
2
-
3
- import {
4
- describe, expect, it,
5
- } from 'vitest'
6
-
7
- import { staticImplements } from '../staticImplements.ts'
8
-
9
- interface StaticMethods {
10
- foo(): string
11
- }
12
-
13
- @staticImplements<StaticMethods>()
14
- class Concrete {
15
- static foo() {
16
- return 'bar'
17
- }
18
-
19
- foo() {
20
- return 1
21
- }
22
- }
23
-
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
- })