JSON string
Optional
errorFactory: ((props: TypeGuardError.IProps) => Error)Custom error factory. Default is TypeGuardError
Parsed value
Jeongho Nam - https://github.com/samchon
Safe JSON.parse()
function with type assertion.
typia.json.assertParse()
is a combination function of JSON.parse()
and
assert. Therefore, it convers a JSON (JavaScript Object Notation) string
to a T
typed instance with type assertion.
In such reason, when parsed JSON string value is not matched with the type T
,
it throws TypeGuardError or custom error generated by errorFactory.
Otherwise, there's no problem on the parsed value, the parsed value would be
returned.
JSON string
Optional
errorFactory: ((props: TypeGuardError.IProps) => Error)Custom error factory. Default is TypeGuardError
Parsed value
Jeongho Nam - https://github.com/samchon
Safe
JSON.parse()
function with type assertion.typia.json.assertParse()
is a combination function ofJSON.parse()
and assert. Therefore, it convers a JSON (JavaScript Object Notation) string to aT
typed instance with type assertion.In such reason, when parsed JSON string value is not matched with the type
T
, it throws TypeGuardError or custom error generated by errorFactory. Otherwise, there's no problem on the parsed value, the parsed value would be returned.