Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rheactor-value-objects

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rheactor-value-objects - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

2

package.json

@@ -42,3 +42,3 @@ {

},
"version": "1.0.0"
"version": "1.1.0"
}

@@ -6,3 +6,5 @@ # rheactor-value-objects

[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)
[![semantic-release](https://img.shields.io/badge/semver-semantic%20release-e10079.svg)](https://github.com/semantic-release/semantic-release)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/b38002c67b8a499aa1e441e8395fb576)](https://www.codacy.com/app/coderbyheart/value-objects?utm_source=github.com&utm_medium=referral&utm_content=RHeactor/value-objects&utm_campaign=Badge_Grade)
[![Codacy Badge](https://api.codacy.com/project/badge/Coverage/b38002c67b8a499aa1e441e8395fb576)](https://www.codacy.com/app/coderbyheart/value-objects?utm_source=github.com&utm_medium=referral&utm_content=RHeactor/value-objects&utm_campaign=Badge_Coverage)

@@ -9,0 +11,0 @@ [![NPM](https://nodei.co/npm/rheactor-value-objects.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/rheactor-value-objects/)

'use strict'
const _map = require('lodash/map')
const _forIn = require('lodash/forIn')
const TimeOfDayValue = require('..//time-of-day')

@@ -48,2 +49,36 @@ const Errors = require('../errors')

})
describe('.hour()', () => {
it('should return the hour as a number', (done) => {
_forIn({
'01:00': 1,
'02:00': 2,
'13:00': 13,
'1:00': 1,
'2:00': 2,
'00:00': 0,
'0:00': 0
}, (hour, time) => {
let u = new TimeOfDayValue(time)
expect(u.hour()).to.equal(hour)
})
done()
}
)
})
describe('.minute()', () => {
it('should return the minute as a number', (done) => {
_forIn({
'01:00': 0,
'02:01': 1,
'13:59': 59
}, (hour, time) => {
let u = new TimeOfDayValue(time)
expect(u.minute()).to.equal(hour)
})
done()
}
)
})
})

@@ -28,2 +28,18 @@ 'use strict'

/**
* Returns the hour of the time as a number
* @returns {Number}
*/
TimeOfDayValue.prototype.hour = function () {
return +this.timeOfDay.split(':')[0]
}
/**
* Returns the minute of the time as a number
* @returns {Number}
*/
TimeOfDayValue.prototype.minute = function () {
return +this.timeOfDay.split(':')[1]
}
module.exports = TimeOfDayValue
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc