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

Method prepend

packages/2d/src/lib/code/CodeSignal.ts:157–176  ·  view source on GitHub ↗
(
    first: string | number = 0.6,
    duration?: number,
  )

Source from the content-addressed store, hash-verified

155 public prepend(code: string, duration: number): ThreadGenerator;
156 public prepend(duration?: number): TagGenerator;
157 public prepend(
158 first: string | number = 0.6,
159 duration?: number,
160 ): TOwner | ThreadGenerator | TagGenerator {
161 if (typeof first === 'string') {
162 if (duration === undefined) {
163 const current = this.get();
164 return this.set({
165 progress: 0,
166 fragments: [first, ...current.fragments],
167 });
168 } else {
169 return this.prependTween(first, duration);
170 }
171 }
172
173 const savedDuration = first;
174 return (strings, ...tags) =>
175 this.prepend(resolveCodeTag(CODE(strings, ...tags), true), savedDuration);
176 }
177
178 public insert(point: CodePoint, code: string): TOwner;
179 public insert(

Callers 3

View2DClass · 0.80
constructorMethod · 0.80
constructorMethod · 0.80

Calls 5

prependTweenMethod · 0.95
resolveCodeTagFunction · 0.90
CODEFunction · 0.90
setMethod · 0.65
getMethod · 0.45

Tested by

no test coverage detected