@pdg/data 1.0.0
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/README.md +8 -0
- package/dist/copy.d.ts +7 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.esm.js +61 -0
- package/dist/index.js +61 -0
- package/dist/lv.d.ts +14 -0
- package/dist/vl.d.ts +14 -0
- package/package.json +61 -0
package/README.md
ADDED
package/dist/copy.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/********************************************************************************************************************
|
|
2
|
+
* 객체 복사
|
|
3
|
+
* @param value 복사할 객체
|
|
4
|
+
* @returns 복사된 객체
|
|
5
|
+
* ******************************************************************************************************************/
|
|
6
|
+
export declare function copy<T extends object>(value: T): T;
|
|
7
|
+
export default copy;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from './copy';
|
|
2
|
+
export * from './lv';
|
|
3
|
+
export * from './vl';
|
|
4
|
+
import copy from './copy';
|
|
5
|
+
import lv from './lv';
|
|
6
|
+
import vl from './vl';
|
|
7
|
+
declare const _default: {
|
|
8
|
+
copy: typeof copy;
|
|
9
|
+
lv: typeof lv;
|
|
10
|
+
vl: typeof vl;
|
|
11
|
+
};
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/********************************************************************************************************************
|
|
2
|
+
* 객체 복사
|
|
3
|
+
* @param value 복사할 객체
|
|
4
|
+
* @returns 복사된 객체
|
|
5
|
+
* ******************************************************************************************************************/
|
|
6
|
+
function copy(value) {
|
|
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 생성된 객체
|
|
45
|
+
* ******************************************************************************************************************/
|
|
46
|
+
function lv(label, value, other) {
|
|
47
|
+
return __assign({ label: label, value: value }, other);
|
|
48
|
+
}/********************************************************************************************************************
|
|
49
|
+
* {value, label, ...other} 객체 생성하여 반환하는 함수
|
|
50
|
+
* @param value - value
|
|
51
|
+
* @param label - label
|
|
52
|
+
* @param other - 기타 속성
|
|
53
|
+
* @returns 생성된 객체
|
|
54
|
+
* ******************************************************************************************************************/
|
|
55
|
+
function vl(value, label, other) {
|
|
56
|
+
return __assign({ value: value, label: label }, other);
|
|
57
|
+
}var index = {
|
|
58
|
+
copy: copy,
|
|
59
|
+
lv: lv,
|
|
60
|
+
vl: vl,
|
|
61
|
+
};export{copy,index as default,lv,vl};
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
'use strict';Object.defineProperty(exports,'__esModule',{value:true});/********************************************************************************************************************
|
|
2
|
+
* 객체 복사
|
|
3
|
+
* @param value 복사할 객체
|
|
4
|
+
* @returns 복사된 객체
|
|
5
|
+
* ******************************************************************************************************************/
|
|
6
|
+
function copy(value) {
|
|
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 생성된 객체
|
|
45
|
+
* ******************************************************************************************************************/
|
|
46
|
+
function lv(label, value, other) {
|
|
47
|
+
return __assign({ label: label, value: value }, other);
|
|
48
|
+
}/********************************************************************************************************************
|
|
49
|
+
* {value, label, ...other} 객체 생성하여 반환하는 함수
|
|
50
|
+
* @param value - value
|
|
51
|
+
* @param label - label
|
|
52
|
+
* @param other - 기타 속성
|
|
53
|
+
* @returns 생성된 객체
|
|
54
|
+
* ******************************************************************************************************************/
|
|
55
|
+
function vl(value, label, other) {
|
|
56
|
+
return __assign({ value: value, label: label }, other);
|
|
57
|
+
}var index = {
|
|
58
|
+
copy: copy,
|
|
59
|
+
lv: lv,
|
|
60
|
+
vl: vl,
|
|
61
|
+
};exports.copy=copy;exports.default=index;exports.lv=lv;exports.vl=vl;
|
package/dist/lv.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/********************************************************************************************************************
|
|
2
|
+
* {label, value, ...other} 객체 생성하여 반환하는 함수
|
|
3
|
+
* @param label - label
|
|
4
|
+
* @param value - value
|
|
5
|
+
* @param other - 기타 속성
|
|
6
|
+
* @returns 생성된 객체
|
|
7
|
+
* ******************************************************************************************************************/
|
|
8
|
+
export declare function lv<L, V, Other extends {
|
|
9
|
+
[key: string]: unknown;
|
|
10
|
+
}>(label: L, value: V, other?: Other): {
|
|
11
|
+
label: L;
|
|
12
|
+
value: V;
|
|
13
|
+
} & Other;
|
|
14
|
+
export default lv;
|
package/dist/vl.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/********************************************************************************************************************
|
|
2
|
+
* {value, label, ...other} 객체 생성하여 반환하는 함수
|
|
3
|
+
* @param value - value
|
|
4
|
+
* @param label - label
|
|
5
|
+
* @param other - 기타 속성
|
|
6
|
+
* @returns 생성된 객체
|
|
7
|
+
* ******************************************************************************************************************/
|
|
8
|
+
export declare function vl<V, L, Other extends {
|
|
9
|
+
[key: string]: unknown;
|
|
10
|
+
}>(value: V, label: L, other?: Other): {
|
|
11
|
+
value: V;
|
|
12
|
+
label: L;
|
|
13
|
+
} & Other;
|
|
14
|
+
export default vl;
|
package/package.json
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@pdg/data",
|
|
3
|
+
"title": "Typescript Data Module",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"description": "API Module",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"main": "dist/index.js",
|
|
9
|
+
"module": "dist/index.esm.js",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/parkdigy/data.git",
|
|
13
|
+
"baseUrl": "https://github.com/parkdigy/data"
|
|
14
|
+
},
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/parkdigy/data/issues"
|
|
17
|
+
},
|
|
18
|
+
"homepage": "https://github.com/parkdigy/data#readme",
|
|
19
|
+
"files": [
|
|
20
|
+
"dist",
|
|
21
|
+
"README.md"
|
|
22
|
+
],
|
|
23
|
+
"scripts": {
|
|
24
|
+
"dev": "cd examples && npm run dev",
|
|
25
|
+
"build": "npm run test && npm run lint && rollup -c --bundleConfigAsCjs",
|
|
26
|
+
"pub": "npm i && npm run build && npm publish --access=public && rm ./.git/hooks/pre-commit",
|
|
27
|
+
"lint": "eslint './src/**/*.ts'",
|
|
28
|
+
"reinstall-module": "rm -rf node_modules && rm -f package-lock.json && npm i",
|
|
29
|
+
"test": "jest"
|
|
30
|
+
},
|
|
31
|
+
"author": "YOUNG CHUL PARK",
|
|
32
|
+
"license": "MIT",
|
|
33
|
+
"readmeFilename": "README.md",
|
|
34
|
+
"keywords": [
|
|
35
|
+
"util",
|
|
36
|
+
"typescript",
|
|
37
|
+
"javascript"
|
|
38
|
+
],
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@eslint/js": "^9.28.0",
|
|
41
|
+
"@rollup/plugin-commonjs": "^28.0.3",
|
|
42
|
+
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
43
|
+
"@types/jest": "^29.5.14",
|
|
44
|
+
"@types/node": "^22.15.29",
|
|
45
|
+
"@types/uuid": "^10.0.0",
|
|
46
|
+
"@typescript-eslint/parser": "^8.33.0",
|
|
47
|
+
"eslint": "9.28.0",
|
|
48
|
+
"eslint-config-prettier": "^10.1.5",
|
|
49
|
+
"eslint-plugin-prettier": "^5.4.1",
|
|
50
|
+
"jest": "^29.7.0",
|
|
51
|
+
"prettier": "^3.5.3",
|
|
52
|
+
"rollup": "^4.41.1",
|
|
53
|
+
"rollup-plugin-delete": "^2.2.0",
|
|
54
|
+
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
55
|
+
"rollup-plugin-typescript2": "^0.36.0",
|
|
56
|
+
"ts-jest": "^29.3.4",
|
|
57
|
+
"ts-node": "^10.9.2",
|
|
58
|
+
"typescript": "^5.8.3",
|
|
59
|
+
"typescript-eslint": "^8.33.0"
|
|
60
|
+
}
|
|
61
|
+
}
|