@opra/common 1.0.0-alpha.28 → 1.0.0-alpha.29

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/browser.js CHANGED
@@ -2506,7 +2506,7 @@ var HttpController2 = /* @__PURE__ */ __name(function(...args) {
2506
2506
  _this.parameters = [];
2507
2507
  _this.name = initArgs.name;
2508
2508
  _this.description = initArgs.description;
2509
- _this.path = initArgs.path || initArgs.name;
2509
+ _this.path = initArgs.path ?? initArgs.name;
2510
2510
  _this.instance = initArgs.instance;
2511
2511
  _this.ctor = initArgs.ctor;
2512
2512
  _this._controllerReverseMap = /* @__PURE__ */ new WeakMap();
@@ -2,6 +2,12 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.OmitType = OmitType;
4
4
  const create_mapped_class_js_1 = require("./utils/create-mapped-class.js");
5
+ /**
6
+ * Create a new MappedType that omits given fields from base type
7
+ * @param baseType
8
+ * @param keys
9
+ * @param options
10
+ */
5
11
  /**
6
12
  *
7
13
  */
@@ -2,6 +2,12 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PartialType = PartialType;
4
4
  const create_mapped_class_js_1 = require("./utils/create-mapped-class.js");
5
+ /**
6
+ * Create a new MappedType that marks given or all fields as optional
7
+ * @param baseType
8
+ * @param keys
9
+ * @param options
10
+ */
5
11
  /**
6
12
  *
7
13
  */
@@ -31,7 +31,7 @@ exports.HttpController = function (...args) {
31
31
  _this.parameters = [];
32
32
  _this.name = initArgs.name;
33
33
  _this.description = initArgs.description;
34
- _this.path = initArgs.path || initArgs.name;
34
+ _this.path = initArgs.path ?? initArgs.name;
35
35
  _this.instance = initArgs.instance;
36
36
  _this.ctor = initArgs.ctor;
37
37
  _this._controllerReverseMap = new WeakMap();
@@ -1,4 +1,10 @@
1
1
  import { createMappedClass } from './utils/create-mapped-class.js';
2
+ /**
3
+ * Create a new MappedType that omits given fields from base type
4
+ * @param baseType
5
+ * @param keys
6
+ * @param options
7
+ */
2
8
  /**
3
9
  *
4
10
  */
@@ -1,4 +1,10 @@
1
1
  import { createMappedClass } from './utils/create-mapped-class.js';
2
+ /**
3
+ * Create a new MappedType that marks given or all fields as optional
4
+ * @param baseType
5
+ * @param keys
6
+ * @param options
7
+ */
2
8
  /**
3
9
  *
4
10
  */
@@ -27,7 +27,7 @@ export const HttpController = function (...args) {
27
27
  _this.parameters = [];
28
28
  _this.name = initArgs.name;
29
29
  _this.description = initArgs.description;
30
- _this.path = initArgs.path || initArgs.name;
30
+ _this.path = initArgs.path ?? initArgs.name;
31
31
  _this.instance = initArgs.instance;
32
32
  _this.ctor = initArgs.ctor;
33
33
  _this._controllerReverseMap = new WeakMap();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opra/common",
3
- "version": "1.0.0-alpha.28",
3
+ "version": "1.0.0-alpha.29",
4
4
  "description": "Opra common package",
5
5
  "author": "Panates",
6
6
  "license": "MIT",
@@ -1,11 +1,5 @@
1
1
  import { Class, Type } from 'ts-gems';
2
2
  import type { DataType } from './data-type.js';
3
- /**
4
- * Create a new MappedType that omits given fields from base type
5
- * @param baseType
6
- * @param keys
7
- * @param options
8
- */
9
3
  export declare function OmitType(baseType: string | Type, keys: string[], options?: DataType.Options): Type;
10
4
  /**
11
5
  * Create a new MappedType that omits given fields from base type
@@ -1,11 +1,5 @@
1
1
  import { Class, PartialSome, Type } from 'ts-gems';
2
2
  import type { DataType } from './data-type.js';
3
- /**
4
- * Create a new MappedType that marks given or all fields as optional
5
- * @param baseType
6
- * @param keys
7
- * @param options
8
- */
9
3
  export declare function PartialType(baseType: string | Type, keys: string[], options?: DataType.Options): Type;
10
4
  /**
11
5
  * Create a new MappedType that marks given or all fields as optional
@@ -6,11 +6,11 @@ import type { DataType } from './data-type.js';
6
6
  * @param keys
7
7
  * @param options
8
8
  */
9
- export declare function PickType(baseType: string | Type, keys: string[], options?: DataType.Options): Type;
9
+ export declare function PickType<Args extends any[], Instance, Static, K extends keyof Instance>(baseType: Class<Args, Instance, Static>, keys: readonly K[], options?: DataType.Options): Class<Args, Pick<Instance, K>> & Omit<Pick<Static, keyof typeof baseType>, 'prototype' | 'constructor'>;
10
10
  /**
11
11
  * Create a new MappedType that picks given fields from base type
12
12
  * @param baseType
13
13
  * @param keys
14
14
  * @param options
15
15
  */
16
- export declare function PickType<Args extends any[], Instance, Static, K extends keyof Instance>(baseType: Class<Args, Instance, Static>, keys: readonly K[], options?: DataType.Options): Class<Args, Pick<Instance, K>> & Omit<Pick<Static, keyof typeof baseType>, 'prototype' | 'constructor'>;
16
+ export declare function PickType(baseType: string | Type, keys: string[], options?: DataType.Options): Type;
@@ -1,12 +1,5 @@
1
1
  import { Class, RequiredSome, Type } from 'ts-gems';
2
2
  import type { DataType } from './data-type.js';
3
- /**
4
- * Create a new MappedType that marks given or all fields as required
5
- * @param baseType
6
- * @param keys
7
- * @param options
8
- */
9
- export declare function RequiredType(baseType: string | Type, keys?: string[] | true, options?: DataType.Options): Type;
10
3
  /**
11
4
  * Create a new MappedType that marks given fields as baseType
12
5
  * @param baseType
@@ -20,3 +13,10 @@ export declare function RequiredType<Args extends any[], Instance, Static, K ext
20
13
  * @param options
21
14
  */
22
15
  export declare function RequiredType<Args extends any[], Instance, Static>(baseType: Class<Args, Instance, Static>, options?: DataType.Options): Class<Args, Required<Instance>> & Omit<Pick<Static, keyof typeof baseType>, 'prototype' | 'constructor'>;
16
+ /**
17
+ * Create a new MappedType that marks given or all fields as required
18
+ * @param baseType
19
+ * @param keys
20
+ * @param options
21
+ */
22
+ export declare function RequiredType(baseType: string | Type, keys?: string[] | true, options?: DataType.Options): Type;