@signiphi/page-assembly 0.2.0-beta.11 → 0.2.0-beta.12

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.mjs CHANGED
@@ -1414,11 +1414,17 @@ function getBaseFieldName(encodedName) {
1414
1414
  }
1415
1415
  return baseName;
1416
1416
  }
1417
+ function stripFieldTypeSuffix(value) {
1418
+ const stripped = value.replace(/_(signature|initials|date)$/i, "");
1419
+ return stripped || value;
1420
+ }
1417
1421
  function getSignerFromFieldName(encodedName) {
1418
1422
  if (encodedName.includes("__SIGNER__")) {
1419
1423
  const parts = encodedName.split("__SIGNER__");
1420
1424
  if (parts[1]) {
1421
- return parts[1].split("__")[0] || parts[1];
1425
+ const segment = parts[1].split("__")[0] || parts[1];
1426
+ const isTerminal = segment === parts[1];
1427
+ return isTerminal ? stripFieldTypeSuffix(segment) : segment;
1422
1428
  }
1423
1429
  }
1424
1430
  return void 0;