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

Function timeStringToObject

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

Source from the content-addressed store, hash-verified

6563
6564 it('allows pre init hook to transform data (gh-15839)', async function() {
6565 const timeStringToObject = (time) => {
6566 if (typeof time !== 'string') return time;
6567 const [hours, minutes] = time.split(':');
6568 return { hours: parseInt(hours), minutes: parseInt(minutes) };
6569 };
6570
6571 const timeSchema = new Schema({
6572 hours: { type: Number, required: true },

Callers 1

document.test.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected