UNPKG

option-t

Version:

A toolkit of Nullable/Option/Result type implementation in ECMAScript. Their APIs are inspired by Rust's `Option<T>` and `Result<T, E>`.

10 lines (9 loc) 634 B
const ERR_MSG_MUST_NOT_RETURN = ' must not return '; const TRANSFORM_FUNCTION_NAME = '`transformer`'; const RECOVERY_FUNCTION_NAME = '`recoverer`'; const DEFAULT_VALUE_NAME = '`defaultValue`'; export const ERR_MSG_TRANSFORMER_MUST_NOT_RETURN = TRANSFORM_FUNCTION_NAME + ERR_MSG_MUST_NOT_RETURN; export const ERR_MSG_CALLED_WITH = 'called with '; export const ERR_MSG_DEFAULT_VALUE_MUST_NOT_BE = DEFAULT_VALUE_NAME + ' must not be '; export const ERR_MSG_RECOVERER_MUST_NOT_RETURN = RECOVERY_FUNCTION_NAME + ERR_MSG_MUST_NOT_RETURN; export const ERR_MSG_INPUT_IS_FROZEN_NOT_CAST_TO_MUTABLE = 'input is frozen, cannot cast to mutable';