@pdg/data 1.0.6 → 1.0.7
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 +3 -3
- package/dist/index.js +3 -3
- package/dist/makeConst.d.ts +2 -2
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -84,14 +84,14 @@ function _makeConst(name, items) {
|
|
|
84
84
|
return Object.assign(Object.assign({}, aliasValueMap), { getLabel(value) {
|
|
85
85
|
return valueLabelMap[value];
|
|
86
86
|
},
|
|
87
|
-
getList(
|
|
88
|
-
return
|
|
87
|
+
getList() {
|
|
88
|
+
return [...list];
|
|
89
89
|
},
|
|
90
90
|
getNvList() {
|
|
91
91
|
return nvList.map((item) => (Object.assign({}, item)));
|
|
92
92
|
},
|
|
93
93
|
getLvList(extraPreItems) {
|
|
94
|
-
return [...(extraPreItems || []), ...lvList];
|
|
94
|
+
return [...(extraPreItems || []), ...lvList.map((item) => (Object.assign({}, item)))];
|
|
95
95
|
} });
|
|
96
96
|
}
|
|
97
97
|
function makeConst(nameOrItems, itemsOrUndefined) {
|
package/dist/index.js
CHANGED
|
@@ -84,14 +84,14 @@ function _makeConst(name, items) {
|
|
|
84
84
|
return Object.assign(Object.assign({}, aliasValueMap), { getLabel(value) {
|
|
85
85
|
return valueLabelMap[value];
|
|
86
86
|
},
|
|
87
|
-
getList(
|
|
88
|
-
return
|
|
87
|
+
getList() {
|
|
88
|
+
return [...list];
|
|
89
89
|
},
|
|
90
90
|
getNvList() {
|
|
91
91
|
return nvList.map((item) => (Object.assign({}, item)));
|
|
92
92
|
},
|
|
93
93
|
getLvList(extraPreItems) {
|
|
94
|
-
return [...(extraPreItems || []), ...lvList];
|
|
94
|
+
return [...(extraPreItems || []), ...lvList.map((item) => (Object.assign({}, item)))];
|
|
95
95
|
} });
|
|
96
96
|
}
|
|
97
97
|
function makeConst(nameOrItems, itemsOrUndefined) {
|
package/dist/makeConst.d.ts
CHANGED
|
@@ -34,7 +34,7 @@ type MakeLabelValueMap<Items extends TItems> = Items extends readonly (infer Ite
|
|
|
34
34
|
/********************************************************************************************************************
|
|
35
35
|
* getLvList
|
|
36
36
|
* ******************************************************************************************************************/
|
|
37
|
-
declare function makeConst<StringValue extends string, NumberValue extends number, Label extends string, Alias extends string, const Items extends readonly (readonly [StringValue, Label])[] | readonly (readonly [StringValue | NumberValue, Label, Alias])[], AliasValueMap = MakeAliasValueMap<Items>, ValueLabelMap = MakeValueLabelMap<Items>, ValueList = Items[number][0][], LabelValueMap = MakeLabelValueMap<Items>, ValueType = Items[number][0], GetLabel = <T extends keyof ValueLabelMap>(value: T) => ValueLabelMap[T], GetList = (
|
|
37
|
+
declare function makeConst<StringValue extends string, NumberValue extends number, Label extends string, Alias extends string, const Items extends readonly (readonly [StringValue, Label])[] | readonly (readonly [StringValue | NumberValue, Label, Alias])[], AliasValueMap = MakeAliasValueMap<Items>, ValueLabelMap = MakeValueLabelMap<Items>, ValueList = Items[number][0][], LabelValueMap = MakeLabelValueMap<Items>, ValueType = Items[number][0], GetLabel = <T extends keyof ValueLabelMap>(value: T) => ValueLabelMap[T], GetList = () => ValueList, GetLvList = <LvValue extends string | number, LvLabel extends string, LvItems extends readonly {
|
|
38
38
|
value: LvValue;
|
|
39
39
|
label: LvLabel;
|
|
40
40
|
}[]>(items?: LvItems) => [...ReadonlyArray<LabelValueMap>, ...(IsArray<LvItems> extends true ? LvItems : [])], Result = AliasValueMap & {
|
|
@@ -43,7 +43,7 @@ declare function makeConst<StringValue extends string, NumberValue extends numbe
|
|
|
43
43
|
getList: GetList;
|
|
44
44
|
getLvList: GetLvList;
|
|
45
45
|
}>(items: Items): Result;
|
|
46
|
-
declare function makeConst<Name extends string, StringValue extends string, NumberValue extends number, Label extends string, Alias extends string, const Items extends readonly (readonly [StringValue, Label])[] | readonly (readonly [StringValue | NumberValue, Label, Alias])[], AliasValueMap = MakeAliasValueMap<Items>, ValueLabelMap = MakeValueLabelMap<Items>, ValueList = Items[number][0][], NameValueList = MakeNameValueList<Name, Items>, LabelValueMap = MakeLabelValueMap<Items>, ValueType = Items[number][0], GetLabel = <T extends keyof ValueLabelMap>(value: T) => ValueLabelMap[T], GetList = (
|
|
46
|
+
declare function makeConst<Name extends string, StringValue extends string, NumberValue extends number, Label extends string, Alias extends string, const Items extends readonly (readonly [StringValue, Label])[] | readonly (readonly [StringValue | NumberValue, Label, Alias])[], AliasValueMap = MakeAliasValueMap<Items>, ValueLabelMap = MakeValueLabelMap<Items>, ValueList = Items[number][0][], NameValueList = MakeNameValueList<Name, Items>, LabelValueMap = MakeLabelValueMap<Items>, ValueType = Items[number][0], GetLabel = <T extends keyof ValueLabelMap>(value: T) => ValueLabelMap[T], GetList = () => ValueList, GetNvList = () => NameValueList, GetLvList = <LvValue extends string | number, LvLabel extends string, LvItems extends readonly {
|
|
47
47
|
value: LvValue;
|
|
48
48
|
label: LvLabel;
|
|
49
49
|
}[]>(items?: LvItems) => [...ReadonlyArray<LabelValueMap>, ...(IsArray<LvItems> extends true ? LvItems : [])], Result = AliasValueMap & {
|