@t2000/sdk 10.13.1 → 10.13.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.js.map +1 -1
- package/dist/index.cjs +8 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +8 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3433,7 +3433,12 @@ function requirementFieldMap(listing) {
|
|
|
3433
3433
|
return listing;
|
|
3434
3434
|
}
|
|
3435
3435
|
function requirementHint(value) {
|
|
3436
|
-
|
|
3436
|
+
if (typeof value === "string") return value;
|
|
3437
|
+
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
3438
|
+
const desc = value.description;
|
|
3439
|
+
if (typeof desc === "string" && desc.trim().length > 0) return desc;
|
|
3440
|
+
}
|
|
3441
|
+
return JSON.stringify(value);
|
|
3437
3442
|
}
|
|
3438
3443
|
function isPlainObject(value) {
|
|
3439
3444
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
@@ -3444,7 +3449,8 @@ function assertBuyerRequirements(listingRequirements, buyerPayload) {
|
|
|
3444
3449
|
}
|
|
3445
3450
|
if (isPlainObject(listingRequirements)) {
|
|
3446
3451
|
const fields = requirementFieldMap(listingRequirements);
|
|
3447
|
-
const
|
|
3452
|
+
const requiredRaw = listingRequirements.required;
|
|
3453
|
+
const keys = isPlainObject(listingRequirements.properties) && Array.isArray(requiredRaw) && requiredRaw.every((k) => typeof k === "string") ? requiredRaw : Object.keys(fields);
|
|
3448
3454
|
if (keys.length === 0) {
|
|
3449
3455
|
return;
|
|
3450
3456
|
}
|