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

Function digitizeValidationErrorFields

validator/cpp/engine/wasm/validator.js:75–81  ·  view source on GitHub ↗

* Creates a ValidationError by transforming the fields from string to number * @param {Object!} error an object whose strusture is the same as * ValidationError, except that the fields are strings. * @return {Object!} a ValidationError

(error)

Source from the content-addressed store, hash-verified

73 * @return {Object!} a ValidationError
74 */
75function digitizeValidationErrorFields(error) {
76 return {
77 ...error,
78 severity: SEVERITY.numberByName.get(error.severity),
79 code: CODE.numberByName.get(error.code),
80 };
81}
82
83/**
84 * When transforming validation errors and validation results from jspb to plain

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected