@sheerid/jslib 1.140.0 → 1.142.0

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.
Files changed (52) hide show
  1. package/es5/Tmetrix.bundle.js +4 -4
  2. package/es5/messages_ar.bundle.js +4 -4
  3. package/es5/messages_bg.bundle.js +4 -4
  4. package/es5/messages_cs.bundle.js +4 -4
  5. package/es5/messages_da.bundle.js +4 -4
  6. package/es5/messages_de.bundle.js +4 -4
  7. package/es5/messages_el.bundle.js +4 -4
  8. package/es5/messages_en-GB.bundle.js +4 -4
  9. package/es5/messages_es-ES.bundle.js +4 -4
  10. package/es5/messages_es.bundle.js +4 -4
  11. package/es5/messages_fi.bundle.js +4 -4
  12. package/es5/messages_fr-CA.bundle.js +4 -4
  13. package/es5/messages_fr.bundle.js +4 -4
  14. package/es5/messages_ga.bundle.js +4 -4
  15. package/es5/messages_hr.bundle.js +4 -4
  16. package/es5/messages_hu.bundle.js +4 -4
  17. package/es5/messages_id.bundle.js +4 -4
  18. package/es5/messages_it.bundle.js +4 -4
  19. package/es5/messages_iw.bundle.js +4 -4
  20. package/es5/messages_ja.bundle.js +4 -4
  21. package/es5/messages_ko.bundle.js +4 -4
  22. package/es5/messages_lo.bundle.js +4 -4
  23. package/es5/messages_lt.bundle.js +4 -4
  24. package/es5/messages_ms.bundle.js +4 -4
  25. package/es5/messages_nl.bundle.js +4 -4
  26. package/es5/messages_no.bundle.js +4 -4
  27. package/es5/messages_pl.bundle.js +4 -4
  28. package/es5/messages_pt-BR.bundle.js +4 -4
  29. package/es5/messages_pt.bundle.js +4 -4
  30. package/es5/messages_ru.bundle.js +4 -4
  31. package/es5/messages_sk.bundle.js +4 -4
  32. package/es5/messages_sl.bundle.js +4 -4
  33. package/es5/messages_sr.bundle.js +4 -4
  34. package/es5/messages_sv.bundle.js +4 -4
  35. package/es5/messages_th.bundle.js +4 -4
  36. package/es5/messages_tr.bundle.js +4 -4
  37. package/es5/messages_zh-HK.bundle.js +4 -4
  38. package/es5/messages_zh.bundle.js +4 -4
  39. package/manifest.json +43 -43
  40. package/package.json +1 -1
  41. package/sheerid-requestOrg.css +4 -4
  42. package/sheerid-requestOrg.js +5 -5
  43. package/sheerid-requestOrg.js.map +1 -1
  44. package/sheerid-utils.js +4 -4
  45. package/sheerid.css +4 -4
  46. package/sheerid.js +6 -6
  47. package/sheerid.js.map +1 -1
  48. package/sheerides6.js +25 -20
  49. package/sheerides6.js.map +1 -1
  50. package/src/lib/types/types.d.ts +3 -3
  51. package/src/lib/validators/validators.d.ts +2 -0
  52. package/types-reference.zip +0 -0
package/sheerides6.js CHANGED
@@ -4348,6 +4348,8 @@ const ADOLESCENT_AGE = 16;
4348
4348
  const MIN_BIRTHYEAR = 1900;
4349
4349
  const MAX_BIRTHYEAR = 3000;
4350
4350
  const MAX_METADATA_KEYS = 50;
4351
+ const MAX_METADATA_KEY_LENGTH = 256;
4352
+ const MAX_METADATA_VALUE_LENGTH = 4096;
4351
4353
  const VALID_PHONE_NUMBER_REGEXPS = [
4352
4354
  /^\+?0*\d{10,}(x[0-9]{0,5})?$/,
4353
4355
  /(^\D?(\d{3})\D?\D?(\d{3})\D?(\d{4})$)/,
@@ -4368,13 +4370,13 @@ const ensureMaxMetadataKeyValueLengths = (metadata) => {
4368
4370
  for (const key in metadata) {
4369
4371
  let newKey = key;
4370
4372
  let newValue = metadata[key];
4371
- if (newValue.length > 256) {
4372
- logger.warn(`Truncating metadata value '${metadata[key]}' for key '${newKey}' (max length 256 characters).`);
4373
- newValue = newValue.substring(0, 256);
4373
+ if (newValue.length > MAX_METADATA_VALUE_LENGTH) {
4374
+ logger.warn(`Truncating metadata value '${metadata[key]}' for key '${newKey}' (max length ${MAX_METADATA_VALUE_LENGTH} characters).`);
4375
+ newValue = newValue.substring(0, MAX_METADATA_VALUE_LENGTH);
4374
4376
  }
4375
- if (newKey.length > 256) {
4376
- logger.warn(`Truncating metadata key '${key}' (max length 256 characters).`);
4377
- newKey = newKey.substring(0, 256);
4377
+ if (newKey.length > MAX_METADATA_KEY_LENGTH) {
4378
+ logger.warn(`Truncating metadata key '${key}' (max length ${MAX_METADATA_KEY_LENGTH} characters).`);
4379
+ newKey = newKey.substring(0, MAX_METADATA_KEY_LENGTH);
4378
4380
  }
4379
4381
  modifiedMetadata[newKey] = newValue;
4380
4382
  }
@@ -4588,20 +4590,23 @@ const getFileValidationError = (file) => {
4588
4590
  return invalidFileSizeEmptyError;
4589
4591
  }
4590
4592
  };
4591
- const getEbtCardValidationError = (value) => {
4592
- if (!value.match(/^\d{16,19}$/)) {
4593
- // Must be 16-19 digits
4594
- return "invalidEbtCardNumber";
4595
- }
4596
- if (value.startsWith("610098") && value.length !== 19) {
4597
- // this prefix must be 19 digits
4598
- return "invalidEbtCardNumber";
4599
- }
4600
- const checkSumExemptPrefixes = ["600486", "507712", "507714"];
4601
- const isExempt = checkSumExemptPrefixes.some((pref) => value.startsWith(pref));
4602
- if (!isExempt && !fastLuhn(value)) {
4603
- // Failed checksum
4604
- return "invalidEbtCardNumber";
4593
+ const getEbtCardValidationError = (value, formValidationOptions) => {
4594
+ const vm = formValidationOptions.viewModel;
4595
+ if (vm.statuses && vm.statuses.includes("SNAP_BENEFITS")) {
4596
+ if (!value.match(/^\d{16,19}$/)) {
4597
+ // Must be 16-19 digits
4598
+ return "invalidEbtCardNumber";
4599
+ }
4600
+ if (value.startsWith("610098") && value.length !== 19) {
4601
+ // this prefix must be 19 digits
4602
+ return "invalidEbtCardNumber";
4603
+ }
4604
+ const checkSumExemptPrefixes = ["600486", "507712", "507714"];
4605
+ const isExempt = checkSumExemptPrefixes.some((pref) => value.startsWith(pref));
4606
+ if (!isExempt && !fastLuhn(value)) {
4607
+ // Failed checksum
4608
+ return "invalidEbtCardNumber";
4609
+ }
4605
4610
  }
4606
4611
  };
4607
4612
  const getPostalCodeValidationError = (value, formValidationOptions) => {