sindresorhus

stringify-object

Stringify an object/array like JSON.stringify just without all the double-quotes

by sindresorhus

JavaScript

JavaScript100%

Commit activity

Last 12 weeks · 1 commit

Full graph →

Community health

4 of 6 standards met

Community profile →
85
✓README✓License✓Contributing✓Code of Conduct○Issue Template○PR Template
GHolk

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.

GHolk · 1y ago
leonbloy

It would be nice that the Map object were supported https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map https://stackoverflow.com/questions/29085197/how-do-you-json-stringify-an-es6-map

leonbloy · 1y ago
DanielSWolf

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.

DanielSWolf · 1y ago
Structured data for AI agents

Repository: sindresorhus/stringify-object. Description: Stringify an object/array like JSON.stringify just without all the double-quotes Stars: 325, Forks: 41. Primary language: JavaScript. Languages: JavaScript (100%). License: BSD-2-Clause. Latest release: v7.0.0 (3mo ago). Open PRs: 0, open issues: 0. Last activity: 1mo ago. Community health: 85%. Top contributors: sindresorhus, SBoudrias, searls, danilosampaio, arthurvr, verhovsky, cpiber, chuvikovd, forivall, GHolk and others.