/** A time as Alexa wants it: ISO 8601 in UTC. Text is taken as given. */ export function isoTime(time = new Date()) { return typeof time === "string" ? time : time.toISOString(); } /** One property of a context or of a change, its fields in the order of the examples. */ export function property(namespace, name, value, options = {}) { return { namespace, ...(options.instance ? { instance: options.instance } : {}), name, value, timeOfSample: isoTime(options.timeOfSample), uncertaintyInMilliseconds: options.uncertaintyInMilliseconds ?? 0, }; }