diff --git a/argon2.d.ts b/argon2.d.mts
similarity index 96%
rename from argon2.d.ts
rename to argon2.d.mts
index 0e7bc7a..6c52040 100644
--- a/argon2.d.ts
+++ b/argon2.d.mts
@@ -1,5 +1,3 @@
-// Type definitions for argon2 v0.19.2
-
///
export const argon2d: 0;
diff --git a/argon2.js b/argon2.mjs
similarity index 62%
rename from argon2.js
rename to argon2.mjs
index 0e6cfa2..d0caf08 100644
--- a/argon2.js
+++ b/argon2.mjs
@@ -1,39 +1,45 @@
-"use strict";
-const assert = require("assert");
-const { randomBytes, timingSafeEqual } = require("crypto");
-const path = require("path");
-const { promisify } = require("util");
-const binary = require("@mapbox/node-pre-gyp");
-
-const bindingPath = binary.find(path.resolve(__dirname, "./package.json"));
+import assert from "node:assert/strict";
+import { randomBytes, timingSafeEqual } from "node:crypto";
+import { createRequire } from "node:module";
+import { fileURLToPath } from "node:url";
+import { promisify } from "node:util";
+import nodePreGyp from "@mapbox/node-pre-gyp";
+import { deserialize, serialize } from "@phc/format";
+
+const packageJson = fileURLToPath(new URL("./package.json", import.meta.url));
+const bindingPath = nodePreGyp.find(packageJson);
+
+const require = createRequire(import.meta.url);
const { hash: _hash } = require(bindingPath);
-const { deserialize, serialize } = require("@phc/format");
+export const argon2d = 0;
+export const argon2i = 1;
+export const argon2id = 2;
-const types = Object.freeze({ argon2d: 0, argon2i: 1, argon2id: 2 });
-
-const defaults = Object.freeze({
+export const defaults = Object.freeze({
hashLength: 32,
saltLength: 16,
timeCost: 3,
- memoryCost: 1 << 16,
+ memoryCost: 2 ** 16,
parallelism: 4,
- type: types.argon2id,
+ type: argon2id,
version: 0x13,
});
-const limits = Object.freeze({
+export const limits = Object.freeze({
hashLength: { min: 4, max: 2 ** 32 - 1 },
- memoryCost: { min: 1 << 10, max: 2 ** 32 - 1 },
+ memoryCost: { min: 2 ** 10, max: 2 ** 32 - 1 },
timeCost: { min: 2, max: 2 ** 32 - 1 },
parallelism: { min: 1, max: 2 ** 24 - 1 },
});
-const names = Object.freeze({
- [types.argon2d]: "argon2d",
- [types.argon2i]: "argon2i",
- [types.argon2id]: "argon2id",
-});
+const names = {
+ [argon2d]: "argon2d",
+ [argon2i]: "argon2i",
+ [argon2id]: "argon2id",
+};
+
+const types = { argon2d, argon2i, argon2id };
const bindingsHash = promisify(_hash);
const generateSalt = promisify(randomBytes);
@@ -48,7 +54,7 @@ const assertLimits =
);
};
-const hash = async (plain, { raw, salt, ...options } = {}) => {
+export const hash = async (plain, { raw, salt, ...options } = {}) => {
options = { ...defaults, ...options };
Object.entries(limits).forEach(assertLimits(options));
@@ -77,7 +83,7 @@ const hash = async (plain, { raw, salt, ...options } = {}) => {
});
};
-const needsRehash = (digest, options) => {
+export const needsRehash = (digest, options) => {
const { memoryCost, timeCost, version } = { ...defaults, ...options };
const {
@@ -87,13 +93,14 @@ const needsRehash = (digest, options) => {
return +v !== +version || +m !== +memoryCost || +t !== +timeCost;
};
-const verify = async (digest, plain, options) => {
+export const verify = async (digest, plain, options) => {
const obj = deserialize(digest);
// Only these have the "params" key, so if the password was encoded
// using any other method, the destructuring throws an error
- if (!(obj.id in types)) {
- return false;
- }
+ assert(
+ obj.id in types,
+ `Invalid type, must be one of: ${Object.keys(types).join(", ")}`,
+ );
const {
id,
@@ -117,5 +124,3 @@ const verify = async (digest, plain, options) => {
hash,
);
};
-
-module.exports = { defaults, limits, hash, needsRehash, verify, ...types };
diff --git a/package.json b/package.json
index c74002e..e22a4e4 100644
--- a/package.json
+++ b/package.json
@@ -2,10 +2,30 @@
"name": "argon2",
"version": "0.31.2",
"description": "An Argon2 library for Node",
- "main": "argon2.js",
+ "keywords": [
+ "argon2",
+ "crypto",
+ "encryption",
+ "hashing",
+ "password"
+ ],
+ "homepage": "https://github.com/ranisalt/node-argon2#readme",
+ "bugs": {
+ "url": "https://github.com/ranisalt/node-argon2/issues"
+ },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/ranisalt/node-argon2.git"
+ },
+ "license": "MIT",
+ "author": "Ranieri Althoff ",
+ "type": "module",
+ "main": "argon2.mjs",
+ "module": "argon2.mjs",
+ "types": "argon2.d.mts",
"files": [
"argon2_node.cpp",
- "argon2.d.ts",
+ "argon2.d.mts",
"binding.gyp",
"argon2/CHANGELOG.md",
"argon2/LICENSE",
@@ -21,30 +41,22 @@
"argon2/src/thread.c",
"argon2/src/thread.h"
],
- "types": "argon2.d.ts",
+ "binary": {
+ "module_name": "argon2",
+ "module_path": "./lib/binding/napi-v{napi_build_version}",
+ "remote_path": "v{version}",
+ "package_name": "{module_name}-v{version}-napi-v{napi_build_version}-{platform}-{arch}-{libc}.tar.gz",
+ "host": "https://github.com/ranisalt/node-argon2/releases/download/",
+ "napi_versions": [
+ 3
+ ]
+ },
"scripts": {
+ "format": "prettier --write \"**/*.{json,mjs,mts}\"",
"install": "node-pre-gyp install --fallback-to-build",
- "format": "prettier --write \"**/*.{js,json,ts}\"",
- "test": "c8 mocha --timeout 5000 test/test.js",
- "test:ts": "tsc -p . && node test/test-d.js"
- },
- "repository": {
- "type": "git",
- "url": "https://github.com/ranisalt/node-argon2.git"
+ "test": "c8 node --test test.mjs",
+ "test:ts": "tsc -p ."
},
- "keywords": [
- "argon2",
- "crypto",
- "encryption",
- "hashing",
- "password"
- ],
- "author": "Ranieri Althoff ",
- "license": "MIT",
- "bugs": {
- "url": "https://github.com/ranisalt/node-argon2/issues"
- },
- "homepage": "https://github.com/ranisalt/node-argon2#readme",
"dependencies": {
"@mapbox/node-pre-gyp": "^1.0.11",
"@phc/format": "^1.0.0",
@@ -53,32 +65,21 @@
"devDependencies": {
"@types/node": "^20.8.10",
"c8": "^8.0.1",
- "mocha": "^10.2.0",
"node-gyp": "^10.0.1",
"prettier": "^3.0.0",
"typescript": "^5.1.6"
},
- "binary": {
- "module_name": "argon2",
- "module_path": "./lib/binding/napi-v{napi_build_version}",
- "host": "https://github.com/ranisalt/node-argon2/releases/download/",
- "remote_path": "v{version}",
- "package_name": "{module_name}-v{version}-napi-v{napi_build_version}-{platform}-{arch}-{libc}.tar.gz",
- "napi_versions": [
- 3
- ]
- },
"engines": {
"node": ">=14.0.0"
},
+ "collective": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/node-argon2"
+ },
"standard": {
"env": "mocha",
"ignore": [
"test/test-d.js"
]
- },
- "collective": {
- "type": "opencollective",
- "url": "https://opencollective.com/node-argon2"
}
}
diff --git a/test/test-d.ts b/test-d.mts
similarity index 98%
rename from test/test-d.ts
rename to test-d.mts
index 2bf96de..b46ade8 100644
--- a/test/test-d.ts
+++ b/test-d.mts
@@ -3,7 +3,7 @@
///
-import * as argon2 from "../argon2";
+import * as argon2 from "./argon2.mjs";
const password = "password";
const passwordBuffer = Buffer.from("password");
diff --git a/test.mjs b/test.mjs
new file mode 100644
index 0000000..4d668ca
--- /dev/null
+++ b/test.mjs
@@ -0,0 +1,259 @@
+import assert from "node:assert/strict";
+import { describe, it } from "node:test";
+import * as argon2 from "./argon2.mjs";
+
+const { argon2i, argon2d, argon2id } = argon2;
+const password = "password";
+const salt = Buffer.alloc(16, "salt");
+const associatedData = Buffer.alloc(16, "ad");
+const secret = Buffer.alloc(16, "secret");
+
+// hashes for argon2i and argon2d with default options
+const hashes = Object.freeze({
+ argon2id:
+ "$argon2id$v=19$m=65536,t=3,p=4$c2FsdHNhbHRzYWx0c2FsdA$rBWULD5jOGpQy32rLvGcmvQMVqIVNAmrCtekWvUA8bw",
+ withNull:
+ "$argon2id$v=19$m=65536,t=3,p=4$c2FsdHNhbHRzYWx0c2FsdA$NqchDOxwWbcBzA+0gtsCtyspEQxqKFf4/PO/AoIvo+Q",
+ withAd:
+ "$argon2id$v=19$m=65536,t=3,p=4,data=YWRhZGFkYWRhZGFkYWRhZA$c2FsdHNhbHRzYWx0c2FsdA$TEIIM4GBSUxvMLolL9ePXYP5G/qcr0vywQqqm/ILvsM",
+ withSecret:
+ "$argon2id$v=19$m=65536,t=3,p=4$c2FsdHNhbHRzYWx0c2FsdA$8dZyo1MdHgdzBm+VU7+tyW06dUO7B9FyaPImH5ejVOU",
+ argon2i:
+ "$argon2i$v=19$m=65536,t=3,p=4$c2FsdHNhbHRzYWx0c2FsdA$1Ccmp7ECb+Rb5XPjqRwEuAjCufY1xQDOJwnHrB+orZ4",
+ argon2d:
+ "$argon2d$v=19$m=65536,t=3,p=4$c2FsdHNhbHRzYWx0c2FsdA$VtxJNl5Jr/yZ2UIhvfvL4sGPdDQyGCcy45Cs7rIdFq8",
+ rawArgon2id: Buffer.from(
+ "ac15942c3e63386a50cb7dab2ef19c9af40c56a2153409ab0ad7a45af500f1bc",
+ "hex",
+ ),
+ rawWithNull: Buffer.from(
+ "36a7210cec7059b701cc0fb482db02b72b29110c6a2857f8fcf3bf02822fa3e4",
+ "hex",
+ ),
+ rawArgon2i: Buffer.from(
+ "d42726a7b1026fe45be573e3a91c04b808c2b9f635c500ce2709c7ac1fa8ad9e",
+ "hex",
+ ),
+ rawArgon2d: Buffer.from(
+ "56dc49365e49affc99d94221bdfbcbe2c18f743432182732e390aceeb21d16af",
+ "hex",
+ ),
+ oldFormat:
+ "$argon2i$m=4096,t=3,p=1$tbagT6b1YH33niCo9lVzuA$htv/k+OqWk1V9zD9k5DOBi2kcfcZ6Xu3tWmwEPV3/nc",
+});
+
+describe("hash", () => {
+ it("hash with argon2i", async () => {
+ const hash = await argon2.hash(password, { type: argon2i, salt });
+ assert.equal(hashes.argon2i, hash);
+ });
+
+ it("argon2i with raw hash", async () => {
+ const hash = await argon2.hash(password, {
+ type: argon2i,
+ raw: true,
+ salt,
+ });
+ assert(hashes.rawArgon2i.equals(hash));
+ });
+
+ it("hash with argon2d", async () => {
+ const hash = await argon2.hash(password, { type: argon2d, salt });
+ assert.equal(hashes.argon2d, hash);
+ });
+
+ it("argon2d with raw hash", async () => {
+ const hash = await argon2.hash(password, {
+ type: argon2d,
+ raw: true,
+ salt,
+ });
+ assert(hashes.rawArgon2d.equals(hash));
+ });
+
+ it("hash with argon2id", async () => {
+ const hash = await argon2.hash(password, { type: argon2id, salt });
+ assert.equal(hashes.argon2id, hash);
+ });
+
+ it("argon2id with raw hash", async () => {
+ const hash = await argon2.hash(password, {
+ type: argon2id,
+ raw: true,
+ salt,
+ });
+ assert(hashes.rawArgon2id.equals(hash));
+ });
+
+ it("with null in password", async () => {
+ const hash = await argon2.hash("pass\0word", { salt });
+ assert.equal(hashes.withNull, hash);
+ });
+
+ it("with raw hash, null in password", async () => {
+ const hash = await argon2.hash("pass\0word", { raw: true, salt });
+ assert(hashes.rawWithNull.equals(hash));
+ });
+
+ it("with associated data", async () => {
+ const hash = await argon2.hash(password, { associatedData, salt });
+ assert.equal(hashes.withAd, hash);
+ });
+
+ it("with secret", async () => {
+ const hash = await argon2.hash(password, { secret, salt });
+ assert.equal(hashes.withSecret, hash);
+ });
+});
+
+describe("set options", () => {
+ it("hash with time cost", async () => {
+ const hash = await argon2.hash(password, { timeCost: 4 });
+ assert(/t=4/.test(hash));
+ });
+
+ it("hash with low time cost", async () => {
+ await assert.rejects(argon2.hash(password, { timeCost: 1 }), {
+ message: /invalid timeCost.+between \d+ and \d+/i,
+ });
+ });
+
+ it("hash with high time cost", async () => {
+ await assert.rejects(argon2.hash(password, { timeCost: 2 ** 32 }), {
+ message: /invalid timeCost.+between \d+ and \d+/i,
+ });
+ });
+
+ it("hash with hash length", async () => {
+ // 4 bytes ascii == 6 bytes base64
+ const hash = await argon2.hash(password, { hashLength: 4 });
+ assert(/\$[^$]{6}$/.test(hash));
+ });
+
+ it("hash with low hash length", async () => {
+ await assert.rejects(argon2.hash(password, { hashLength: 3 }), {
+ message: /invalid hashLength.+between \d+ and \d+/i,
+ });
+ });
+
+ it("hash with high hash length", async () => {
+ await assert.rejects(argon2.hash(password, { hashLength: 2 ** 32 }), {
+ message: /invalid hashLength.+between \d+ and \d+/i,
+ });
+ });
+
+ it("hash with memory cost", async () => {
+ const hash = await argon2.hash(password, { memoryCost: 8192 });
+ assert(/m=8192/.test(hash));
+ });
+
+ it("hash with low memory cost", async () => {
+ await assert.rejects(argon2.hash(password, { memoryCost: 2 ** 9 }), {
+ message: /invalid memoryCost.+between \d+ and \d+/i,
+ });
+ });
+
+ it("hash with high memory cost", async () => {
+ await assert.rejects(argon2.hash(password, { memoryCost: 2 ** 9 }), {
+ message: /invalid memoryCost.+between \d+ and \d+/i,
+ });
+ });
+
+ it("hash with parallelism", async () => {
+ const hash = await argon2.hash(password, { parallelism: 2 });
+ assert(/p=2/.test(hash));
+ });
+
+ it("hash with low parallelism", async () => {
+ await assert.rejects(argon2.hash(password, { parallelism: 0 }), {
+ message: /invalid parallelism.+between \d+ and \d+/i,
+ });
+ });
+
+ it("hash with high parallelism", async () => {
+ await assert.rejects(argon2.hash(password, { parallelism: 2 ** 24 }), {
+ message: /invalid parallelism.+between \d+ and \d+/i,
+ });
+ });
+
+ it("hash with all options", async () => {
+ const hash = await argon2.hash(password, {
+ timeCost: 4,
+ memoryCost: 8192,
+ parallelism: 2,
+ });
+ assert(/m=8192,t=4,p=2/.test(hash));
+ });
+});
+
+describe("needsRehash", () => {
+ it("needs rehash old version", async () => {
+ const hash = await argon2.hash(password, { version: 0x10 });
+ assert(argon2.needsRehash(hash));
+ assert(!argon2.needsRehash(hash, { version: 0x10 }));
+ });
+
+ it("needs rehash low memory cost", async () => {
+ const hash = await argon2.hash(password, { memoryCost: 2 ** 15 });
+ assert(argon2.needsRehash(hash));
+ assert(!argon2.needsRehash(hash, { memoryCost: 2 ** 15 }));
+ });
+
+ it("needs rehash low time cost", async () => {
+ const hash = await argon2.hash(password, { timeCost: 2 });
+ assert(argon2.needsRehash(hash));
+ assert(!argon2.needsRehash(hash, { timeCost: 2 }));
+ });
+});
+
+describe("verify", () => {
+ it("verify correct password", async () => {
+ const hash = await argon2.hash(password);
+ assert(await argon2.verify(hash, password));
+ });
+
+ it("verify wrong password", async () => {
+ const hash = await argon2.hash(password);
+ assert(!(await argon2.verify(hash, "passworld")));
+ });
+
+ it("verify with null in password", async () => {
+ const hash = await argon2.hash("pass\0word");
+ assert(await argon2.verify(hash, "pass\0word"));
+ });
+
+ it("verify with associated data", async () => {
+ const hash = await argon2.hash(password, { associatedData });
+ assert(await argon2.verify(hash, "password"));
+ });
+
+ it("verify with secret", async () => {
+ const hash = await argon2.hash(password, { secret });
+ assert(await argon2.verify(hash, "password", { secret }));
+ });
+
+ it("verify argon2d correct password", async () => {
+ const hash = await argon2.hash(password, { type: argon2d });
+ assert(await argon2.verify(hash, password));
+ });
+
+ it("verify argon2d wrong password", async () => {
+ const hash = await argon2.hash(password, { type: argon2d });
+ assert(!(await argon2.verify(hash, "passworld")));
+ });
+
+ it("verify argon2id correct password", async () => {
+ const hash = await argon2.hash(password, { type: argon2id });
+ assert(await argon2.verify(hash, password));
+ });
+
+ it("verify argon2id wrong password", async () => {
+ const hash = await argon2.hash(password, { type: argon2id });
+ assert(!(await argon2.verify(hash, "passworld")));
+ });
+
+ it("verify old hash format", async () => {
+ // older hashes did not contain the v (version) parameter
+ assert(await argon2.verify(hashes.oldFormat, "password"));
+ });
+});
diff --git a/test/test.js b/test/test.js
deleted file mode 100644
index bb1a069..0000000
--- a/test/test.js
+++ /dev/null
@@ -1,302 +0,0 @@
-const assert = require("assert").strict;
-const argon2 = require("../argon2");
-const { argon2i, argon2d, argon2id, defaults, limits } = argon2;
-const password = "password";
-const salt = Buffer.alloc(16, "salt");
-const associatedData = Buffer.alloc(16, "ad");
-const secret = Buffer.alloc(16, "secret");
-
-// hashes for argon2i and argon2d with default options
-const hashes = Object.freeze({
- argon2id:
- "$argon2id$v=19$m=65536,t=3,p=4$c2FsdHNhbHRzYWx0c2FsdA$rBWULD5jOGpQy32rLvGcmvQMVqIVNAmrCtekWvUA8bw",
- withNull:
- "$argon2id$v=19$m=65536,t=3,p=4$c2FsdHNhbHRzYWx0c2FsdA$NqchDOxwWbcBzA+0gtsCtyspEQxqKFf4/PO/AoIvo+Q",
- withAd:
- "$argon2id$v=19$m=65536,t=3,p=4,data=YWRhZGFkYWRhZGFkYWRhZA$c2FsdHNhbHRzYWx0c2FsdA$TEIIM4GBSUxvMLolL9ePXYP5G/qcr0vywQqqm/ILvsM",
- withSecret:
- "$argon2id$v=19$m=65536,t=3,p=4$c2FsdHNhbHRzYWx0c2FsdA$8dZyo1MdHgdzBm+VU7+tyW06dUO7B9FyaPImH5ejVOU",
- argon2i:
- "$argon2i$v=19$m=65536,t=3,p=4$c2FsdHNhbHRzYWx0c2FsdA$1Ccmp7ECb+Rb5XPjqRwEuAjCufY1xQDOJwnHrB+orZ4",
- argon2d:
- "$argon2d$v=19$m=65536,t=3,p=4$c2FsdHNhbHRzYWx0c2FsdA$VtxJNl5Jr/yZ2UIhvfvL4sGPdDQyGCcy45Cs7rIdFq8",
- rawArgon2id: Buffer.from(
- "ac15942c3e63386a50cb7dab2ef19c9af40c56a2153409ab0ad7a45af500f1bc",
- "hex",
- ),
- rawWithNull: Buffer.from(
- "36a7210cec7059b701cc0fb482db02b72b29110c6a2857f8fcf3bf02822fa3e4",
- "hex",
- ),
- rawArgon2i: Buffer.from(
- "d42726a7b1026fe45be573e3a91c04b808c2b9f635c500ce2709c7ac1fa8ad9e",
- "hex",
- ),
- rawArgon2d: Buffer.from(
- "56dc49365e49affc99d94221bdfbcbe2c18f743432182732e390aceeb21d16af",
- "hex",
- ),
- oldFormat:
- "$argon2i$m=4096,t=3,p=1$tbagT6b1YH33niCo9lVzuA$htv/k+OqWk1V9zD9k5DOBi2kcfcZ6Xu3tWmwEPV3/nc",
-});
-
-describe("Argon2", () => {
- describe("hash", () => {
- it("hash with argon2i", async () => {
- const hash = await argon2.hash(password, { type: argon2i, salt });
- assert.equal(hashes.argon2i, hash);
- });
-
- it("argon2i with raw hash", async () => {
- const hash = await argon2.hash(password, {
- type: argon2i,
- raw: true,
- salt,
- });
- assert(hashes.rawArgon2i.equals(hash));
- });
-
- it("hash with argon2d", async () => {
- const hash = await argon2.hash(password, { type: argon2d, salt });
- assert.equal(hashes.argon2d, hash);
- });
-
- it("argon2d with raw hash", async () => {
- const hash = await argon2.hash(password, {
- type: argon2d,
- raw: true,
- salt,
- });
- assert(hashes.rawArgon2d.equals(hash));
- });
-
- it("hash with argon2id", async () => {
- const hash = await argon2.hash(password, { type: argon2id, salt });
- assert.equal(hashes.argon2id, hash);
- });
-
- it("argon2id with raw hash", async () => {
- const hash = await argon2.hash(password, {
- type: argon2id,
- raw: true,
- salt,
- });
- assert(hashes.rawArgon2id.equals(hash));
- });
-
- it("with null in password", async () => {
- const hash = await argon2.hash("pass\0word", { salt });
- assert.equal(hashes.withNull, hash);
- });
-
- it("with raw hash, null in password", async () => {
- const hash = await argon2.hash("pass\0word", {
- raw: true,
- salt,
- });
- assert(hashes.rawWithNull.equals(hash));
- });
-
- it("with associated data", async () => {
- const hash = await argon2.hash(password, {
- associatedData,
- salt,
- });
- assert.equal(hashes.withAd, hash);
- });
-
- it("with secret", async () => {
- const hash = await argon2.hash(password, {
- secret,
- salt,
- });
- assert.equal(hashes.withSecret, hash);
- });
- });
-
- describe("set options", () => {
- it("hash with time cost", async () => {
- const hash = await argon2.hash(password, { timeCost: 4 });
- assert(/t=4/.test(hash));
- });
-
- it("hash with low time cost", async () => {
- try {
- await argon2.hash(password, { timeCost: limits.timeCost.min - 1 });
- assert.fail("This test should fail");
- } catch (err) {
- assert(/invalid timeCost.+between \d+ and \d+/i.test(err.message));
- }
- });
-
- it("hash with high time cost", async () => {
- try {
- await argon2.hash(password, { timeCost: limits.timeCost.max + 1 });
- assert.fail("This test should fail");
- } catch (err) {
- assert(/invalid timeCost.+between \d+ and \d+/i.test(err.message));
- }
- });
-
- it("hash with hash length", async () => {
- // 4 bytes ascii == 6 bytes base64
- const hash = await argon2.hash(password, { hashLength: 4 });
- assert(/\$[^$]{6}$/.test(hash));
- });
-
- it("hash with low hash length", async () => {
- try {
- await argon2.hash(password, { hashLength: limits.hashLength.min - 1 });
- assert.fail("This test should fail");
- } catch (err) {
- assert(/invalid hashLength.+between \d+ and \d+/i.test(err.message));
- }
- });
-
- it("hash with high hash length", async () => {
- try {
- await argon2.hash(password, { hashLength: limits.hashLength.max + 1 });
- assert.fail("This test should fail");
- } catch (err) {
- assert(/invalid hashLength.+between \d+ and \d+/i.test(err.message));
- }
- });
-
- it("hash with memory cost", async () => {
- const hash = await argon2.hash(password, { memoryCost: 1 << 13 });
- assert(/m=8192/.test(hash));
- });
-
- it("hash with low memory cost", async () => {
- try {
- await argon2.hash(password, { memoryCost: limits.memoryCost.min / 2 });
- assert.fail("This test should fail");
- } catch (err) {
- assert(/invalid memoryCost.+between \d+ and \d+/i.test(err.message));
- }
- });
-
- it("hash with high memory cost", async () => {
- try {
- await argon2.hash(password, { memoryCost: limits.memoryCost.max * 2 });
- assert.fail("This test should fail");
- } catch (err) {
- assert(/invalid memoryCost.+between \d+ and \d+/i.test(err.message));
- }
- });
-
- it("hash with parallelism", async () => {
- const hash = await argon2.hash(password, { parallelism: 2 });
- assert(/p=2/.test(hash));
- });
-
- it("hash with low parallelism", async () => {
- try {
- await await argon2.hash(password, {
- parallelism: limits.parallelism.min - 1,
- });
- assert.fail("This test should fail");
- } catch (err) {
- assert(/invalid parallelism.+between \d+ and \d+/i.test(err.message));
- }
- });
-
- it("hash with high parallelism", async () => {
- try {
- await argon2.hash(password, {
- parallelism: limits.parallelism.max + 1,
- });
- assert.fail("This test should fail");
- } catch (err) {
- assert(/invalid parallelism.+between \d+ and \d+/i.test(err.message));
- }
- });
-
- it("hash with all options", async () => {
- const hash = await argon2.hash(password, {
- timeCost: 4,
- memoryCost: 1 << 13,
- parallelism: 2,
- });
- assert(/m=8192,t=4,p=2/.test(hash));
- });
- });
-
- describe("needsRehash", () => {
- it("needs rehash old version", async () => {
- const hash = await argon2.hash(password, { version: 0x10 });
- assert(argon2.needsRehash(hash));
- assert(!argon2.needsRehash(hash, { version: 0x10 }));
- });
-
- it("needs rehash low memory cost", async () => {
- const hash = await argon2.hash(password, {
- memoryCost: defaults.memoryCost / 2,
- });
- assert(argon2.needsRehash(hash));
- assert(
- !argon2.needsRehash(hash, { memoryCost: defaults.memoryCost / 2 }),
- );
- });
-
- it("needs rehash low time cost", async () => {
- const hash = await argon2.hash(password, {
- timeCost: defaults.timeCost - 1,
- });
- assert(argon2.needsRehash(hash));
- assert(!argon2.needsRehash(hash, { timeCost: defaults.timeCost - 1 }));
- });
- });
-
- describe("verify", () => {
- it("verify correct password", async () => {
- const hash = await argon2.hash(password);
- assert(await argon2.verify(hash, password));
- });
-
- it("verify wrong password", async () => {
- const hash = await argon2.hash(password);
- assert(!(await argon2.verify(hash, "passworld")));
- });
-
- it("verify with null in password", async () => {
- const hash = await argon2.hash("pass\0word");
- assert(await argon2.verify(hash, "pass\0word"));
- });
-
- it("verify with associated data", async () => {
- const hash = await argon2.hash(password, { associatedData });
- assert(await argon2.verify(hash, "password"));
- });
-
- it("verify with secret", async () => {
- const hash = await argon2.hash(password, { secret });
- assert(await argon2.verify(hash, "password", { secret }));
- });
-
- it("verify argon2d correct password", async () => {
- const hash = await argon2.hash(password, { type: argon2d });
- assert(await argon2.verify(hash, password));
- });
-
- it("verify argon2d wrong password", async () => {
- const hash = await argon2.hash(password, { type: argon2d });
- assert(!(await argon2.verify(hash, "passworld")));
- });
-
- it("verify argon2id correct password", async () => {
- const hash = await argon2.hash(password, { type: argon2id });
- assert(await argon2.verify(hash, password));
- });
-
- it("verify argon2id wrong password", async () => {
- const hash = await argon2.hash(password, { type: argon2id });
- assert(!(await argon2.verify(hash, "passworld")));
- });
-
- it("verify old hash format", async () => {
- // older hashes did not contain the v (version) parameter
- assert(await argon2.verify(hashes.oldFormat, "password"));
- });
- });
-});
diff --git a/tsconfig.json b/tsconfig.json
index 0a4df2a..cf71c72 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -1,9 +1,8 @@
{
"compilerOptions": {
- "target": "es2015",
- "module": "commonjs",
- "moduleResolution": "node",
+ "module": "NodeNext",
+ "moduleResolution": "NodeNext",
+ "noEmit": true,
"strict": true
- },
- "files": ["test/test-d.ts"]
+ }
}
diff --git a/yarn.lock b/yarn.lock
index d91facd..55d87c5 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -129,11 +129,6 @@ aggregate-error@^3.0.0:
clean-stack "^2.0.0"
indent-string "^4.0.0"
-ansi-colors@4.1.1:
- version "4.1.1"
- resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348"
- integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==
-
ansi-regex@^5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304"
@@ -144,7 +139,7 @@ ansi-regex@^6.0.1:
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-6.0.1.tgz#3183e38fae9a65d7cb5e53945cd5897d0260a06a"
integrity sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==
-ansi-styles@^4.0.0, ansi-styles@^4.1.0:
+ansi-styles@^4.0.0:
version "4.3.0"
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937"
integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==
@@ -156,14 +151,6 @@ ansi-styles@^6.1.0:
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-6.2.1.tgz#0e62320cf99c21afff3b3012192546aacbfb05c5"
integrity sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==
-anymatch@~3.1.2:
- version "3.1.3"
- resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e"
- integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==
- dependencies:
- normalize-path "^3.0.0"
- picomatch "^2.0.4"
-
"aproba@^1.0.3 || ^2.0.0":
version "2.0.0"
resolved "https://registry.yarnpkg.com/aproba/-/aproba-2.0.0.tgz#52520b8ae5b569215b354efc0caa3fe1e45a8adc"
@@ -177,21 +164,11 @@ are-we-there-yet@^2.0.0:
delegates "^1.0.0"
readable-stream "^3.6.0"
-argparse@^2.0.1:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38"
- integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==
-
balanced-match@^1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee"
integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==
-binary-extensions@^2.0.0:
- version "2.2.0"
- resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d"
- integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==
-
brace-expansion@^1.1.7:
version "1.1.11"
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd"
@@ -207,18 +184,6 @@ brace-expansion@^2.0.1:
dependencies:
balanced-match "^1.0.0"
-braces@~3.0.2:
- version "3.0.2"
- resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107"
- integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==
- dependencies:
- fill-range "^7.0.1"
-
-browser-stdout@1.3.1:
- version "1.3.1"
- resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60"
- integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==
-
c8@^8.0.1:
version "8.0.1"
resolved "https://registry.yarnpkg.com/c8/-/c8-8.0.1.tgz#bafd60be680e66c5530ee69f621e45b1364af9fd"
@@ -255,34 +220,6 @@ cacache@^18.0.0:
tar "^6.1.11"
unique-filename "^3.0.0"
-camelcase@^6.0.0:
- version "6.3.0"
- resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a"
- integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==
-
-chalk@^4.1.0:
- version "4.1.2"
- resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01"
- integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==
- dependencies:
- ansi-styles "^4.1.0"
- supports-color "^7.1.0"
-
-chokidar@3.5.3:
- version "3.5.3"
- resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd"
- integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==
- dependencies:
- anymatch "~3.1.2"
- braces "~3.0.2"
- glob-parent "~5.1.2"
- is-binary-path "~2.1.0"
- is-glob "~4.0.1"
- normalize-path "~3.0.0"
- readdirp "~3.6.0"
- optionalDependencies:
- fsevents "~2.3.2"
-
chownr@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/chownr/-/chownr-2.0.0.tgz#15bfbe53d2eab4cf70f18a8cd68ebe5b3cb1dece"
@@ -293,15 +230,6 @@ clean-stack@^2.0.0:
resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b"
integrity sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==
-cliui@^7.0.2:
- version "7.0.4"
- resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f"
- integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==
- dependencies:
- string-width "^4.2.0"
- strip-ansi "^6.0.0"
- wrap-ansi "^7.0.0"
-
cliui@^8.0.1:
version "8.0.1"
resolved "https://registry.yarnpkg.com/cliui/-/cliui-8.0.1.tgz#0c04b075db02cbfe60dc8e6cf2f5486b1a3608aa"
@@ -352,18 +280,13 @@ cross-spawn@^7.0.0:
shebang-command "^2.0.0"
which "^2.0.1"
-debug@4, debug@4.3.4, debug@^4.3.4:
+debug@4, debug@^4.3.4:
version "4.3.4"
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865"
integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==
dependencies:
ms "2.1.2"
-decamelize@^4.0.0:
- version "4.0.0"
- resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-4.0.0.tgz#aa472d7bf660eb15f3494efd531cab7f2a709837"
- integrity sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==
-
delegates@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a"
@@ -374,11 +297,6 @@ detect-libc@^2.0.0:
resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-2.0.2.tgz#8ccf2ba9315350e1241b88d0ac3b0e1fbd99605d"
integrity sha512-UX6sGumvvqSaXgdKGUsgZWqcUyIXZ/vZTrlRT/iobiKhGL0zL4d3osHj3uqllWJK+i+sixDS/3COVEOFbupFyw==
-diff@5.0.0:
- version "5.0.0"
- resolved "https://registry.yarnpkg.com/diff/-/diff-5.0.0.tgz#7ed6ad76d859d030787ec35855f5b1daf31d852b"
- integrity sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==
-
eastasianwidth@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb"
@@ -416,24 +334,12 @@ escalade@^3.1.1:
resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40"
integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==
-escape-string-regexp@4.0.0:
- version "4.0.0"
- resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34"
- integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==
-
exponential-backoff@^3.1.1:
version "3.1.1"
resolved "https://registry.yarnpkg.com/exponential-backoff/-/exponential-backoff-3.1.1.tgz#64ac7526fe341ab18a39016cd22c787d01e00bf6"
integrity sha512-dX7e/LHVJ6W3DE1MHWi9S1EYzDESENfLrYohG2G++ovZrYOkm4Knwa0mc1cn84xJOR4KEU0WSchhLbd0UklbHw==
-fill-range@^7.0.1:
- version "7.0.1"
- resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40"
- integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==
- dependencies:
- to-regex-range "^5.0.1"
-
-find-up@5.0.0, find-up@^5.0.0:
+find-up@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc"
integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==
@@ -441,11 +347,6 @@ find-up@5.0.0, find-up@^5.0.0:
locate-path "^6.0.0"
path-exists "^4.0.0"
-flat@^5.0.2:
- version "5.0.2"
- resolved "https://registry.yarnpkg.com/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241"
- integrity sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==
-
foreground-child@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/foreground-child/-/foreground-child-2.0.0.tgz#71b32800c9f15aa8f2f83f4a6bd9bff35d861a53"
@@ -481,11 +382,6 @@ fs.realpath@^1.0.0:
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==
-fsevents@~2.3.2:
- version "2.3.3"
- resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6"
- integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==
-
gauge@^3.0.0:
version "3.0.2"
resolved "https://registry.yarnpkg.com/gauge/-/gauge-3.0.2.tgz#03bf4441c044383908bcfa0656ad91803259b395"
@@ -506,25 +402,6 @@ get-caller-file@^2.0.5:
resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e"
integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==
-glob-parent@~5.1.2:
- version "5.1.2"
- resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4"
- integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==
- dependencies:
- is-glob "^4.0.1"
-
-glob@7.2.0:
- version "7.2.0"
- resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023"
- integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==
- dependencies:
- fs.realpath "^1.0.0"
- inflight "^1.0.4"
- inherits "2"
- minimatch "^3.0.4"
- once "^1.3.0"
- path-is-absolute "^1.0.0"
-
glob@^10.2.2:
version "10.3.4"
resolved "https://registry.yarnpkg.com/glob/-/glob-10.3.4.tgz#c85c9c7ab98669102b6defda76d35c5b1ef9766f"
@@ -574,11 +451,6 @@ has-unicode@^2.0.1:
resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9"
integrity sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==
-he@1.2.0:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f"
- integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==
-
html-escaper@^2.0.0:
version "2.0.2"
resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453"
@@ -648,50 +520,16 @@ ip@^2.0.0:
resolved "https://registry.yarnpkg.com/ip/-/ip-2.0.0.tgz#4cf4ab182fee2314c75ede1276f8c80b479936da"
integrity sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ==
-is-binary-path@~2.1.0:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09"
- integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==
- dependencies:
- binary-extensions "^2.0.0"
-
-is-extglob@^2.1.1:
- version "2.1.1"
- resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2"
- integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==
-
is-fullwidth-code-point@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d"
integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==
-is-glob@^4.0.1, is-glob@~4.0.1:
- version "4.0.3"
- resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084"
- integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==
- dependencies:
- is-extglob "^2.1.1"
-
is-lambda@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/is-lambda/-/is-lambda-1.0.1.tgz#3d9877899e6a53efc0160504cde15f82e6f061d5"
integrity sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ==
-is-number@^7.0.0:
- version "7.0.0"
- resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b"
- integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==
-
-is-plain-obj@^2.1.0:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287"
- integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==
-
-is-unicode-supported@^0.1.0:
- version "0.1.0"
- resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7"
- integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==
-
isexe@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10"
@@ -742,13 +580,6 @@ jackspeak@^2.3.5:
optionalDependencies:
"@pkgjs/parseargs" "^0.11.0"
-js-yaml@4.1.0:
- version "4.1.0"
- resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602"
- integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==
- dependencies:
- argparse "^2.0.1"
-
locate-path@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286"
@@ -756,14 +587,6 @@ locate-path@^6.0.0:
dependencies:
p-locate "^5.0.0"
-log-symbols@4.1.0:
- version "4.1.0"
- resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.1.0.tgz#3fbdbb95b4683ac9fc785111e792e558d4abd503"
- integrity sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==
- dependencies:
- chalk "^4.1.0"
- is-unicode-supported "^0.1.0"
-
lru-cache@^10.0.1, "lru-cache@^9.1.1 || ^10.0.0":
version "10.0.1"
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.0.1.tgz#0a3be479df549cca0e5d693ac402ff19537a6b7a"
@@ -807,13 +630,6 @@ make-fetch-happen@^13.0.0:
promise-retry "^2.0.1"
ssri "^10.0.0"
-minimatch@5.0.1:
- version "5.0.1"
- resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.0.1.tgz#fb9022f7528125187c92bd9e9b6366be1cf3415b"
- integrity sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==
- dependencies:
- brace-expansion "^2.0.1"
-
minimatch@^3.0.4, minimatch@^3.1.1:
version "3.1.2"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b"
@@ -902,48 +718,11 @@ mkdirp@^1.0.3:
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e"
integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==
-mocha@^10.2.0:
- version "10.2.0"
- resolved "https://registry.yarnpkg.com/mocha/-/mocha-10.2.0.tgz#1fd4a7c32ba5ac372e03a17eef435bd00e5c68b8"
- integrity sha512-IDY7fl/BecMwFHzoqF2sg/SHHANeBoMMXFlS9r0OXKDssYE1M5O43wUY/9BVPeIvfH2zmEbBfseqN9gBQZzXkg==
- dependencies:
- ansi-colors "4.1.1"
- browser-stdout "1.3.1"
- chokidar "3.5.3"
- debug "4.3.4"
- diff "5.0.0"
- escape-string-regexp "4.0.0"
- find-up "5.0.0"
- glob "7.2.0"
- he "1.2.0"
- js-yaml "4.1.0"
- log-symbols "4.1.0"
- minimatch "5.0.1"
- ms "2.1.3"
- nanoid "3.3.3"
- serialize-javascript "6.0.0"
- strip-json-comments "3.1.1"
- supports-color "8.1.1"
- workerpool "6.2.1"
- yargs "16.2.0"
- yargs-parser "20.2.4"
- yargs-unparser "2.0.0"
-
ms@2.1.2:
version "2.1.2"
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"
integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==
-ms@2.1.3:
- version "2.1.3"
- resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2"
- integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==
-
-nanoid@3.3.3:
- version "3.3.3"
- resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.3.tgz#fd8e8b7aa761fe807dba2d1b98fb7241bb724a25"
- integrity sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==
-
negotiator@^0.6.3:
version "0.6.3"
resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.3.tgz#58e323a72fedc0d6f9cd4d31fe49f51479590ccd"
@@ -991,11 +770,6 @@ nopt@^7.0.0:
dependencies:
abbrev "^2.0.0"
-normalize-path@^3.0.0, normalize-path@~3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65"
- integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==
-
npmlog@^5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-5.0.1.tgz#f06678e80e29419ad67ab964e0fa69959c1eb8b0"
@@ -1062,11 +836,6 @@ path-scurry@^1.10.1:
lru-cache "^9.1.1 || ^10.0.0"
minipass "^5.0.0 || ^6.0.2 || ^7.0.0"
-picomatch@^2.0.4, picomatch@^2.2.1:
- version "2.3.1"
- resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42"
- integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==
-
prettier@^3.0.0:
version "3.0.3"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.3.tgz#432a51f7ba422d1469096c0fdc28e235db8f9643"
@@ -1085,13 +854,6 @@ promise-retry@^2.0.1:
err-code "^2.0.2"
retry "^0.12.0"
-randombytes@^2.1.0:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a"
- integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==
- dependencies:
- safe-buffer "^5.1.0"
-
readable-stream@^3.6.0:
version "3.6.2"
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.2.tgz#56a9b36ea965c00c5a93ef31eb111a0f11056967"
@@ -1101,13 +863,6 @@ readable-stream@^3.6.0:
string_decoder "^1.1.1"
util-deprecate "^1.0.1"
-readdirp@~3.6.0:
- version "3.6.0"
- resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7"
- integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==
- dependencies:
- picomatch "^2.2.1"
-
require-directory@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42"
@@ -1125,7 +880,7 @@ rimraf@^3.0.2:
dependencies:
glob "^7.1.3"
-safe-buffer@^5.1.0, safe-buffer@~5.2.0:
+safe-buffer@~5.2.0:
version "5.2.1"
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6"
integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==
@@ -1147,13 +902,6 @@ semver@^7.3.5, semver@^7.5.3:
dependencies:
lru-cache "^6.0.0"
-serialize-javascript@6.0.0:
- version "6.0.0"
- resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.0.tgz#efae5d88f45d7924141da8b5c3a7a7e663fefeb8"
- integrity sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==
- dependencies:
- randombytes "^2.1.0"
-
set-blocking@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7"
@@ -1249,18 +997,6 @@ strip-ansi@^7.0.1:
dependencies:
ansi-regex "^6.0.1"
-strip-json-comments@3.1.1:
- version "3.1.1"
- resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006"
- integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==
-
-supports-color@8.1.1:
- version "8.1.1"
- resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c"
- integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==
- dependencies:
- has-flag "^4.0.0"
-
supports-color@^7.1.0:
version "7.2.0"
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da"
@@ -1289,13 +1025,6 @@ test-exclude@^6.0.0:
glob "^7.1.4"
minimatch "^3.0.4"
-to-regex-range@^5.0.1:
- version "5.0.1"
- resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4"
- integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==
- dependencies:
- is-number "^7.0.0"
-
tr46@~0.0.3:
version "0.0.3"
resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a"
@@ -1373,11 +1102,6 @@ wide-align@^1.1.2:
dependencies:
string-width "^1.0.2 || 2 || 3 || 4"
-workerpool@6.2.1:
- version "6.2.1"
- resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.1.tgz#46fc150c17d826b86a008e5a4508656777e9c343"
- integrity sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==
-
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
@@ -1411,44 +1135,11 @@ yallist@^4.0.0:
resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72"
integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==
-yargs-parser@20.2.4:
- version "20.2.4"
- resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.4.tgz#b42890f14566796f85ae8e3a25290d205f154a54"
- integrity sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==
-
-yargs-parser@^20.2.2:
- version "20.2.9"
- resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee"
- integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==
-
yargs-parser@^21.1.1:
version "21.1.1"
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35"
integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==
-yargs-unparser@2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/yargs-unparser/-/yargs-unparser-2.0.0.tgz#f131f9226911ae5d9ad38c432fe809366c2325eb"
- integrity sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==
- dependencies:
- camelcase "^6.0.0"
- decamelize "^4.0.0"
- flat "^5.0.2"
- is-plain-obj "^2.1.0"
-
-yargs@16.2.0:
- version "16.2.0"
- resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66"
- integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==
- dependencies:
- cliui "^7.0.2"
- escalade "^3.1.1"
- get-caller-file "^2.0.5"
- require-directory "^2.1.1"
- string-width "^4.2.0"
- y18n "^5.0.5"
- yargs-parser "^20.2.2"
-
yargs@^17.7.2:
version "17.7.2"
resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.7.2.tgz#991df39aca675a192b816e1e0363f9d75d2aa269"