MCPcopy
hub / github.com/moment/luxon / get

Method get

src/duration.js:705–707  ·  view source on GitHub ↗

* Get the value of unit. * @param {string} unit - a unit such as 'minute' or 'day' * @example Duration.fromObject({years: 2, days: 3}).get('years') //=> 2 * @example Duration.fromObject({years: 2, days: 3}).get('months') //=> 0 * @example Duration.fromObject({years: 2, days: 3}).get('day

(unit)

Source from the content-addressed store, hash-verified

703 * @return {number}
704 */
705 get(unit) {
706 return this[Duration.normalizeUnit(unit)];
707 }
708
709 /**
710 * "Set" the values of specified units. Return a newly-constructed Duration.

Callers 14

plusMethod · 0.95
getters.test.jsFile · 0.45
lengthMethod · 0.45
countMethod · 0.45
asMethod · 0.45
digitRegexFunction · 0.45
tokenToStringMethod · 0.45
getCachedDTFFunction · 0.45
getCachedINFFunction · 0.45
getCachedRTFFunction · 0.45
getCachedWeekInfoFunction · 0.45

Calls 1

normalizeUnitMethod · 0.80

Tested by

no test coverage detected