Skip to content

Commit dd6afe9

Browse files
committed
Support forks of Node that override process.release.name.
For more context, see: apollographql/apollo-server#2357
1 parent 7054935 commit dd6afe9

3 files changed

Lines changed: 4 additions & 5 deletions

File tree

packages/apollo-env/src/utils/createHash.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { isNode } from "./isNode";
1+
import { isNodeLike } from "./isNodeLike";
22

33
export function createHash(kind: string): import("crypto").Hash {
4-
if (isNode) {
4+
if (isNodeLike) {
55
// Use module.require instead of just require to avoid bundling whatever
66
// crypto polyfills a non-Node bundler might fall back to.
77
return module.require("crypto").createHash(kind);
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
export * from "./createHash";
2-
export * from "./isNode";
2+
export * from "./isNodeLike";
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
export const isNode =
1+
export const isNodeLike =
22
typeof process === "object" &&
33
process &&
44
process.release &&
5-
process.release.name === "node" &&
65
process.versions &&
76
typeof process.versions.node === "string";

0 commit comments

Comments
 (0)