MCPcopy
hub / github.com/lebab/lebab / getCommonKind

Method getCommonKind

src/scope/VariableGroup.js:44–52  ·  view source on GitHub ↗

* Returns the `kind` value of variable defined in this group. * * When not all variables are of the same kind, returns undefined. * * @return {String} Either "var", "let", "const" or undefined.

()

Source from the content-addressed store, hash-verified

42 * @return {String} Either "var", "let", "const" or undefined.
43 */
44 getCommonKind() {
45 const firstKind = this.variables[0].getKind();
46 if (this.variables.every(v => v.getKind() === firstKind)) {
47 return firstKind;
48 }
49 else {
50 return undefined;
51 }
52 }
53
54 /**
55 * Returns the most restrictive possible common `kind` value

Callers 1

Calls 1

getKindMethod · 0.80

Tested by

no test coverage detected