Skip to content

Commit

Permalink
cleanup(core): use built in function to strip control chars (#28778)
Browse files Browse the repository at this point in the history
(cherry picked from commit 5d21f21)
  • Loading branch information
43081j authored and FrozenPandaz committed Nov 5, 2024
1 parent aa38cb4 commit 856709b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions scripts/documentation/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import {
import { join } from 'path';
import { format, resolveConfig } from 'prettier';
import { CommandModule } from 'yargs';
import { stripVTControlCharacters } from 'node:util';

const stripAnsi = require('strip-ansi');
const importFresh = require('import-fresh');

export function sortAlphabeticallyFunction(a: string, b: string): number {
Expand Down Expand Up @@ -45,7 +45,10 @@ export async function generateMarkdownFile(
const filePath = join(outputDirectory, `${templateObject.name}.md`);
outputFileSync(
filePath,
await formatWithPrettier(filePath, stripAnsi(templateObject.template))
await formatWithPrettier(
filePath,
stripVTControlCharacters(templateObject.template)
)
);
}

Expand Down

0 comments on commit 856709b

Please sign in to comment.