MCPcopy Create free account
hub / github.com/ampproject/amphtml / constructor

Method constructor

validator/cpp/engine/wasm/validator.js:43–48  ·  view source on GitHub ↗

* @param {Object!} jspbObject Enum generated by go/jspb. This is a JavaScript * plain object containing a string-to-number mapping of the enum.

(jspbObject)

Source from the content-addressed store, hash-verified

41 * plain object containing a string-to-number mapping of the enum.
42 */
43 constructor(jspbObject) {
44 const entries = Object.entries(jspbObject);
45 this.numberByName = new Map(entries);
46 this.nameByNumber =
47 new Map(entries.map(([name, number]) => [number, name]));
48 }
49}
50
51const CODE = new ProtobufEnum(ValidationError.Code);

Callers

nothing calls this directly

Calls 1

entriesMethod · 0.45

Tested by

no test coverage detected