MCPcopy Index your code
hub / github.com/di-sukharev/opencommit / processBlobParts

Function processBlobParts

out/cli.cjs:51883–51905  ·  view source on GitHub ↗
(parts, options)

Source from the content-addressed store, hash-verified

51881 if (value !== "native") {
51882 value = "transparent";
51883 }
51884 return value;
51885 },
51886 defaultValue: "transparent"
51887 }
51888 ]);
51889 function processBlobParts(parts, options) {
51890 const bytes = [];
51891 for (const element of parts) {
51892 if (typeof element === "string") {
51893 let s2 = element;
51894 if (options.endings === "native") {
51895 s2 = convertLineEndingsNative(s2);
51896 }
51897 bytes.push(encoder.encode(s2));
51898 } else if (types.isAnyArrayBuffer(element) || types.isTypedArray(element)) {
51899 if (!element.buffer) {
51900 bytes.push(new Uint8Array(element));
51901 } else {
51902 bytes.push(
51903 new Uint8Array(element.buffer, element.byteOffset, element.byteLength)
51904 );
51905 }
51906 } else if (isBlobLike3(element)) {
51907 bytes.push(element);
51908 }

Callers 1

constructorMethod · 0.85

Calls 4

convertLineEndingsNativeFunction · 0.85
isBlobLike3Function · 0.85
encodeMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…