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

Method constructor

out/cli.cjs:5970–6002  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5968 var TYPE = Symbol("type");
5969 var Blob5 = class _Blob {
5970 constructor() {
5971 this[TYPE] = "";
5972 const blobParts = arguments[0];
5973 const options = arguments[1];
5974 const buffers = [];
5975 let size = 0;
5976 if (blobParts) {
5977 const a4 = blobParts;
5978 const length = Number(a4.length);
5979 for (let i3 = 0; i3 < length; i3++) {
5980 const element = a4[i3];
5981 let buffer;
5982 if (element instanceof Buffer) {
5983 buffer = element;
5984 } else if (ArrayBuffer.isView(element)) {
5985 buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength);
5986 } else if (element instanceof ArrayBuffer) {
5987 buffer = Buffer.from(element);
5988 } else if (element instanceof _Blob) {
5989 buffer = element[BUFFER];
5990 } else {
5991 buffer = Buffer.from(typeof element === "string" ? element : String(element));
5992 }
5993 size += buffer.length;
5994 buffers.push(buffer);
5995 }
5996 }
5997 this[BUFFER] = Buffer.concat(buffers);
5998 let type2 = options && options.type !== void 0 && String(options.type).toLowerCase();
5999 if (type2 && !/[^\u0020-\u007E]/.test(type2)) {
6000 this[TYPE] = type2;
6001 }
6002 }
6003 get size() {
6004 return this[BUFFER].length;
6005 }

Callers

nothing calls this directly

Calls 8

concatMethod · 0.80
toLowerCaseMethod · 0.80
testMethod · 0.80
encodeMethod · 0.80
fromMethod · 0.45
pushMethod · 0.45
setMethod · 0.45
sliceMethod · 0.45

Tested by

no test coverage detected