MCPcopy Index your code
hub / github.com/tensorflow/tfjs / get

Method get

tfjs-core/src/environment.ts:96–110  ·  view source on GitHub ↗
(flagName: string)

Source from the content-addressed store, hash-verified

94 }
95
96 get(flagName: string): FlagValue {
97 if (flagName in this.flags) {
98 return this.flags[flagName];
99 }
100
101 const flagValue = this.evaluateFlag(flagName);
102 if (isPromise(flagValue)) {
103 throw new Error(
104 `Flag ${flagName} cannot be synchronously evaluated. ` +
105 `Please use getAsync() instead.`);
106 }
107
108 this.flags[flagName] = flagValue;
109 return this.flags[flagName];
110 }
111
112 getNumber(flagName: string): number {
113 return this.get(flagName) as number;

Callers 3

getNumberMethod · 0.95
getBoolMethod · 0.95
getStringMethod · 0.95

Calls 2

evaluateFlagMethod · 0.95
isPromiseFunction · 0.90

Tested by

no test coverage detected