MCPcopy Create free account
hub / github.com/apache/fory / writeElementsHeader

Function writeElementsHeader

javascript/packages/core/lib/gen/collection.ts:372–385  ·  view source on GitHub ↗
(accessor: string, flagAccessor: string)

Source from the content-addressed store, hash-verified

370 }
371
372 protected writeElementsHeader(accessor: string, flagAccessor: string) {
373 const item = this.scope.uniqueName("item");
374 const stmts = [];
375 stmts.push(`
376 for (const ${item} of ${accessor}) {
377 if (${item} === null || ${item} === undefined) {
378 ${flagAccessor} |= ${CollectionFlags.HAS_NULL};
379 break;
380 }
381 }
382 `);
383 stmts.push(`${this.builder.writer.writeUint8(flagAccessor)}`);
384 return stmts.join("\n");
385 }
386
387 writeSpecificType(accessor: string): string {
388 const item = this.scope.uniqueName("item");

Callers

nothing calls this directly

Calls 2

uniqueNameMethod · 0.80
writeUint8Method · 0.45

Tested by

no test coverage detected