@nmtjs/type 0.1.0 → 0.1.1

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.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/types/never.ts"],"sourcesContent":["import { type TNever, Type } from '@sinclair/typebox'\nimport { BaseType } from './base.ts'\n\nexport class NeverType<\n N extends boolean = false,\n O extends boolean = false,\n> extends BaseType<TNever, N, O> {\n constructor(\n schema = Type.Never(),\n nullable: N = false as N,\n optional: O = false as O,\n ) {\n super(schema, nullable, optional)\n }\n\n // @ts-expect-error\n nullable() {\n throw new Error('NeverType cannot be nullable')\n }\n\n // @ts-expect-error\n optional() {\n throw new Error('NeverType cannot be optional')\n }\n\n // @ts-expect-error\n nullish() {\n throw new Error('NeverType cannot be nullish')\n }\n}\n"],"names":["Type","BaseType","NeverType","constructor","schema","Never","nullable","optional","Error","nullish"],"mappings":"AAAA,SAAsBA,IAAI,QAAQ,oBAAmB;AACrD,SAASC,QAAQ,QAAQ,YAAW;AAEpC,OAAO,MAAMC,kBAGHD;IACRE,YACEC,SAASJ,KAAKK,KAAK,EAAE,EACrBC,WAAc,KAAU,EACxBC,WAAc,KAAU,CACxB;QACA,KAAK,CAACH,QAAQE,UAAUC;IAC1B;IAGAD,WAAW;QACT,MAAM,IAAIE,MAAM;IAClB;IAGAD,WAAW;QACT,MAAM,IAAIC,MAAM;IAClB;IAGAC,UAAU;QACR,MAAM,IAAID,MAAM;IAClB;AACF"}
1
+ {"version":3,"sources":["../../../src/types/never.ts"],"sourcesContent":["import { type TNever, Type } from '@sinclair/typebox'\nimport { BaseType } from './base.ts'\n\nexport class NeverType<\n N extends boolean = false,\n O extends boolean = false,\n> extends BaseType<TNever, N, O> {\n constructor(\n schema = Type.Never(),\n nullable: N = false as N,\n optional: O = false as O,\n ) {\n super(schema, nullable, optional)\n }\n\n nullable(): NeverType<true, O> {\n throw new Error('NeverType cannot be nullable')\n }\n\n optional(): NeverType<N, true> {\n throw new Error('NeverType cannot be optional')\n }\n\n nullish(): NeverType<true, true> {\n throw new Error('NeverType cannot be nullish')\n }\n}\n"],"names":["Type","BaseType","NeverType","constructor","schema","Never","nullable","optional","Error","nullish"],"mappings":"AAAA,SAAsBA,IAAI,QAAQ,oBAAmB;AACrD,SAASC,QAAQ,QAAQ,YAAW;AAEpC,OAAO,MAAMC,kBAGHD;IACRE,YACEC,SAASJ,KAAKK,KAAK,EAAE,EACrBC,WAAc,KAAU,EACxBC,WAAc,KAAU,CACxB;QACA,KAAK,CAACH,QAAQE,UAAUC;IAC1B;IAEAD,WAA+B;QAC7B,MAAM,IAAIE,MAAM;IAClB;IAEAD,WAA+B;QAC7B,MAAM,IAAIC,MAAM;IAClB;IAEAC,UAAiC;QAC/B,MAAM,IAAID,MAAM;IAClB;AACF"}
package/package.json CHANGED
@@ -21,12 +21,12 @@
21
21
  "peerDependencies": {
22
22
  "@sinclair/typebox": "^0.33.7",
23
23
  "temporal-polyfill": "^0.2.5",
24
- "@nmtjs/common": "0.1.0"
24
+ "@nmtjs/common": "0.1.1"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@sinclair/typebox": "^0.33.7",
28
28
  "temporal-polyfill": "^0.2.5",
29
- "@nmtjs/common": "0.1.0"
29
+ "@nmtjs/common": "0.1.1"
30
30
  },
31
31
  "files": [
32
32
  "src",
@@ -35,7 +35,7 @@
35
35
  "LICENSE.md",
36
36
  "README.md"
37
37
  ],
38
- "version": "0.1.0",
38
+ "version": "0.1.1",
39
39
  "scripts": {
40
40
  "build": "neemata-build -p neutral --root=./src './**/*.ts'",
41
41
  "type-check": "tsc --noEmit"
@@ -13,18 +13,15 @@ export class NeverType<
13
13
  super(schema, nullable, optional)
14
14
  }
15
15
 
16
- // @ts-expect-error
17
- nullable() {
16
+ nullable(): NeverType<true, O> {
18
17
  throw new Error('NeverType cannot be nullable')
19
18
  }
20
19
 
21
- // @ts-expect-error
22
- optional() {
20
+ optional(): NeverType<N, true> {
23
21
  throw new Error('NeverType cannot be optional')
24
22
  }
25
23
 
26
- // @ts-expect-error
27
- nullish() {
24
+ nullish(): NeverType<true, true> {
28
25
  throw new Error('NeverType cannot be nullish')
29
26
  }
30
27
  }