File tree Expand file tree Collapse file tree 3 files changed +4
-7
lines changed Expand file tree Collapse file tree 3 files changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -62,8 +62,7 @@ export class File implements Printable {
6262 constructor ( public readonly model : Model , public readonly log : PatchLog ) { }
6363
6464 public serialize ( params : types . FileSerializeParams = { } ) : types . FileWriteSequence {
65- if ( params . noView && ( params . model === 'sidecar' ) )
66- throw new Error ( 'SIDECAR_MODEL_WITHOUT_VIEW' ) ;
65+ if ( params . noView && params . model === 'sidecar' ) throw new Error ( 'SIDECAR_MODEL_WITHOUT_VIEW' ) ;
6766 const metadata : types . FileMetadata = [ { } , FileModelEncoding . Auto ] ;
6867 let model : Uint8Array | unknown | null = null ;
6968 const modelFormat = params . model ?? 'sidecar' ;
Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ describe('.toBinary()', () => {
9090 for ( const model of modelFormats ) {
9191 for ( const history of historyFormats ) {
9292 for ( const noView of noViews ) {
93- if ( noView && ( model === 'sidecar' ) ) continue ;
93+ if ( noView && model === 'sidecar' ) continue ;
9494 const params = { format, model, history, noView} ;
9595 test ( JSON . stringify ( params ) , ( ) => {
9696 const { file} = setup ( { foo : 'bar' } ) ;
Original file line number Diff line number Diff line change @@ -36,10 +36,8 @@ export const decodeSeqCborComponents = (blob: Uint8Array): unknown[] => {
3636export const decodeModel = ( serialized : unknown ) : Model => {
3737 if ( ! serialized ) throw new Error ( 'NO_MODEL' ) ;
3838 if ( serialized instanceof Uint8Array ) return Model . fromBinary ( serialized ) ;
39- if ( Array . isArray ( serialized ) )
40- return new StructuralDecoderCompact ( ) . decode ( < JsonCrdtCompactDocument > serialized ) ;
41- if ( typeof serialized === 'object' )
42- return new StructuralDecoderVerbose ( ) . decode ( < JsonCrdtVerboseDocument > serialized ) ;
39+ if ( Array . isArray ( serialized ) ) return new StructuralDecoderCompact ( ) . decode ( < JsonCrdtCompactDocument > serialized ) ;
40+ if ( typeof serialized === 'object' ) return new StructuralDecoderVerbose ( ) . decode ( < JsonCrdtVerboseDocument > serialized ) ;
4341 throw new Error ( 'UNKNOWN_MODEL' ) ;
4442} ;
4543
You can’t perform that action at this time.
0 commit comments