initial update

This commit is contained in:
jackbeeby
2025-05-15 13:32:55 +10:00
commit 7b07a49fbe
4412 changed files with 909535 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
import { createHash } from "..";
describe("createHash", () => {
it("creates a hash", () => {
expect(createHash("sha256").update("foo").digest("hex")).toEqual(
"2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae",
);
});
});

View File

@@ -0,0 +1,6 @@
import * as allExports from "..";
it("exports hashing functions", () => {
expect(Object.keys(allExports).length).toBe(1);
expect(typeof allExports.createHash).toBe("function");
});

View File

@@ -0,0 +1,5 @@
{
"extends": "../../../../tsconfig.test.base",
"include": ["**/*"],
"references": [{ "path": "../../" }]
}

16
node_modules/@apollo/utils.createhash/src/index.ts generated vendored Normal file
View File

@@ -0,0 +1,16 @@
import { isNodeLike } from "@apollo/utils.isnodelike";
export function createHash(kind: string): import("crypto").Hash {
// Some Node-like environments (like next.js Turbopack) apparently
// don't have module.require, so double-check before we call it.
// (But don't change the value of isNodeLike because other logic depends on it,
// like Apollo Server signal handling defaults.) This does mean that
// Turbopack will call sha.js instead of the native crypto module, but
// it sure beats throwing because module.require does not exist.
if (isNodeLike && module.require) {
// Use module.require instead of just require to avoid bundling whatever
// crypto polyfills a non-Node bundler might fall back to.
return module.require("crypto").createHash(kind);
}
return require("sha.js")(kind);
}