util.js 261 B

123456789101112131415
  1. /**
  2. * util
  3. * @author oldj
  4. * @blog http://oldj.net
  5. */
  6. 'use strict'
  7. exports.formatVersion = (v) => {
  8. return 'v' + v.slice(0, 3).join('.') + ` (${v[3]})`
  9. }
  10. exports.makeId = () => {
  11. return (new Date()).getTime() + '-' + Math.floor(Math.random() * 1e6)
  12. }