MCPcopy Create free account
hub / github.com/dfinity/cancan / createVideo

Function createVideo

scripts/seed.ts:204–223  ·  view source on GitHub ↗
(
  userNames: string[],
  videoNames: string[],
  captions: string[],
  _tags: string[]
)

Source from the content-addressed store, hash-verified

202}
203
204function createVideo(
205 userNames: string[],
206 videoNames: string[],
207 captions: string[],
208 _tags: string[]
209): Video {
210 const userId = sample(userNames);
211 const name = videoNames[INDEX % videoNames.length];
212 const caption = sample(captions);
213 const tags = multiSample(_tags);
214 const likes = multiSample(userNames);
215 return {
216 userId,
217 name,
218 caption,
219 tags,
220 likes,
221 createdAt: Date.now(),
222 };
223}
224
225function randomize(num) {
226 return Math.floor(Math.random() * num);

Callers 1

generateSeedDataFunction · 0.70

Calls 2

sampleFunction · 0.85
multiSampleFunction · 0.85

Tested by

no test coverage detected