@lcap/nasl 4.0.0-beta.21 → 4.0.0-beta.23

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,7 +1,7 @@
1
1
  {
2
2
  "name": "@lcap/nasl",
3
3
  "description": "NetEase Application Specific Language",
4
- "version": "4.0.0-beta.21",
4
+ "version": "4.0.0-beta.23",
5
5
  "author": "Forrest <rainforest92@126.com>",
6
6
  "main": "./out",
7
7
  "types": "./out/index.d.ts",
@@ -78,15 +78,15 @@
78
78
  "vue": "3.4.33",
79
79
  "vue-template-compiler": "2.6.14",
80
80
  "vue-template-es2015-compiler": "1.9.1",
81
- "@lcap/nasl-breakpoint": "4.0.0-beta.21",
82
- "@lcap/nasl-language-server-core": "4.0.0-beta.21",
83
- "@lcap/nasl-concepts": "4.0.0-beta.21",
84
- "@lcap/nasl-log": "4.0.0-beta.21",
85
- "@lcap/nasl-translator": "4.0.0-beta.21",
86
- "@lcap/nasl-sentry": "4.0.0-beta.21",
87
- "@lcap/nasl-types": "4.0.0-beta.21",
88
- "@lcap/nasl-unified-frontend-generator": "4.0.0-beta.21",
89
- "@lcap/nasl-utils": "4.0.0-beta.21"
81
+ "@lcap/nasl-breakpoint": "4.0.0-beta.23",
82
+ "@lcap/nasl-concepts": "4.0.0-beta.23",
83
+ "@lcap/nasl-language-server-core": "4.0.0-beta.23",
84
+ "@lcap/nasl-log": "4.0.0-beta.23",
85
+ "@lcap/nasl-sentry": "4.0.0-beta.23",
86
+ "@lcap/nasl-translator": "4.0.0-beta.23",
87
+ "@lcap/nasl-types": "4.0.0-beta.23",
88
+ "@lcap/nasl-unified-frontend-generator": "4.0.0-beta.23",
89
+ "@lcap/nasl-utils": "4.0.0-beta.23"
90
90
  },
91
91
  "devDependencies": {
92
92
  "@types/babel__core": "7.20.1",
@@ -100,8 +100,8 @@
100
100
  "rimraf": "3.0.2",
101
101
  "typedoc": "0.25.13",
102
102
  "typescript": "5.4.4",
103
- "@lcap/nasl-tsconfig": "1.0.1",
104
- "@lcap/nasl-test-toolkit": "1.0.0"
103
+ "@lcap/nasl-test-toolkit": "1.0.0",
104
+ "@lcap/nasl-tsconfig": "1.0.1"
105
105
  },
106
106
  "scripts": {
107
107
  "clear": "rimraf ./out",
@@ -0,0 +1,49 @@
1
+ namespace nasl.core {
2
+ import Equal = nasl.test.Equal;
3
+ import AssertTrue = nasl.test.AssertTrue;
4
+
5
+ function testAdd(
6
+ l: Long,
7
+ d: Decimal,
8
+ s: String,
9
+ b: Boolean,
10
+ dt: DateTime,
11
+ t: Time,
12
+ date: Date,
13
+ any: Any,
14
+ dul: Decimal | Long
15
+ ) {
16
+ {
17
+ // Long + Long -> Long
18
+ const a = add(l, l);
19
+ type Case1 = AssertTrue<Equal<typeof a, Long>>;
20
+ }
21
+ {
22
+ // Decimal + Decimal -> Decimal
23
+ const a = add(d, d);
24
+ type Case2 = AssertTrue<Equal<typeof a, Decimal>>;
25
+ }
26
+ {
27
+ // Decimal | Long + Decimal | Long -> Decimal
28
+ const a = add(dul, dul);
29
+ type Case3 = AssertTrue<Equal<typeof a, Decimal>>;
30
+ // Decimal | Long + Long -> Decimal
31
+ const b = add(dul, l);
32
+ type Case4 = AssertTrue<Equal<typeof b, Decimal>>;
33
+ // Long + Decimal | Long -> Decimal
34
+ const c = add(l, dul);
35
+ type Case5 = AssertTrue<Equal<typeof c, Decimal>>;
36
+ }
37
+ {
38
+ // String + String -> String
39
+ const a = add(s, s);
40
+ type Case6 = AssertTrue<Equal<typeof a, String>>;
41
+ // String + Any -> String
42
+ const b = add(s, any);
43
+ type Case7 = AssertTrue<Equal<typeof b, String>>;
44
+ // Any + String -> String
45
+ const c = add(any, s);
46
+ type Case8 = AssertTrue<Equal<typeof c, String>>;
47
+ }
48
+ }
49
+ }
@@ -211,7 +211,7 @@ declare namespace nasl.core {
211
211
  }
212
212
  export type Incompatible<A, B> = A extends B ? never : A
213
213
  export type IsVoid<T> = T extends void ? never : T
214
- export type IfAny<T, Y, N> = 0 extends (1 & T) ? Y : N;
214
+ export type IfAny<T, Y, N> = 0 extends (1 & T) ? Y : N;
215
215
  export type IsAny<T> = IfAny<T, true, false>;
216
216
 
217
217
  export class Function extends globalThis.Function {
@@ -249,4 +249,4 @@ declare namespace nasl.core {
249
249
  : {
250
250
  [K in keyof T]: DelAStructure<T[K]>;
251
251
  };
252
- }
252
+ }