MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / writeNybble

Method writeNybble

modules/commodetto/commodettoRLE4Out.js:142–159  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

140 }
141
142 writeNybble(value) {
143 let output = this.output;
144
145 if ((value < 0) || (value > 15))
146 throw new Error("invalid nybble");
147
148 if (output.firstNybble) {
149 output[output.position] = value;
150
151 output.firstNybble = false;
152 }
153 else {
154 output[output.position] |= value << 4;
155
156 output.position += 1;
157 output.firstNybble = true;
158 }
159 }
160}

Callers 1

sendMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected