@t2000/sdk 10.13.0 → 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/index.js CHANGED
@@ -3433,7 +3433,12 @@ function requirementFieldMap(listing) {
3433
3433
  return listing;
3434
3434
  }
3435
3435
  function requirementHint(value) {
3436
- return typeof value === "string" ? value : JSON.stringify(value);
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 keys = Object.keys(fields);
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
  }