MCPcopy Create free account
hub / github.com/microsoft/SandDance / addEncode

Function addEncode

docs/app/js/sanddance-app.js:146846–146855  ·  view source on GitHub ↗
(object, name, value1, set)

Source from the content-addressed store, hash-verified

146844 value: _
146845 };
146846function addEncode(object, name, value1, set) {
146847 if (value1 != null) {
146848 const isEncoder = (0, _vegaUtil.isObject)(value1) && !(0, _vegaUtil.isArray)(value1) || (0, _vegaUtil.isArray)(value1) && value1.length && (0, _vegaUtil.isObject)(value1[0]); // Always assign signal to update, even if the signal is from the enter block
146849 if (isEncoder) object.update[name] = value1;
146850 else object[set || "enter"][name] = {
146851 value: value1
146852 };
146853 return 1;
146854 } else return 0;
146855}
146856function addEncoders(object, enter, update) {
146857 for(const name in enter)addEncode(object, name, enter[name]);
146858 for(const name1 in update)addEncode(object, name1, update[name1], "update");

Callers 1

addEncodersFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected