File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { 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 }
You can’t perform that action at this time.
0 commit comments