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

Function timeStringToObject

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

Source from the content-addressed store, hash-verified

6863
6864 it('allows pre init hook to transform data (gh-15839)', async function() {
6865 const timeStringToObject = (time) => {
6866 if (typeof time !== 'string') return time;
6867 const [hours, minutes] = time.split(':');
6868 return { hours: parseInt(hours), minutes: parseInt(minutes) };
6869 };
6870
6871 const timeSchema = new Schema({
6872 hours: { type: Number, required: true },

Callers 1

document.test.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected