@skmtc/core 0.0.357 → 0.0.358

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,8 +1,4 @@
1
1
  import { EntityType } from './EntityType.js';
2
- type CreateVariableArgs = string | {
3
- name: string;
4
- tsType?: string;
5
- };
6
2
  type ConstructorArgs = {
7
3
  name: string;
8
4
  tsType?: string;
@@ -13,7 +9,7 @@ export declare class Identifier {
13
9
  entityType: EntityType;
14
10
  tsType?: string;
15
11
  constructor({ name, tsType, entityType }: ConstructorArgs);
16
- static createVariable(args: CreateVariableArgs): Identifier;
12
+ static createVariable(name: string, tsType?: string): Identifier;
17
13
  static createType(name: string): Identifier;
18
14
  toString(): string;
19
15
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Identifier.d.ts","sourceRoot":"","sources":["../../src/dsl/Identifier.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAG5C,KAAK,kBAAkB,GACnB,MAAM,GACN;IACE,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAEL,KAAK,eAAe,GAAG;IACrB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,UAAU,EAAE,UAAU,CAAA;CACvB,CAAA;AAED,qBAAa,UAAU;IACrB,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,EAAE,UAAU,CAAA;IACtB,MAAM,CAAC,EAAE,MAAM,CAAA;gBAEH,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,eAAe;IAMzD,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,kBAAkB,GAAG,UAAU;IAiB3D,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU;IAO3C,QAAQ,IAAI,MAAM;CAGnB"}
1
+ {"version":3,"file":"Identifier.d.ts","sourceRoot":"","sources":["../../src/dsl/Identifier.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAE5C,KAAK,eAAe,GAAG;IACrB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,UAAU,EAAE,UAAU,CAAA;CACvB,CAAA;AAED,qBAAa,UAAU;IACrB,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,EAAE,UAAU,CAAA;IACtB,MAAM,CAAC,EAAE,MAAM,CAAA;gBAEH,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,eAAe;IAMzD,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,UAAU;IAehE,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU;IAO3C,QAAQ,IAAI,MAAM;CAGnB"}
@@ -1,5 +1,4 @@
1
1
  import { EntityType } from './EntityType.js';
2
- import { P, match } from 'ts-pattern';
3
2
  export class Identifier {
4
3
  constructor({ name, tsType, entityType }) {
5
4
  Object.defineProperty(this, "name", {
@@ -24,20 +23,17 @@ export class Identifier {
24
23
  this.tsType = tsType;
25
24
  this.entityType = entityType;
26
25
  }
27
- static createVariable(args) {
28
- return match(args)
29
- .with(P.string, name => {
30
- return new Identifier({
31
- name,
32
- entityType: new EntityType('variable')
33
- });
34
- })
35
- .otherwise(({ name, tsType }) => {
26
+ static createVariable(name, tsType) {
27
+ if (tsType) {
36
28
  return new Identifier({
37
29
  name,
38
30
  tsType,
39
31
  entityType: new EntityType('variable')
40
32
  });
33
+ }
34
+ return new Identifier({
35
+ name,
36
+ entityType: new EntityType('variable')
41
37
  });
42
38
  }
43
39
  static createType(name) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skmtc/core",
3
- "version": "0.0.357",
3
+ "version": "0.0.358",
4
4
  "main": "./script/mod.js",
5
5
  "module": "./esm/mod.js",
6
6
  "exports": {
@@ -1,8 +1,4 @@
1
1
  import { EntityType } from './EntityType.js';
2
- type CreateVariableArgs = string | {
3
- name: string;
4
- tsType?: string;
5
- };
6
2
  type ConstructorArgs = {
7
3
  name: string;
8
4
  tsType?: string;
@@ -13,7 +9,7 @@ export declare class Identifier {
13
9
  entityType: EntityType;
14
10
  tsType?: string;
15
11
  constructor({ name, tsType, entityType }: ConstructorArgs);
16
- static createVariable(args: CreateVariableArgs): Identifier;
12
+ static createVariable(name: string, tsType?: string): Identifier;
17
13
  static createType(name: string): Identifier;
18
14
  toString(): string;
19
15
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Identifier.d.ts","sourceRoot":"","sources":["../../src/dsl/Identifier.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAG5C,KAAK,kBAAkB,GACnB,MAAM,GACN;IACE,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAEL,KAAK,eAAe,GAAG;IACrB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,UAAU,EAAE,UAAU,CAAA;CACvB,CAAA;AAED,qBAAa,UAAU;IACrB,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,EAAE,UAAU,CAAA;IACtB,MAAM,CAAC,EAAE,MAAM,CAAA;gBAEH,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,eAAe;IAMzD,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,kBAAkB,GAAG,UAAU;IAiB3D,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU;IAO3C,QAAQ,IAAI,MAAM;CAGnB"}
1
+ {"version":3,"file":"Identifier.d.ts","sourceRoot":"","sources":["../../src/dsl/Identifier.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAE5C,KAAK,eAAe,GAAG;IACrB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,UAAU,EAAE,UAAU,CAAA;CACvB,CAAA;AAED,qBAAa,UAAU;IACrB,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,EAAE,UAAU,CAAA;IACtB,MAAM,CAAC,EAAE,MAAM,CAAA;gBAEH,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,eAAe;IAMzD,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,UAAU;IAehE,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU;IAO3C,QAAQ,IAAI,MAAM;CAGnB"}
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Identifier = void 0;
4
4
  const EntityType_js_1 = require("./EntityType.js");
5
- const ts_pattern_1 = require("ts-pattern");
6
5
  class Identifier {
7
6
  constructor({ name, tsType, entityType }) {
8
7
  Object.defineProperty(this, "name", {
@@ -27,20 +26,17 @@ class Identifier {
27
26
  this.tsType = tsType;
28
27
  this.entityType = entityType;
29
28
  }
30
- static createVariable(args) {
31
- return (0, ts_pattern_1.match)(args)
32
- .with(ts_pattern_1.P.string, name => {
33
- return new Identifier({
34
- name,
35
- entityType: new EntityType_js_1.EntityType('variable')
36
- });
37
- })
38
- .otherwise(({ name, tsType }) => {
29
+ static createVariable(name, tsType) {
30
+ if (tsType) {
39
31
  return new Identifier({
40
32
  name,
41
33
  tsType,
42
34
  entityType: new EntityType_js_1.EntityType('variable')
43
35
  });
36
+ }
37
+ return new Identifier({
38
+ name,
39
+ entityType: new EntityType_js_1.EntityType('variable')
44
40
  });
45
41
  }
46
42
  static createType(name) {