A value to be asserted and converted
Optional
errorFactory: ((props: TypeGuardError.IProps) => Error)Custom error factory. Default is TypeGuardError
JSON string value
Jeongho Nam - https://github.com/samchon
5x faster JSON.stringify()
function with type assertion.
typia.json.assertStringify()
is a combination function of assert and
stringify. Therefore, it converts an input value to
JSON (JavaScript Object Notation) string, with type assertion.
In such reason, when input
value is not matched with the type T
, it throws an
TypeGuardError or custom error generated by errorFactory. Otherwise,
there's no problem on the input
value, JSON string would be returned.
For reference, with type assertion, it is even 5x times faster than the native
JSON.stringify()
function. So, just enjoy the safe and fast JSON conversion
with confidence.
A value to be asserted and converted
Optional
errorFactory: ((props: TypeGuardError.IProps) => Error)Custom error factory. Default is TypeGuardError
JSON string value
Jeongho Nam - https://github.com/samchon
5x faster
JSON.stringify()
function with type assertion.typia.json.assertStringify()
is a combination function of assert and stringify. Therefore, it converts an input value to JSON (JavaScript Object Notation) string, with type assertion.In such reason, when
input
value is not matched with the typeT
, it throws an TypeGuardError or custom error generated by errorFactory. Otherwise, there's no problem on theinput
value, JSON string would be returned.For reference, with type assertion, it is even 5x times faster than the native
JSON.stringify()
function. So, just enjoy the safe and fast JSON conversion with confidence.