Compress weekly opening time schedules.
var ot = require('compress-opening-times')
Serialize a list of pairs of opening and start times,
where time is the number of minutes since midnight.
ot.serializeWeek([
[ 9 * 60, 17 * 60],
[ 9 * 60, 17 * 60],
[ 9 * 60, 17 * 60],
[ 9 * 60, 17 * 60],
[ 9 * 60, 17 * 60],
[12 * 60, 17 * 60],
null // closed
])
// 'ġ$%Ś%ŕ'
Parse the resulting "ġ$%Ś%ŕ" to return the original list.
ot.parseWeek('ġ$%Ś%ŕ')
// [ [ 540, 1020 ],
// [ 540, 1020 ],
// [ 540, 1020 ],
// [ 540, 1020 ],
// [ 540, 1020 ],
// [ 720, 1020 ],
// null ]