UNPKG

@gulujs/toml

Version:

TOML parser and serializer

11 lines (10 loc) 424 B
import { TYPE_ERROR_MESSAGE } from '../../errors/index.js'; export function assertIsInteger(value, options, path) { if (options.integerConverter.isJsValue(value)) { return; } throw new TypeError(TYPE_ERROR_MESSAGE(path, 'is not an integer')); } export function serializeInteger(value, schema, options) { return options.integerConverter.convertJsValueToString(value, { radix: schema.radix || 10 }); }