@@ -27,8 +27,8 @@ function ensure<T, K extends keyof T>(target: T, key: K): T[K] {
2727 return target [ key ] ;
2828}
2929
30- type LSPObject = { [ key : string ] : LSPAny } ;
31- type LSPArray = LSPAny [ ] ;
30+ type $ LSPObject = { [ key : string ] : LSPAny } ;
31+ type $ LSPArray = LSPAny [ ] ;
3232
3333namespace Converter {
3434 export namespace c2p {
@@ -48,7 +48,7 @@ namespace Converter {
4848 export function asNotebookCells ( cells : vscode . NotebookCell [ ] , base : _c2p . Converter ) : proto . NotebookCell [ ] {
4949 return cells . map ( cell => asNotebookCell ( cell , base ) ) ;
5050 }
51- export function asMetadata ( metadata : { [ key : string ] : any } ) : LSPObject {
51+ export function asMetadata ( metadata : { [ key : string ] : any } ) : $ LSPObject {
5252 const seen : Set < any > = new Set ( ) ;
5353 return deepCopy ( seen , metadata ) ;
5454 }
@@ -73,14 +73,14 @@ namespace Converter {
7373 return proto . NotebookCellKind . Code ;
7474 }
7575 }
76- function deepCopy ( seen : Set < any > , value : { [ key : string ] : any } ) : LSPObject ;
77- function deepCopy ( seen : Set < any > , value : any [ ] ) : LSPArray ;
78- function deepCopy ( seen : Set < any > , value : { [ key : string ] : any } | any [ ] ) : LSPArray | LSPObject {
76+ function deepCopy ( seen : Set < any > , value : { [ key : string ] : any } ) : $ LSPObject;
77+ function deepCopy ( seen : Set < any > , value : any [ ] ) : $ LSPArray;
78+ function deepCopy ( seen : Set < any > , value : { [ key : string ] : any } | any [ ] ) : $ LSPArray | $ LSPObject {
7979 if ( seen . has ( value ) ) {
8080 throw new Error ( `Can't deep copy cyclic structures.` ) ;
8181 }
8282 if ( Array . isArray ( value ) ) {
83- const result : LSPArray = [ ] ;
83+ const result : $ LSPArray = [ ] ;
8484 for ( const elem of value ) {
8585 if ( elem !== null && typeof elem === 'object' || Array . isArray ( elem ) ) {
8686 result . push ( deepCopy ( seen , elem ) ) ;
@@ -94,7 +94,7 @@ namespace Converter {
9494 return result ;
9595 } else {
9696 const props = Object . keys ( value ) ;
97- const result : LSPObject = Object . create ( null ) ;
97+ const result : $ LSPObject = Object . create ( null ) ;
9898 for ( const prop of props ) {
9999 const elem = value [ prop ] ;
100100 if ( elem !== null && typeof elem === 'object' || Array . isArray ( elem ) ) {
@@ -258,7 +258,7 @@ namespace $NotebookCell {
258258 }
259259 for ( let i = 0 ; i < oneKeys . length ; i ++ ) {
260260 const prop = oneKeys [ i ] ;
261- if ( ! equalsMetadata ( ( one as LSPObject ) [ prop ] , ( other as LSPObject ) [ prop ] ) ) {
261+ if ( ! equalsMetadata ( ( one as $ LSPObject) [ prop ] , ( other as $ LSPObject) [ prop ] ) ) {
262262 return false ;
263263 }
264264 }
0 commit comments