You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

compress-opening-times

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

compress-opening-times

Compress the schedule of the opening times of a store, office, &c.

0.0.4
latest
Source
npmnpm
Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

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 ]

Keywords

compression

FAQs

Package last updated on 27 Aug 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts