Skip to content

Commit 6ad2c34

Browse files
committed
Change AllowedValue in helper to PlainValue
1 parent fe58218 commit 6ad2c34

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

build/ts/helpers/shared.struct_helper.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import {Value} from "../pb/shared.struct_pb.js";
22

3-
type AllowedValue = null | number | string | boolean | Array<AllowedValue> | object;
3+
export type PlainValue = null | number | string | boolean | Array<PlainValue> | object;
44

5-
export function toAllowedValue(value: Value): AllowedValue {
5+
export function toAllowedValue(value: Value): PlainValue {
66
switch (value.kind.oneofKind) {
77
case "nullValue":
88
return null;
@@ -15,7 +15,7 @@ export function toAllowedValue(value: Value): AllowedValue {
1515
case "listValue":
1616
return value.kind.listValue.values.map(toAllowedValue);
1717
case "structValue":
18-
const obj: {[key: string]: AllowedValue} = {};
18+
const obj: {[key: string]: PlainValue} = {};
1919
for (const [k, v] of Object.entries(value.kind.structValue.fields)) {
2020
obj[k] = toAllowedValue(v);
2121
}
@@ -26,7 +26,7 @@ export function toAllowedValue(value: Value): AllowedValue {
2626
}
2727

2828

29-
export function constructValue(value: AllowedValue): Value {
29+
export function constructValue(value: PlainValue): Value {
3030
if (value === null) {
3131
return {kind: {oneofKind: "nullValue", nullValue: 0}};
3232
}

0 commit comments

Comments
 (0)