MCPcopy
hub / github.com/sparkjsdev/spark / constructor

Method constructor

src/dyno/util.ts:400–413  ·  view source on GitHub ↗
({ value }: { value: DynoVal<T> })

Source from the content-addressed store, hash-verified

398 implements HasDynoOut<"vec4">
399{
400 constructor({ value }: { value: DynoVal<T> }) {
401 super({
402 inTypes: { value: valType(value) },
403 outTypes: { hash: "vec4" },
404 inputs: { value },
405 construct: ({ value }) => {
406 if (!value) {
407 throw new Error("value is required");
408 }
409 const words = hash4(value);
410 return { hash: mul(vec4(words), dynoConst("float", 1 / 2 ** 32)) };
411 },
412 });
413 }
414 dynoOut(): DynoValue<"vec4"> {
415 return new DynoOutput(this, "hash");
416 }

Callers

nothing calls this directly

Calls 5

valTypeFunction · 0.90
mulFunction · 0.90
vec4Function · 0.90
dynoConstFunction · 0.90
hash4Function · 0.85

Tested by

no test coverage detected