@icewhale/zimaos-localstorage-openapi
Advanced tools
Comparing version 1.2.0-alpha20 to 1.2.0-alpha21
@@ -685,2 +685,8 @@ /** | ||
* | ||
* @type {number} | ||
* @memberof Raid | ||
*/ | ||
'disk_number'?: number; | ||
/** | ||
* | ||
* @type {string} | ||
@@ -687,0 +693,0 @@ * @memberof Raid |
@@ -138,46 +138,7 @@ "use strict"; | ||
return needsSerialization | ||
? JSON.stringify(value !== undefined ? convertMapsAndSetsToPlain(value) : {}) | ||
? JSON.stringify(value !== undefined ? value : {}) | ||
: (value || ""); | ||
}; | ||
exports.serializeDataIfNeeded = serializeDataIfNeeded; | ||
function convertMapsAndSetsToPlain(value) { | ||
if (typeof Set === "undefined") | ||
return value; | ||
if (typeof Map === "undefined") | ||
return value; | ||
if (typeof value !== "object" || !value) { | ||
return value; | ||
} | ||
if (value instanceof Set) { | ||
return Array.from(value).map(item => convertMapsAndSetsToPlain(item)); | ||
} | ||
if (value instanceof Map) { | ||
const entries = []; | ||
value.forEach((value, key) => { | ||
entries.push([key, convertMapsAndSetsToPlain(value)]); | ||
}); | ||
return objectFromEntries(entries); | ||
} | ||
if (Array.isArray(value)) { | ||
return value.map(it => convertMapsAndSetsToPlain(it)); | ||
} | ||
return objectFromEntries(objectEntries(value) | ||
.map(([k, v]) => [k, convertMapsAndSetsToPlain(v)])); | ||
} | ||
/** | ||
* Ponyfill for Object.entries | ||
*/ | ||
function objectEntries(object) { | ||
return Object.keys(object).map(key => [key, object[key]]); | ||
} | ||
/** | ||
* Ponyfill for Object.fromEntries | ||
*/ | ||
function objectFromEntries(entries) { | ||
return [...entries].reduce((object, [key, val]) => { | ||
object[key] = val; | ||
return object; | ||
}, {}); | ||
} | ||
/** | ||
* | ||
@@ -184,0 +145,0 @@ * @export |
{ | ||
"name": "@icewhale/zimaos-localstorage-openapi", | ||
"version": "v1.2.0-alpha20", | ||
"version": "v1.2.0-alpha21", | ||
"scripts": { | ||
@@ -5,0 +5,0 @@ "build": "rm -rf dist && tsc && rm -rf generate", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
151522
3781