Open Fdawgs opened 1 month ago
Hey! Good catch - .json should definitely never mutate the object - getting swamped at work, will look at a fix hopefully this weekend Cheers
Thanks @spencermountain, no worries! Just to reiterate, it seems to be all/most of the .dates()
functions mutates it, not just .json()
. I.e. doc.dates(context).format('{month} {date-ordinal}')
also does it.
Node version: 20.13.1 Compromise version: 14.13.0 Compromise-dates version: 3.5.0
Using the compromise-dates plugin, any call to the
.dates()
functions (.json()
,.get()
,.format()
etc.) mutates thetoday
value in the context param obj to a SpaceTime object, which is an unexpected side-effect: