MCPcopy Index your code
hub / github.com/github/relative-time-element / extractValues

Function extractValues

test/duration.ts:24–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22 ])
23
24 const extractValues = x => ({
25 years: x.years || 0,
26 months: x.months || 0,
27 weeks: x.weeks || 0,
28 days: x.days || 0,
29 hours: x.hours || 0,
30 minutes: x.minutes || 0,
31 seconds: x.seconds || 0,
32 })
33 for (const {input, ...expected} of tests) {
34 test(`${input} -> from(${JSON.stringify(expected)})`, () => {
35 assert.deepEqual(extractValues(Temporal.Duration.from(input)), extractValues(expected))

Callers 1

duration.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…