You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Could we use predefined numeric constants + bit comparisons to represent the types? It'll make the meta a little less human readable, but we'll save bytes in both the library and the transported JSON. We could even compile away the constants during our build which would compress the bundled code size further.
constStringType=1;constDateType=2;constArrayType=3;// in untransformswitch(0){casefieldType^StringType:
returnString(fieldValue);casefieldType^DateType:
returnDate(fieldValue);casefiledType^ArrayType:
returntoArray(fieldValue);// ...}
The compiled code will look something like this (whitespace notwithstanding):
Good idea! This is one of the ideas proposed in #11.
Out of curiosity, what's the advantage of switch (0) { case fieldType ^ StringType: ... } over switch (fieldType) { case StringType: ... } in your code snippet?
When serialising a list of Dates, our meta will grow very large:
We could save some space by serialising to the following instead:
(
Date
is chosen because it occurs most intimestamps
)The text was updated successfully, but these errors were encountered: