Add settings page for managing forecasting API key and URL via UI
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
cae411eae7
commit
1c411e402e
19809 changed files with 1962608 additions and 97 deletions
33
frontend/node_modules/es-toolkit/dist/compat/util/toPlainObject.mjs
generated
vendored
Normal file
33
frontend/node_modules/es-toolkit/dist/compat/util/toPlainObject.mjs
generated
vendored
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
import { keysIn } from "../object/keysIn.mjs";
|
||||
//#region src/compat/util/toPlainObject.ts
|
||||
/**
|
||||
* Converts value to a plain object flattening inherited enumerable string keyed properties of value to own properties of the plain object.
|
||||
*
|
||||
* @param value The value to convert.
|
||||
* @returns Returns the converted plain object.
|
||||
*
|
||||
* @example
|
||||
* function Foo() {
|
||||
* this.b = 2;
|
||||
* }
|
||||
* Foo.prototype.c = 3;
|
||||
* toPlainObject(new Foo()); // { b: 2, c: 3 }
|
||||
*/
|
||||
function toPlainObject(value) {
|
||||
const plainObject = {};
|
||||
const valueKeys = keysIn(value);
|
||||
for (let i = 0; i < valueKeys.length; i++) {
|
||||
const key = valueKeys[i];
|
||||
const objValue = value[key];
|
||||
if (key === "__proto__") Object.defineProperty(plainObject, key, {
|
||||
configurable: true,
|
||||
enumerable: true,
|
||||
value: objValue,
|
||||
writable: true
|
||||
});
|
||||
else plainObject[key] = objValue;
|
||||
}
|
||||
return plainObject;
|
||||
}
|
||||
//#endregion
|
||||
export { toPlainObject };
|
||||
Loading…
Add table
Add a link
Reference in a new issue