MCPcopy
hub / github.com/prisma/prisma / slice

Method slice

packages/client/src/runtime/utils/SourceFileSlice.ts:118–121  ·  view source on GitHub ↗

* Creates a new slice from a subset of specified lines of the new code * Lines of a slice can still be manipulated using their number in original file * * @example * ```ts * const slice = source.slice(80, 100) * slice.lineAt(80) === source.lineAt(80) * ``` * * @param fromL

(fromLine: number, toLine: number)

Source from the content-addressed store, hash-verified

116 * @returns
117 */
118 slice(fromLine: number, toLine: number): SourceFileSlice {
119 const slicedLines = this.lines.slice(fromLine - 1, toLine).join('\n')
120 return new SourceFileSlice(fromLine, dedent(slicedLines).split('\n'))
121 }
122
123 /**
124 * Returns new `SourceFileLines` object, where code inside of it have been

Callers 15

setupScenarioFunction · 0.45
run-tests.tsFile · 0.45
createItxScopeIdFunction · 0.45
prism.tsFile · 0.45
deepCloneValueFunction · 0.45
deepSetFunction · 0.45
getTemplateParametersFunction · 0.45
findPrismaActionCallFunction · 0.45
pickMultipleMethod · 0.45
generateSentenceMethod · 0.45

Calls 1

dedentFunction · 0.90

Tested by 6

setupScenarioFunction · 0.36
pickMultipleMethod · 0.36
generateSentenceMethod · 0.36
generatePostMethod · 0.36
parseQueryInsightFunction · 0.36
parseQueryInsightFunction · 0.36