MCPcopy
hub / github.com/di-sukharev/opencommit / "node_modules/formdata-node/lib/esm/Blob.js"

Function "node_modules/formdata-node/lib/esm/Blob.js"

out/cli.cjs:9085–9192  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9083var __classPrivateFieldGet, __classPrivateFieldSet, _Blob_parts, _Blob_type, _Blob_size, Blob3;
9084var init_Blob = __esm({
9085 "node_modules/formdata-node/lib/esm/Blob.js"() {
9086 init_ponyfill();
9087 init_isFunction();
9088 init_blobHelpers();
9089 __classPrivateFieldGet = function(receiver, state2, kind3, f4) {
9090 if (kind3 === "a" && !f4) throw new TypeError("Private accessor was defined without a getter");
9091 if (typeof state2 === "function" ? receiver !== state2 || !f4 : !state2.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
9092 return kind3 === "m" ? f4 : kind3 === "a" ? f4.call(receiver) : f4 ? f4.value : state2.get(receiver);
9093 };
9094 __classPrivateFieldSet = function(receiver, state2, value, kind3, f4) {
9095 if (kind3 === "m") throw new TypeError("Private method is not writable");
9096 if (kind3 === "a" && !f4) throw new TypeError("Private accessor was defined without a setter");
9097 if (typeof state2 === "function" ? receiver !== state2 || !f4 : !state2.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
9098 return kind3 === "a" ? f4.call(receiver, value) : f4 ? f4.value = value : state2.set(receiver, value), value;
9099 };
9100 Blob3 = class _Blob {
9101 constructor(blobParts = [], options = {}) {
9102 _Blob_parts.set(this, []);
9103 _Blob_type.set(this, "");
9104 _Blob_size.set(this, 0);
9105 options !== null && options !== void 0 ? options : options = {};
9106 if (typeof blobParts !== "object" || blobParts === null) {
9107 throw new TypeError("Failed to construct 'Blob': The provided value cannot be converted to a sequence.");
9108 }
9109 if (!isFunction(blobParts[Symbol.iterator])) {
9110 throw new TypeError("Failed to construct 'Blob': The object must have a callable @@iterator property.");
9111 }
9112 if (typeof options !== "object" && !isFunction(options)) {
9113 throw new TypeError("Failed to construct 'Blob': parameter 2 cannot convert to dictionary.");
9114 }
9115 const encoder = new TextEncoder();
9116 for (const raw of blobParts) {
9117 let part;
9118 if (ArrayBuffer.isView(raw)) {
9119 part = new Uint8Array(raw.buffer.slice(raw.byteOffset, raw.byteOffset + raw.byteLength));
9120 } else if (raw instanceof ArrayBuffer) {
9121 part = new Uint8Array(raw.slice(0));
9122 } else if (raw instanceof _Blob) {
9123 part = raw;
9124 } else {
9125 part = encoder.encode(String(raw));
9126 }
9127 __classPrivateFieldSet(this, _Blob_size, __classPrivateFieldGet(this, _Blob_size, "f") + (ArrayBuffer.isView(part) ? part.byteLength : part.size), "f");
9128 __classPrivateFieldGet(this, _Blob_parts, "f").push(part);
9129 }
9130 const type2 = options.type === void 0 ? "" : String(options.type);
9131 __classPrivateFieldSet(this, _Blob_type, /^[\x20-\x7E]*$/.test(type2) ? type2 : "", "f");
9132 }
9133 static [(_Blob_parts = /* @__PURE__ */ new WeakMap(), _Blob_type = /* @__PURE__ */ new WeakMap(), _Blob_size = /* @__PURE__ */ new WeakMap(), Symbol.hasInstance)](value) {
9134 return Boolean(value && typeof value === "object" && isFunction(value.constructor) && (isFunction(value.stream) || isFunction(value.arrayBuffer)) && /^(Blob|File)$/.test(value[Symbol.toStringTag]));
9135 }
9136 get type() {
9137 return __classPrivateFieldGet(this, _Blob_type, "f");
9138 }
9139 get size() {
9140 return __classPrivateFieldGet(this, _Blob_size, "f");
9141 }
9142 slice(start, end, contentType) {

Callers

nothing calls this directly

Calls 3

hasMethod · 0.45
getMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…