MCPcopy Create free account
hub / github.com/Automattic/mongoose / timeStringToObject

Function timeStringToObject

test/document.test.js:6589–6593  ·  view source on GitHub ↗
(time)

Source from the content-addressed store, hash-verified

6587
6588 it('allows pre init hook to transform data (gh-15839)', async function() {
6589 const timeStringToObject = (time) => {
6590 if (typeof time !== 'string') return time;
6591 const [hours, minutes] = time.split(':');
6592 return { hours: parseInt(hours), minutes: parseInt(minutes) };
6593 };
6594
6595 const timeSchema = new Schema({
6596 hours: { type: Number, required: true },

Callers 1

document.test.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected