@gulujs/toml
Version:
TOML parser and serializer
11 lines (10 loc) • 428 B
JavaScript
import { TYPE_ERROR_MESSAGE } from '../../errors/index.js';
export function assertIsDateTime(value, options, path) {
if (options.datetimeConverter.isJsValue(value)) {
return;
}
throw new TypeError(TYPE_ERROR_MESSAGE(path, 'is not a datetime'));
}
export function serializeDateTime(value, schema, options) {
return options.datetimeConverter.convertJsValueToString(value, { type: schema.dateTimeType });
}