Package Exports
- @u4/stringify-object
Readme
@u4/stringify-object
A zero-dependency, TypeScript-first fork of stringify-object@6.0.0. The implementation is copied locally (no runtime deps) while preserving the original behavior: handles objects, arrays, Maps/Sets, Dates, Symbols, circular references, and supports transform, filter, indent, singleQuotes, and inlineCharacterLimit options.
Install
npm install @u4/stringify-objectUsage
import stringifyObject from '@u4/stringify-object';
const input = {foo: 'bar', baz: [1, 2, 3]};
console.log(stringifyObject(input));
// {
// foo: 'bar',
// baz: [
// 1,
// 2,
// 3
// ]
// }With options:
stringifyObject(new Map([['x', 1]]), {singleQuotes: false, indent: ' '});
// new Map([
// ["x", 1]
// ])Scripts
bun run build— emitdist/index.jsanddist/index.d.tsfor publishing.bun test— run the test suite.