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

Method constructor

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

Source from the content-addressed store, hash-verified

242 implements HasDynoOut<"uvec2">
243{
244 constructor({ value }: { value: DynoVal<T> }) {
245 super({
246 inTypes: { value: valType(value) },
247 outTypes: { hash: "uvec2" },
248 inputs: { value },
249 construct: ({ value }) => {
250 if (!value) {
251 throw new Error("value is required");
252 }
253 let state = new PcgMix({ value: value }).outputs.state;
254 state = new PcgNext({ state }).outputs.state;
255 const x = new PcgHash({ state }).outputs.hash;
256 state = new PcgNext({ state }).outputs.state;
257 const y = new PcgHash({ state }).outputs.hash;
258 return { hash: combine({ vectorType: "uvec2", x, y }) };
259 },
260 });
261 }
262 dynoOut(): DynoValue<"uvec2"> {
263 return new DynoOutput(this, "hash");
264 }

Callers

nothing calls this directly

Calls 2

valTypeFunction · 0.90
combineFunction · 0.90

Tested by

no test coverage detected