@pdg/data 1.0.2 → 1.0.4

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/dist/index.esm.js CHANGED
@@ -5,57 +5,18 @@
5
5
  * ******************************************************************************************************************/
6
6
  function copy(value) {
7
7
  return JSON.parse(JSON.stringify(value));
8
- }/******************************************************************************
9
- Copyright (c) Microsoft Corporation.
10
-
11
- Permission to use, copy, modify, and/or distribute this software for any
12
- purpose with or without fee is hereby granted.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
15
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
16
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
17
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
18
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
19
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
20
- PERFORMANCE OF THIS SOFTWARE.
21
- ***************************************************************************** */
22
- /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
23
-
24
-
25
- var __assign = function() {
26
- __assign = Object.assign || function __assign(t) {
27
- for (var s, i = 1, n = arguments.length; i < n; i++) {
28
- s = arguments[i];
29
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
30
- }
31
- return t;
32
- };
33
- return __assign.apply(this, arguments);
34
- };
35
-
36
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
37
- var e = new Error(message);
38
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
39
- };/********************************************************************************************************************
40
- * {label, value, ...other} 객체 생성하여 반환하는 함수
41
- * @param label - label
42
- * @param value - value
43
- * @param other - 기타 속성
44
- * @returns 생성된 객체
8
+ }/********************************************************************************************************************
9
+ * 구현
45
10
  * ******************************************************************************************************************/
46
11
  function lv(label, value, other) {
47
- return __assign({ label: label, value: value }, other);
12
+ return Object.assign(Object.assign({}, other), { label, value });
48
13
  }/********************************************************************************************************************
49
- * {value, label, ...other} 객체 생성하여 반환하는 함수
50
- * @param value - value
51
- * @param label - label
52
- * @param other - 기타 속성
53
- * @returns 생성된 객체
14
+ * 구현
54
15
  * ******************************************************************************************************************/
55
16
  function vl(value, label, other) {
56
- return __assign({ value: value, label: label }, other);
17
+ return Object.assign(Object.assign({}, other), { value, label });
57
18
  }var index = {
58
- copy: copy,
59
- lv: lv,
60
- vl: vl,
19
+ copy,
20
+ lv,
21
+ vl,
61
22
  };export{copy,index as default,lv,vl};
package/dist/index.js CHANGED
@@ -5,57 +5,18 @@
5
5
  * ******************************************************************************************************************/
6
6
  function copy(value) {
7
7
  return JSON.parse(JSON.stringify(value));
8
- }/******************************************************************************
9
- Copyright (c) Microsoft Corporation.
10
-
11
- Permission to use, copy, modify, and/or distribute this software for any
12
- purpose with or without fee is hereby granted.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
15
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
16
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
17
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
18
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
19
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
20
- PERFORMANCE OF THIS SOFTWARE.
21
- ***************************************************************************** */
22
- /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
23
-
24
-
25
- var __assign = function() {
26
- __assign = Object.assign || function __assign(t) {
27
- for (var s, i = 1, n = arguments.length; i < n; i++) {
28
- s = arguments[i];
29
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
30
- }
31
- return t;
32
- };
33
- return __assign.apply(this, arguments);
34
- };
35
-
36
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
37
- var e = new Error(message);
38
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
39
- };/********************************************************************************************************************
40
- * {label, value, ...other} 객체 생성하여 반환하는 함수
41
- * @param label - label
42
- * @param value - value
43
- * @param other - 기타 속성
44
- * @returns 생성된 객체
8
+ }/********************************************************************************************************************
9
+ * 구현
45
10
  * ******************************************************************************************************************/
46
11
  function lv(label, value, other) {
47
- return __assign({ label: label, value: value }, other);
12
+ return Object.assign(Object.assign({}, other), { label, value });
48
13
  }/********************************************************************************************************************
49
- * {value, label, ...other} 객체 생성하여 반환하는 함수
50
- * @param value - value
51
- * @param label - label
52
- * @param other - 기타 속성
53
- * @returns 생성된 객체
14
+ * 구현
54
15
  * ******************************************************************************************************************/
55
16
  function vl(value, label, other) {
56
- return __assign({ value: value, label: label }, other);
17
+ return Object.assign(Object.assign({}, other), { value, label });
57
18
  }var index = {
58
- copy: copy,
59
- lv: lv,
60
- vl: vl,
19
+ copy,
20
+ lv,
21
+ vl,
61
22
  };exports.copy=copy;exports.default=index;exports.lv=lv;exports.vl=vl;
package/dist/lv.d.ts CHANGED
@@ -1,3 +1,13 @@
1
+ /********************************************************************************************************************
2
+ * {label, value} 객체 생성하여 반환하는 함수
3
+ * @param label - label
4
+ * @param value - value
5
+ * @returns 생성된 객체
6
+ * ******************************************************************************************************************/
7
+ export declare function lv<L, const V>(label: L, value: V): {
8
+ label: L;
9
+ value: V;
10
+ };
1
11
  /********************************************************************************************************************
2
12
  * {label, value, ...other} 객체 생성하여 반환하는 함수
3
13
  * @param label - label
@@ -6,8 +16,8 @@
6
16
  * @returns 생성된 객체
7
17
  * ******************************************************************************************************************/
8
18
  export declare function lv<L, const V, Other extends {
9
- [key: string]: unknown;
10
- }>(label: L, value: V, other?: Other): {
19
+ [K in 'label' | 'value']?: never;
20
+ } & object>(label: L, value: V, other: Other): {
11
21
  label: L;
12
22
  value: V;
13
23
  } & Other;
package/dist/vl.d.ts CHANGED
@@ -1,3 +1,13 @@
1
+ /********************************************************************************************************************
2
+ * {value, label} 객체 생성하여 반환하는 함수
3
+ * @param value - value
4
+ * @param label - label
5
+ * @returns 생성된 객체
6
+ * ******************************************************************************************************************/
7
+ export declare function vl<const V, L>(value: V, label: L): {
8
+ value: V;
9
+ label: L;
10
+ };
1
11
  /********************************************************************************************************************
2
12
  * {value, label, ...other} 객체 생성하여 반환하는 함수
3
13
  * @param value - value
@@ -6,8 +16,8 @@
6
16
  * @returns 생성된 객체
7
17
  * ******************************************************************************************************************/
8
18
  export declare function vl<const V, L, Other extends {
9
- [key: string]: unknown;
10
- }>(value: V, label: L, other?: Other): {
19
+ [K in 'label' | 'value']?: never;
20
+ } & object>(value: V, label: L, other?: Other): {
11
21
  value: V;
12
22
  label: L;
13
23
  } & Other;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@pdg/data",
3
3
  "title": "Typescript Data Module",
4
4
  "description": "Typescript Data Module",
5
- "version": "1.0.2",
5
+ "version": "1.0.4",
6
6
  "type": "module",
7
7
  "main": "./dist/index.js",
8
8
  "module": "./dist/index.esm.js",
@@ -68,7 +68,7 @@
68
68
  "rollup-plugin-typescript2": "^0.36.0",
69
69
  "ts-jest": "^29.3.4",
70
70
  "ts-node": "^10.9.2",
71
- "typescript": "^5.8.3",
71
+ "typescript": "5.8.3",
72
72
  "typescript-eslint": "^8.33.0"
73
73
  }
74
74
  }