Pārlūkot izejas kodu

Always use mjs imports

This is needed for Node/NPM 16 compat
Thomas Weißschuh 3 gadi atpakaļ
vecāks
revīzija
cfc29ef821

+ 1 - 1
src/core/errors/index.mjs

@@ -1,6 +1,6 @@
 import OperationError from "./OperationError.mjs";
 import DishError from "./DishError.mjs";
-import ExcludedOperationError from "./ExcludedOperationError";
+import ExcludedOperationError from "./ExcludedOperationError.mjs";
 
 export {
     OperationError,

+ 2 - 2
src/node/config/scripts/generateNodeIndex.mjs

@@ -41,7 +41,7 @@ let code = `/**
 import NodeDish from "./NodeDish.mjs";
 import { _wrap, help, bake, _explainExcludedFunction } from "./api.mjs";
 import File from "./File.mjs";
-import { OperationError, DishError, ExcludedOperationError } from "../core/errors/index";
+import { OperationError, DishError, ExcludedOperationError } from "../core/errors/index.mjs";
 import {
     // import as core_ to avoid name clashes after wrap.
 `;
@@ -52,7 +52,7 @@ includedOperations.forEach((op) => {
 });
 
 code +=`
-} from "../core/operations/index";
+} from "../core/operations/index.mjs";
 
 global.File = File;
 

+ 1 - 1
tests/node/tests/operations.mjs

@@ -32,7 +32,7 @@ import {
     CSSMinify,
     toBase64,
     toHex
-} from "../../../src/node/index";
+} from "../../../src/node/index.mjs";
 import chef from "../../../src/node/index.mjs";
 import TestRegister from "../../lib/TestRegister.mjs";
 import File from "../../../src/node/File.mjs";

+ 1 - 1
tests/operations/tests/AvroToJSON.mjs

@@ -6,7 +6,7 @@
  * @license Apache-2.0
  */
 
-import TestRegister from "../../lib/TestRegister";
+import TestRegister from "../../lib/TestRegister.mjs";
 
 TestRegister.addTests([
     {

+ 2 - 2
tests/operations/tests/BaconCipher.mjs

@@ -5,8 +5,8 @@
  * @copyright Karsten Silkenbäumer 2019
  * @license Apache-2.0
  */
-import TestRegister from "../../lib/TestRegister";
-import { BACON_ALPHABETS, BACON_TRANSLATIONS } from "../../../src/core/lib/Bacon";
+import TestRegister from "../../lib/TestRegister.mjs";
+import { BACON_ALPHABETS, BACON_TRANSLATIONS } from "../../../src/core/lib/Bacon.mjs";
 
 const alphabets = Object.keys(BACON_ALPHABETS);
 const translations = BACON_TRANSLATIONS;