Improve CJS and ESM module support #1037

This commit is contained in:
n1474335 2022-03-28 10:52:28 +01:00
parent 78a1827af8
commit 75dba51f56
6 changed files with 29 additions and 47 deletions

View file

@ -7,8 +7,28 @@
*/
import assert from "assert";
import chef from "cyberchef";
import { bake, toHex, reverse, unique, multiply } from "cyberchef";
const d = chef.bake("Testing, 1 2 3", [
const a = bake("Testing, 1 2 3", [
toHex,
reverse,
{
op: unique,
args: {
delimiter: "Space",
}
},
{
op: multiply,
args: {
delimiter: "Space",
}
}
]);
assert.equal(a.value, "630957449041920");
const b = chef.bake("Testing, 1 2 3", [
chef.toHex,
chef.reverse,
{
@ -25,4 +45,4 @@ const d = chef.bake("Testing, 1 2 3", [
}
]);
assert.equal(d.value, "630957449041920");
assert.equal(b.value, "630957449041920");