File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -506,7 +506,7 @@ describe('getManifestSearchService', () => {
506506 } ) ;
507507
508508 it ( 'supports v1 of the search spec' , ( ) => {
509- const v1 = JSON . parse ( JSON . stringify ( manifestFixtureFg165hz3589 ) ) ;
509+ const v1 = structuredClone ( manifestFixtureFg165hz3589 ) ;
510510 v1 . service [ 0 ] . profile = 'http://iiif.io/api/search/1/search' ;
511511 const state = { manifests : { x : { json : v1 } } } ;
512512 expect ( getManifestSearchService ( state , { manifestId : 'x' } ) . id ) . toEqual ( 'https://contentsearch.stanford.edu/fg165hz3589/search' ) ;
@@ -525,7 +525,7 @@ describe('getManifestAutocompleteService', () => {
525525 } ) ;
526526
527527 it ( 'supports v1 of the search spec' , ( ) => {
528- const v1 = JSON . parse ( JSON . stringify ( manifestFixtureFg165hz3589 ) ) ;
528+ const v1 = structuredClone ( manifestFixtureFg165hz3589 ) ;
529529 v1 . service [ 0 ] . profile = 'http://iiif.io/api/search/1/search' ;
530530 v1 . service [ 0 ] . service . profile = 'http://iiif.io/api/search/1/autocomplete' ;
531531 const state = { manifests : { x : { json : v1 } } } ;
Original file line number Diff line number Diff line change @@ -9,8 +9,8 @@ import { getConfig } from './config';
99/** */
1010function createManifestoInstance ( json , locale ) {
1111 if ( ! json ) return undefined ;
12- // Use JSON stringify/parse to create a deep copy and prevent Manifesto from mutating the json
13- const manifestoObject = Utils . parseManifest ( JSON . parse ( JSON . stringify ( json ) ) , locale ? { locale } : undefined ) ;
12+ // Use structuredClone to create a deep copy and prevent Manifesto from mutating the json
13+ const manifestoObject = Utils . parseManifest ( structuredClone ( json ) , locale ? { locale } : undefined ) ;
1414 // Local patching of Manifesto so that when its a Collection, it behaves similarly
1515 if ( typeof manifestoObject . getSequences != 'function' ) {
1616 manifestoObject . getSequences = ( ) => [ ] ;
You can’t perform that action at this time.
0 commit comments