MCPcopy
hub / github.com/midrender/revideo / replace

Method replace

packages/2d/src/lib/code/CodeSignal.ts:204–220  ·  view source on GitHub ↗
(
    range: CodeRange,
    code: string,
    duration?: number,
  )

Source from the content-addressed store, hash-verified

202 duration: number,
203 ): ThreadGenerator;
204 public replace(
205 range: CodeRange,
206 code: string,
207 duration?: number,
208 ): TOwner | ThreadGenerator {
209 if (duration === undefined) {
210 const current = this.get();
211 const [fragments, index] = extractRange(range, current.fragments);
212 fragments[index] = code;
213 return this.set({
214 progress: current.progress,
215 fragments,
216 });
217 } else {
218 return this.replaceTween(range, code, duration);
219 }
220 }
221
222 private *replaceTween(range: CodeRange, code: string, duration: number) {
223 let current = this.get();

Callers 9

insertMethod · 0.95
removeMethod · 0.95
drawTextMethod · 0.80
svgUrlMethod · 0.80
escapeSpecialCharsFunction · 0.80
prepareAudioFunction · 0.80
concatenateMediaFunction · 0.80
runFunction · 0.80
editorPluginFunction · 0.80

Calls 4

replaceTweenMethod · 0.95
extractRangeFunction · 0.90
setMethod · 0.65
getMethod · 0.45

Tested by

no test coverage detected