Socket
Socket
Sign inDemoInstall

compress-opening-times

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

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.


Version published
Maintainers
1
Install size
9.85 kB
Created

Readme

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

FAQs

Last updated on 27 Aug 2014

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc