Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign up| ★ wanayoo — archive 1999 https://github.com/yahoo/serialize-javascript/issues/43 | Nouvelle recherche | Portail wanayoo |
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign up
It would be handy for a use case I have for this package to support a feature that could inject code verbatim if it appears in a JavaScript object.
To implement, we could use (A) a special object constructor, (B) a special property on a string, or (C) a tagged template literal returning some special value, which would allow us to detect such cases in the serialization code.
A:
B:
C:
I tried a hack similar to #32 (comment) using a function as a value and overriding its
toStringmethod, but it didn't work since I can't include(in the code without it being rewritten as part of the function serialization.