1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
/* globals bench, set */
import fs from 'node:fs';
import stripJsonComments from './index.js';
const json = fs.readFileSync('sample.json', 'utf8');
const bigJson = fs.readFileSync('sample-big.json', 'utf8');
bench('strip JSON comments', () => {
set('type', 'static');
stripJsonComments(json);
});
bench('strip JSON comments without whitespace', () => {
stripJsonComments(json, {whitespace: false});
});
bench('strip Big JSON comments', () => {
stripJsonComments(bigJson);
});
|