Files
klz-cables.com/.pnpm-store/v10/files/8d/afc776b67029d404a33d3e329542308091b4e35166a7cc5dfdc113c633b54a14f1d0894a9672e6e87c0c9fe40e26db321ab4470e4751fe831130ece83f13a0
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

42 lines
910 B
Plaintext

export type Options = {
/**
Strip trailing commas in addition to comments.
@default false
*/
readonly trailingCommas?: boolean;
/**
Replace comments and trailing commas with whitespace instead of stripping them entirely.
@default true
*/
readonly whitespace?: boolean;
};
/**
Strip comments from JSON. Lets you use comments in your JSON files!
It will replace single-line comments `//` and multi-line comments `/**\/` with whitespace. This allows JSON error positions to remain as close as possible to the original source.
@param jsonString - Accepts a string with JSON.
@returns A JSON string without comments.
@example
```
import stripJsonComments from 'strip-json-comments';
const json = `{
// Rainbows
"unicorn": "cake"
}`;
JSON.parse(stripJsonComments(json));
//=> {unicorn: 'cake'}
```
*/
export default function stripJsonComments(
jsonString: string,
options?: Options
): string;