|
|
|
|
|
by 3dfan
2448 days ago
|
|
Why is this needed in the codebase? export const getFullYear = 'getFullYear';
export const getMonth = 'getMonth';
export const getDate = 'getDate';
export const getDay = 'getDay';
export const getHours = 'getHours';
export const getMinutes = 'getMinutes';
export const getSeconds = 'getSeconds';
export const getMilliseconds = 'getMilliseconds';
To be seen here:https://github.com/leeoniya/uPlot/blob/master/src/fmtDate.js |
|
d.getHours();d.getHours(); cannot be compressed but d[getHours]();d[getHours](); can compress to d[a]();d[a]().
do this enough times and you've saved 1kb.
you should see the kinds of compression hacks the Preact team does ;)