@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.d.ts +5 -2
- package/lib/shipload.js +4 -3
- package/lib/shipload.js.map +1 -1
- package/lib/shipload.m.js +4 -3
- package/lib/shipload.m.js.map +1 -1
- package/package.json +1 -1
- package/src/index-module.ts +1 -1
- package/src/utils/display-name.ts +11 -2
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
|
}
|