dayjs icon indicating copy to clipboard operation
dayjs copied to clipboard

fix: do not modify dayjs input arguments

Open kzahel opened this issue 4 years ago • 2 comments

I noticed that when passing in an array of date formats:

"If you don't know the exact format of an input string, but know it could be one of many, you can use an array of formats." (from https://day.js.org/docs/en/parse/string-format) it was actually modifying the input array. This seems pretty bad.

I'm not sure if your build supports the ... syntax. It could be changed to Object.assign or similar if you want.

kzahel avatar Jun 11 '21 11:06 kzahel

Codecov Report

Merging #1529 (2f790ae) into dev (c5688f3) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##               dev     #1529   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          176       176           
  Lines         1980      1982    +2     
  Branches       502       503    +1     
=========================================
+ Hits          1980      1982    +2     
Impacted Files Coverage Δ
src/index.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update c5688f3...2f790ae. Read the comment docs.

codecov[bot] avatar Jun 11 '21 11:06 codecov[bot]

this is a nice catch, however, ... syntax will result in a large increase of the bundle size, maybe we should looking for some other way to fix this.

iamkun avatar Jun 28 '21 06:06 iamkun