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

Function stringifyValidationErrorFields

validator/cpp/engine/wasm/validator.js:60–67  ·  view source on GitHub ↗

* Transforms the fields in a ValidationError from number to string * @param {Object!} error a ValidationError whose values are numeric * @return {Object!}

(error)

Source from the content-addressed store, hash-verified

58 * @return {Object!}
59 */
60function stringifyValidationErrorFields(error) {
61 return {
62 ...error,
63 params: error.paramsList,
64 severity: SEVERITY.nameByNumber.get(error.severity),
65 code: CODE.nameByNumber.get(error.code),
66 };
67}
68
69/**
70 * Creates a ValidationError by transforming the fields from string to number

Callers 1

validateStringFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected