refactor: replace rfdc with native structuredClone

This commit is contained in:
2024-04-03 11:14:47 +02:00
committed by Rainer Killinger
parent 622481a3c9
commit 53c3d0ba0c
13 changed files with 33 additions and 70 deletions

View File

@@ -13,7 +13,6 @@
* this program. If not, see <https://www.gnu.org/licenses/>.
*/
import {expect} from 'chai';
import clone from 'rfdc';
import {SCThingRemoteOrigin} from '../src/index.js';
import {SCDishMeta} from '../src/index.js';
import {SCThingTranslator} from '../src/index.js';
@@ -164,7 +163,7 @@ describe('Translator', function () {
it('should omit LRU cache with changed source', function () {
const translatorDE = new SCThingTranslator('de');
const dishCopy = clone()(dish);
const dishCopy = structuredClone(dish);
const translatedDish = translatorDE.translatedAccess(dish);
const destructivelyTranslatedDish = translatorDE.translate(dish);
@@ -224,7 +223,7 @@ describe('MetaTranslator', function () {
});
it('should translate thing without meta class', function () {
const dishCopy = clone()(dish);
const dishCopy = structuredClone(dish);
const typeNonExistent = eval("(x) => x + 'typeNonExistent';");
// this will assign a non-existent SCThingType to dishCopy
dishCopy.type = typeNonExistent();