MCPcopy
hub / github.com/iamkun/dayjs / add

Method add

src/plugin/duration/index.js:205–216  ·  view source on GitHub ↗
(input, unit, isSubtract)

Source from the content-addressed store, hash-verified

203 }
204
205 add(input, unit, isSubtract) {
206 let another
207 if (unit) {
208 another = input * unitToMS[prettyUnit(unit)]
209 } else if (isDuration(input)) {
210 another = input.$ms
211 } else {
212 another = wrapper(input, this).$ms
213 }
214
215 return wrapper(this.$ms + (another * (isSubtract ? -1 : 1)), this)
216 }
217
218 subtract(input, unit) {
219 return this.add(input, unit, true)

Callers 1

subtractMethod · 0.95

Calls 3

isDurationFunction · 0.85
prettyUnitFunction · 0.70
wrapperFunction · 0.70

Tested by

no test coverage detected