MCPcopy
hub / github.com/prettier/prettier / split

Method split

src/utilities/whitespace-utilities.js:85–91  ·  view source on GitHub ↗
(text, captureWhitespace = false)

Source from the content-addressed store, hash-verified

83 }
84
85 split(text, captureWhitespace = false) {
86 const pattern = `[${escapeStringRegexp(
87 [...this.#whitespaceCharacters].join(""),
88 )}]+`;
89 const regexp = new RegExp(captureWhitespace ? `(${pattern})` : pattern);
90 return text.split(regexp);
91 }
92
93 hasWhitespaceCharacter(text) {
94 const whitespaceCharacters = this.#whitespaceCharacters;

Callers 15

eslint.config.jsFile · 0.80
jest.config.jsFile · 0.80
getFileBasenameFunction · 0.80
extractInterpolationFunction · 0.80
restoreNameFunction · 0.80
getTextValuePartsFunction · 0.80
parsePermissionsPolicyFunction · 0.80
splitWithSingleSpaceFunction · 0.80

Calls

no outgoing calls

Tested by 3

getUnformattedFilesFunction · 0.64
makePluginFunction · 0.64
indentFunction · 0.64