MCPcopy Index your code
hub / github.com/nodejs/node / getNodeMajorVersion

Function getNodeMajorVersion

test/fixtures/snapshot/typescript.js:6913–6926  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6911 }
6912 ts.patchWriteFileEnsuringDirectory = patchWriteFileEnsuringDirectory;
6913 function getNodeMajorVersion() {
6914 if (typeof process === "undefined") {
6915 return undefined;
6916 }
6917 var version = process.version;
6918 if (!version) {
6919 return undefined;
6920 }
6921 var dot = version.indexOf(".");
6922 if (dot === -1) {
6923 return undefined;
6924 }
6925 return parseInt(version.substring(1, dot));
6926 }
6927 ts.getNodeMajorVersion = getNodeMajorVersion;
6928 // TODO: GH#18217 this is used as if it's certainly defined in many places.
6929 // eslint-disable-next-line prefer-const

Callers 1

getNodeSystemFunction · 0.85

Calls 1

indexOfMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…