Change implementation strategy of cashassembly, add scripts, comments support and tests
This commit is contained in:
@@ -6,9 +6,9 @@ import { CashAssemblyNumberNotSafeIntegerError, CashAssemblyUnsupportedValueType
|
||||
*
|
||||
* @param {unknown} value - Value to encode, should be one of: Uint8Array, bigint, boolean, string, or a safe integer number.
|
||||
* @param {string} valueIdentifier - Identifier used in error messages.
|
||||
* @returns {Uint8Array} Bytes representation of the value.
|
||||
* @throws {@link CashAssemblyNumberNotSafeIntegerError} When a number is not a safe integer.
|
||||
* @throws {@link CashAssemblyUnsupportedValueTypeError} When the value type cannot be resolved.
|
||||
* @returns {Uint8Array} - Bytes representation of the value.
|
||||
* @throws {@link CashAssemblyNumberNotSafeIntegerError} - When a number is not a safe integer.
|
||||
* @throws {@link CashAssemblyUnsupportedValueTypeError} - When the value type cannot be resolved.
|
||||
*/
|
||||
export const convertValueToBytes = (value: unknown, valueIdentifier: string): Uint8Array => {
|
||||
if (value instanceof Uint8Array) {
|
||||
|
||||
Reference in New Issue
Block a user