Stringify an object/array like JSON.stringify just without all the double-quotes
by sindresorhusJavaScript
Last 12 weeks · 2 commits
4 of 6 standards met
I saw you merge some PRs. Maybe you will interested in this PR, too? These commits will stringify following object correctly: It also handle comment between function name and function body. (See test cases) I saw you close #65 , but I want this feature, so I add it in my own fork. I add many test cases for this feature. If you would like to merge these commits, I can rebase them on the current version.
I believe that doesn't correctly escape special characters in strings. Consider the following program: I'd expect to give results similar to , in that both should return a valid JavaScript expression. However, both the tab character and the backslash are not escaped, but are copied to the output verbatim. In the case of the tab character, the resulting code is unexpected but still technically correct. In the case of the backslash, the resulting code is no valid JavaScript any more, but leaves an unterminated string. Only the newline character is escaped as expected.
Repository: sindresorhus/stringify-object. Description: Stringify an object/array like JSON.stringify just without all the double-quotes Stars: 325, Forks: 43. Primary language: JavaScript. Languages: JavaScript (100%). License: BSD-2-Clause. Latest release: v7.0.0 (3d ago). Open PRs: 0, open issues: 0. Last activity: 3d ago. Community health: 85%. Top contributors: sindresorhus, SBoudrias, searls, danilosampaio, arthurvr, verhovsky, cpiber, chuvikovd, forivall, GHolk and others.