@shipload/sdk 1.0.0-next.30 → 1.0.0-next.31

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/lib/shipload.m.js CHANGED
@@ -13165,10 +13165,11 @@ function normalizeDisplayName(input) {
13165
13165
  end--;
13166
13166
  return input.slice(start, end);
13167
13167
  }
13168
- function validateDisplayName(input) {
13168
+ function validateDisplayName(input, opts = {}) {
13169
13169
  const name = normalizeDisplayName(input);
13170
- if (name.length === 0)
13171
- return { valid: false, reason: 'empty', name };
13170
+ if (name.length === 0) {
13171
+ return opts.allowEmpty ? { valid: true, name } : { valid: false, reason: 'empty', name };
13172
+ }
13172
13173
  if (textEncoder.encode(name).length > MAX_DISPLAY_NAME_BYTES) {
13173
13174
  return { valid: false, reason: 'too_long', name };
13174
13175
  }