Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion integrationTests/node/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ const graphqlPackageJSON = JSON.parse(
);

const nodeVersions = graphqlPackageJSON.engines.node
.replaceAll('^', '')
.replaceAll('>=', '')
.split(' || ')
.map((version) => version.replace('^', '').replace('>=', ''))
.sort((a, b) => b.localeCompare(a));

for (const version of nodeVersions) {
Expand Down
2 changes: 1 addition & 1 deletion src/__testUtils__/dedent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export function dedentString(string: string): string {
indent += char;
}

return trimmedStr.replace(RegExp('^' + indent, 'mg'), ''); // remove indent
return trimmedStr.replaceAll(RegExp('^' + indent, 'mg'), ''); // remove indent
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/__testUtils__/inspectStr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ export function inspectStr(str: Maybe<string>): string {
}
return JSON.stringify(str)
.replace(/^"|"$/g, '`')
.replace(/\\"/g, '"')
.replace(/\\\\/g, '\\');
.replaceAll('\\"', '"')
.replaceAll('\\\\', '\\');
}
2 changes: 1 addition & 1 deletion src/language/blockString.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export function printBlockString(
value: string,
options?: { minimize?: boolean },
): string {
const escapedValue = value.replace(/"""/g, '\\"""');
const escapedValue = value.replaceAll('"""', '\\"""');

// Expand a block string's raw value into independent lines.
const lines = escapedValue.split(/\r\n|[\n\r]/g);
Expand Down
2 changes: 1 addition & 1 deletion src/language/printer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ function wrap(
}

function indent(str: string): string {
return wrap(' ', str.replace(/\n/g, '\n '));
return wrap(' ', str.replaceAll('\n', '\n '));
}

function hasMultilineItems(maybeArray: Maybe<ReadonlyArray<string>>): boolean {
Expand Down
2 changes: 1 addition & 1 deletion src/utilities/printSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -317,5 +317,5 @@ function printDescription(
const prefix =
indentation && !firstInBlock ? '\n' + indentation : indentation;

return prefix + blockString.replace(/\n/g, '\n' + indentation) + '\n';
return prefix + blockString.replaceAll('\n', '\n' + indentation) + '\n';
}