MCPcopy Index your code
hub / github.com/nodejs/node / write

Method write

tools/license2rtf.mjs:244–270  ·  view source on GitHub ↗
({ li, level, lines, inLicenseBlock: lic })

Source from the content-addressed store, hash-verified

242 }
243
244 write({ li, level, lines, inLicenseBlock: lic }) {
245 if (!this.didWriteAnything) {
246 this.emitHeader();
247 this.didWriteAnything = true;
248 }
249
250 if (li)
251 level++;
252
253 let rtf = '\\pard\\sa150\\sl300\\slmult1';
254 if (level > 0)
255 rtf += `\\li${level * 240}`;
256 if (li)
257 rtf += `\\tx${level * 240}\\fi-240`;
258 if (lic)
259 rtf += '\\ri240';
260 if (!lic)
261 rtf += '\\b';
262 if (li)
263 rtf += ` ${li}\\tab`;
264 rtf += ` ${lines.map(rtfEscape).join('\\line ')}`;
265 if (!lic)
266 rtf += '\\b0';
267 rtf += '\\par\n';
268
269 this.emit('data', rtf);
270 }
271
272 end(data) {
273 if (data)

Callers 1

endMethod · 0.95

Calls 4

emitHeaderMethod · 0.95
mapMethod · 0.65
joinMethod · 0.45
emitMethod · 0.45

Tested by

no test coverage detected