mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-21 17:12:43 +00:00
refactor: replace rfdc with native structuredClone
This commit is contained in:
@@ -14,7 +14,6 @@
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import equal from 'fast-deep-equal/es6/index.js';
|
||||
import clone from 'rfdc';
|
||||
import {SCLanguageCode} from './general/i18n.js';
|
||||
import {isThing} from './guards.js';
|
||||
import {SCClasses} from './meta.js';
|
||||
@@ -223,7 +222,7 @@ export class SCThingTranslator {
|
||||
return cachedInstance as T;
|
||||
}
|
||||
}
|
||||
const translatedInstance = this.translateThingInPlaceDestructively(clone()(thing));
|
||||
const translatedInstance = this.translateThingInPlaceDestructively(structuredClone(thing));
|
||||
delete translatedInstance.translations;
|
||||
this.cache.putObject(translatedInstance);
|
||||
this.sourceCache.putObject(thing);
|
||||
@@ -254,7 +253,7 @@ export class SCThingTranslator {
|
||||
return this.deeptranslate((objectTranslatedFromCache as any)[key]);
|
||||
}
|
||||
}
|
||||
const objectTranslated = this.translateThingInPlaceDestructively(clone()(object));
|
||||
const objectTranslated = this.translateThingInPlaceDestructively(structuredClone(object));
|
||||
this.cache.putObject(objectTranslated);
|
||||
this.sourceCache.putObject(thing);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user