expensify-common 2.0.207 → 2.0.209

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/CONST.d.ts CHANGED
@@ -799,6 +799,7 @@ declare const CONST: {
799
799
  readonly REPLACE_CARD: "replace_card";
800
800
  readonly SHIP_CARD: "ship_card";
801
801
  readonly REPORT_CARD_FRAUD: "report_card_fraud";
802
+ readonly APPROVE_DIGITAL_WALLET: "approve_digital_wallet";
802
803
  readonly ISSUE_CARD: "issue_card";
803
804
  readonly UPDATE_CARD: "update_card";
804
805
  readonly UPDATE_PERSONAL_DETAILS: "update_personal_details";
package/dist/CONST.js CHANGED
@@ -842,6 +842,7 @@ const CONST = {
842
842
  REPLACE_CARD: 'replace_card',
843
843
  SHIP_CARD: 'ship_card',
844
844
  REPORT_CARD_FRAUD: 'report_card_fraud',
845
+ APPROVE_DIGITAL_WALLET: 'approve_digital_wallet',
845
846
  ISSUE_CARD: 'issue_card',
846
847
  UPDATE_CARD: 'update_card',
847
848
  UPDATE_PERSONAL_DETAILS: 'update_personal_details',
@@ -1214,13 +1214,18 @@ class ExpensiMark {
1214
1214
  },
1215
1215
  {
1216
1216
  name: 'anchor',
1217
- regex: /<(a)[^><]*href\s*=\s*(['"])(.*?)\2(?:".*?"|'.*?'|[^'"><])*>([\s\S]*?)<\/\1>(?![^<]*(<\/pre>|<\/code>))/gi,
1218
- replacement: (_extras, _match, _g1, _g2, g3, g4) => {
1219
- const email = g3.startsWith('mailto:') ? g3.slice(7) : '';
1220
- if (email === g4) {
1221
- return email;
1217
+ regex: /(\]\()?<(a)[^><]*href\s*=\s*(['"])(.*?)\3(?:".*?"|'.*?'|[^'"><])*>([\s\S]*?)<\/\2>(?![^<]*(<\/pre>|<\/code>))/gi,
1218
+ replacement: (_extras, _match, g1, _g2, _g3, g4, g5) => {
1219
+ const incompleteLinkStart = g1 !== null && g1 !== void 0 ? g1 : '';
1220
+ const email = g4.startsWith('mailto:') ? g4.slice(7) : '';
1221
+ if (email === g5) {
1222
+ return `${incompleteLinkStart}${email}`;
1222
1223
  }
1223
- return `[${g4}](${email || g3})`;
1224
+ // An autolinked URL right after an incomplete link's `](` has to stay bare, or the link nests a copy of it
1225
+ if (incompleteLinkStart && (g4 === g5 || g4 === `https://${g5}`)) {
1226
+ return `${incompleteLinkStart}${g5}`;
1227
+ }
1228
+ return `${incompleteLinkStart}[${g5}](${email || g4})`;
1224
1229
  },
1225
1230
  },
1226
1231
  {
@@ -799,6 +799,7 @@ declare const CONST: {
799
799
  readonly REPLACE_CARD: "replace_card";
800
800
  readonly SHIP_CARD: "ship_card";
801
801
  readonly REPORT_CARD_FRAUD: "report_card_fraud";
802
+ readonly APPROVE_DIGITAL_WALLET: "approve_digital_wallet";
802
803
  readonly ISSUE_CARD: "issue_card";
803
804
  readonly UPDATE_CARD: "update_card";
804
805
  readonly UPDATE_PERSONAL_DETAILS: "update_personal_details";
package/dist/esm/CONST.js CHANGED
@@ -837,6 +837,7 @@ const CONST = {
837
837
  REPLACE_CARD: 'replace_card',
838
838
  SHIP_CARD: 'ship_card',
839
839
  REPORT_CARD_FRAUD: 'report_card_fraud',
840
+ APPROVE_DIGITAL_WALLET: 'approve_digital_wallet',
840
841
  ISSUE_CARD: 'issue_card',
841
842
  UPDATE_CARD: 'update_card',
842
843
  UPDATE_PERSONAL_DETAILS: 'update_personal_details',
@@ -1176,13 +1176,18 @@ class ExpensiMark {
1176
1176
  },
1177
1177
  {
1178
1178
  name: 'anchor',
1179
- regex: /<(a)[^><]*href\s*=\s*(['"])(.*?)\2(?:".*?"|'.*?'|[^'"><])*>([\s\S]*?)<\/\1>(?![^<]*(<\/pre>|<\/code>))/gi,
1180
- replacement: (_extras, _match, _g1, _g2, g3, g4) => {
1181
- const email = g3.startsWith('mailto:') ? g3.slice(7) : '';
1182
- if (email === g4) {
1183
- return email;
1179
+ regex: /(\]\()?<(a)[^><]*href\s*=\s*(['"])(.*?)\3(?:".*?"|'.*?'|[^'"><])*>([\s\S]*?)<\/\2>(?![^<]*(<\/pre>|<\/code>))/gi,
1180
+ replacement: (_extras, _match, g1, _g2, _g3, g4, g5) => {
1181
+ const incompleteLinkStart = g1 !== null && g1 !== void 0 ? g1 : '';
1182
+ const email = g4.startsWith('mailto:') ? g4.slice(7) : '';
1183
+ if (email === g5) {
1184
+ return `${incompleteLinkStart}${email}`;
1184
1185
  }
1185
- return `[${g4}](${email || g3})`;
1186
+ // An autolinked URL right after an incomplete link's `](` has to stay bare, or the link nests a copy of it
1187
+ if (incompleteLinkStart && (g4 === g5 || g4 === `https://${g5}`)) {
1188
+ return `${incompleteLinkStart}${g5}`;
1189
+ }
1190
+ return `${incompleteLinkStart}[${g5}](${email || g4})`;
1186
1191
  },
1187
1192
  },
1188
1193
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expensify-common",
3
- "version": "2.0.207",
3
+ "version": "2.0.209",
4
4
  "author": "Expensify, Inc.",
5
5
  "description": "Expensify libraries and components shared across different repos",
6
6
  "homepage": "https://expensify.com",