Update code
This commit is contained in:
10
dev-assistant-mcp/node_modules/form-data-encoder/lib/esm/util/createBoundary.js
generated
vendored
Normal file
10
dev-assistant-mcp/node_modules/form-data-encoder/lib/esm/util/createBoundary.js
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
const alphabet = "abcdefghijklmnopqrstuvwxyz0123456789";
|
||||
function createBoundary() {
|
||||
let size = 16;
|
||||
let res = "";
|
||||
while (size--) {
|
||||
res += alphabet[(Math.random() * alphabet.length) << 0];
|
||||
}
|
||||
return res;
|
||||
}
|
||||
export default createBoundary;
|
||||
5
dev-assistant-mcp/node_modules/form-data-encoder/lib/esm/util/escapeName.js
generated
vendored
Normal file
5
dev-assistant-mcp/node_modules/form-data-encoder/lib/esm/util/escapeName.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
const escapeName = (name) => String(name)
|
||||
.replace(/\r/g, "%0D")
|
||||
.replace(/\n/g, "%0A")
|
||||
.replace(/"/g, "%22");
|
||||
export default escapeName;
|
||||
9
dev-assistant-mcp/node_modules/form-data-encoder/lib/esm/util/isFileLike.js
generated
vendored
Normal file
9
dev-assistant-mcp/node_modules/form-data-encoder/lib/esm/util/isFileLike.js
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
import isFunction from "./isFunction.js";
|
||||
export const isFileLike = (value) => Boolean(value
|
||||
&& typeof value === "object"
|
||||
&& isFunction(value.constructor)
|
||||
&& value[Symbol.toStringTag] === "File"
|
||||
&& isFunction(value.stream)
|
||||
&& value.name != null
|
||||
&& value.size != null
|
||||
&& value.lastModified != null);
|
||||
9
dev-assistant-mcp/node_modules/form-data-encoder/lib/esm/util/isFormData.js
generated
vendored
Normal file
9
dev-assistant-mcp/node_modules/form-data-encoder/lib/esm/util/isFormData.js
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
import isFunction from "./isFunction.js";
|
||||
export const isFormData = (value) => Boolean(value
|
||||
&& isFunction(value.constructor)
|
||||
&& value[Symbol.toStringTag] === "FormData"
|
||||
&& isFunction(value.append)
|
||||
&& isFunction(value.getAll)
|
||||
&& isFunction(value.entries)
|
||||
&& isFunction(value[Symbol.iterator]));
|
||||
export const isFormDataLike = isFormData;
|
||||
2
dev-assistant-mcp/node_modules/form-data-encoder/lib/esm/util/isFunction.js
generated
vendored
Normal file
2
dev-assistant-mcp/node_modules/form-data-encoder/lib/esm/util/isFunction.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
const isFunction = (value) => (typeof value === "function");
|
||||
export default isFunction;
|
||||
13
dev-assistant-mcp/node_modules/form-data-encoder/lib/esm/util/isPlainObject.js
generated
vendored
Normal file
13
dev-assistant-mcp/node_modules/form-data-encoder/lib/esm/util/isPlainObject.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
const getType = (value) => (Object.prototype.toString.call(value).slice(8, -1).toLowerCase());
|
||||
function isPlainObject(value) {
|
||||
if (getType(value) !== "object") {
|
||||
return false;
|
||||
}
|
||||
const pp = Object.getPrototypeOf(value);
|
||||
if (pp === null || pp === undefined) {
|
||||
return true;
|
||||
}
|
||||
const Ctor = pp.constructor && pp.constructor.toString();
|
||||
return Ctor === Object.toString();
|
||||
}
|
||||
export default isPlainObject;
|
||||
9
dev-assistant-mcp/node_modules/form-data-encoder/lib/esm/util/normalizeValue.js
generated
vendored
Normal file
9
dev-assistant-mcp/node_modules/form-data-encoder/lib/esm/util/normalizeValue.js
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
const normalizeValue = (value) => String(value)
|
||||
.replace(/\r|\n/g, (match, i, str) => {
|
||||
if ((match === "\r" && str[i + 1] !== "\n")
|
||||
|| (match === "\n" && str[i - 1] !== "\r")) {
|
||||
return "\r\n";
|
||||
}
|
||||
return match;
|
||||
});
|
||||
export default normalizeValue;
|
||||
Reference in New Issue
Block a user