expensify-common 2.0.45 → 2.0.47

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/API.js CHANGED
@@ -31,6 +31,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
31
31
  return (mod && mod.__esModule) ? mod : { "default": mod };
32
32
  };
33
33
  Object.defineProperty(exports, "__esModule", { value: true });
34
+ exports.default = API;
34
35
  // Use this deferred lib so we don't have a dependency on jQuery (so we can use this module in mobile)
35
36
  const simply_deferred_1 = require("simply-deferred");
36
37
  const lodash_1 = require("lodash");
@@ -817,4 +818,3 @@ function API(network, args) {
817
818
  },
818
819
  };
819
820
  }
820
- exports.default = API;
@@ -23,6 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.default = APIDeferred;
26
27
  /**
27
28
  * ----------------------------------------------------------------------------------------------
28
29
  * WIP, This is in the process of migration from web-e. Please add methods to this as is needed.|
@@ -238,4 +239,3 @@ function APIDeferred(promise, extractedProperty) {
238
239
  },
239
240
  };
240
241
  }
241
- exports.default = APIDeferred;
package/dist/Device.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getOSAndName = void 0;
3
+ exports.getOSAndName = getOSAndName;
4
4
  const ua_parser_js_1 = require("ua-parser-js");
5
5
  function getOSAndName() {
6
6
  const parser = new ua_parser_js_1.UAParser();
@@ -12,4 +12,3 @@ function getOSAndName() {
12
12
  deviceVersion: result.browser.version,
13
13
  };
14
14
  }
15
- exports.getOSAndName = getOSAndName;
@@ -867,6 +867,9 @@ class ExpensiMark {
867
867
  const replacedMatch = shouldKeepRawInput ? replacement(EXTRAS_DEFAULT, match[0], linkText, match[2], match[3]) : replacement(EXTRAS_DEFAULT, match[0], linkText, match[3]);
868
868
  replacedText = replacedText.concat(replacedMatch);
869
869
  startIndex = match.index + match[0].length;
870
+ // Line breaks (`\n`) followed by empty contents are already removed
871
+ // but line breaks inside contents should be parsed to <br/> to skip `autoEmail` rule
872
+ replacedText = this.replace(replacedText, { filterRules: ['newline'], shouldEscapeText: false });
870
873
  // Now we move to the next match that the js regex found in the text
871
874
  match = regex.exec(textToCheck);
872
875
  }
package/dist/Func.js CHANGED
@@ -23,7 +23,11 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.mapByName = exports.die = exports.bulkInvoke = exports.invokeAsync = exports.invoke = void 0;
26
+ exports.invoke = invoke;
27
+ exports.invokeAsync = invokeAsync;
28
+ exports.bulkInvoke = bulkInvoke;
29
+ exports.die = die;
30
+ exports.mapByName = mapByName;
27
31
  const Utils = __importStar(require("./utils"));
28
32
  /**
29
33
  * Invokes the given callback with the given arguments
@@ -40,7 +44,6 @@ function invoke(callback, args, scope) {
40
44
  }
41
45
  return callback.apply(scope, args || []);
42
46
  }
43
- exports.invoke = invoke;
44
47
  /**
45
48
  * This is nearly the same as invoke, except that it assumes that the callback returns a promise. The callback doesn't
46
49
  * HAVE to return a promise, but it CAN, and if it doesn't, then we provide a promise
@@ -62,7 +65,6 @@ function invokeAsync(callback, args, scope) {
62
65
  }
63
66
  return promiseFromCallback;
64
67
  }
65
- exports.invokeAsync = invokeAsync;
66
68
  /**
67
69
  * Invokes all the given callbacks with the given arguments
68
70
  *
@@ -72,14 +74,12 @@ exports.invokeAsync = invokeAsync;
72
74
  function bulkInvoke(callbacks, args) {
73
75
  callbacks.forEach((callback) => invoke(callback, args));
74
76
  }
75
- exports.bulkInvoke = bulkInvoke;
76
77
  /**
77
78
  * Throws an uncaught error in an attempt to stop JS execution
78
79
  */
79
80
  function die() {
80
81
  throw new Error('Aborting JavaScript execution');
81
82
  }
82
- exports.die = die;
83
83
  /**
84
84
  * Call the method on a list of objects
85
85
  *
@@ -94,4 +94,3 @@ function mapByName(list, methodName) {
94
94
  }
95
95
  return arr.map((item) => item[methodName].call(item));
96
96
  }
97
- exports.mapByName = mapByName;
package/dist/Network.js CHANGED
@@ -26,6 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
26
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.default = Network;
29
30
  const jquery_1 = __importDefault(require("jquery"));
30
31
  const Utils = __importStar(require("./utils"));
31
32
  /**
@@ -194,4 +195,3 @@ function Network(endpoint) {
194
195
  },
195
196
  };
196
197
  }
197
- exports.default = Network;
package/dist/PageEvent.js CHANGED
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.default = default_1;
6
7
  const PubSub_1 = __importDefault(require("./PubSub"));
7
8
  /**
8
9
  * Event object used by page to do internal logic.
@@ -25,4 +26,3 @@ function default_1(eventName, callback) {
25
26
  },
26
27
  };
27
28
  }
28
- exports.default = default_1;
package/dist/str.d.ts CHANGED
@@ -378,7 +378,7 @@ declare const Str: {
378
378
  * Checks if something is a certain type
379
379
  * Stolen from underscore
380
380
  */
381
- isTypeOf(obj: unknown, type: 'Arguments' | 'Function' | 'String' | 'Number' | 'Date' | 'RegExp' | 'Error' | 'Symbol' | 'Map' | 'WeakMap' | 'Set' | 'WeakSet'): boolean;
381
+ isTypeOf(obj: unknown, type: "Arguments" | "Function" | "String" | "Number" | "Date" | "RegExp" | "Error" | "Symbol" | "Map" | "WeakMap" | "Set" | "WeakSet"): boolean;
382
382
  /**
383
383
  * Checks to see if something is undefined
384
384
  * Stolen from underscore
package/dist/utils.js CHANGED
@@ -1,16 +1,19 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isObject = exports.isFunction = exports.unescape = exports.escape = exports.isNavigatorAvailable = exports.isWindowAvailable = void 0;
3
+ exports.isWindowAvailable = isWindowAvailable;
4
+ exports.isNavigatorAvailable = isNavigatorAvailable;
5
+ exports.escape = escape;
6
+ exports.unescape = unescape;
7
+ exports.isFunction = isFunction;
8
+ exports.isObject = isObject;
4
9
  /** Checks if the `window` global object is available. */
5
10
  function isWindowAvailable() {
6
11
  return typeof window !== 'undefined';
7
12
  }
8
- exports.isWindowAvailable = isWindowAvailable;
9
13
  /** Checks if the `navigator` global object is available. */
10
14
  function isNavigatorAvailable() {
11
15
  return typeof navigator !== 'undefined';
12
16
  }
13
- exports.isNavigatorAvailable = isNavigatorAvailable;
14
17
  const htmlEscapes = {
15
18
  '&': '&amp;',
16
19
  '<': '&lt;',
@@ -29,7 +32,6 @@ const reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
29
32
  function escape(string) {
30
33
  return string && reHasUnescapedHtml.test(string) ? string.replace(reUnescapedHtml, (chr) => htmlEscapes[chr]) : string || '';
31
34
  }
32
- exports.escape = escape;
33
35
  const htmlUnescapes = {
34
36
  '&amp;': '&',
35
37
  '&lt;': '<',
@@ -50,7 +52,6 @@ const reHasEscapedHtml = RegExp(reEscapedHtml.source);
50
52
  function unescape(string) {
51
53
  return string && reHasEscapedHtml.test(string) ? string.replace(reEscapedHtml, (entity) => htmlUnescapes[entity] || "'") : string || '';
52
54
  }
53
- exports.unescape = unescape;
54
55
  /**
55
56
  * Checks if the given variable is a function
56
57
  * @param {*} variableToCheck
@@ -59,7 +60,6 @@ exports.unescape = unescape;
59
60
  function isFunction(variableToCheck) {
60
61
  return variableToCheck instanceof Function;
61
62
  }
62
- exports.isFunction = isFunction;
63
63
  /**
64
64
  * Checks if the given variable is an object
65
65
  * @param {*} obj
@@ -69,4 +69,3 @@ function isObject(obj) {
69
69
  const type = typeof obj;
70
70
  return type === 'function' || (!!obj && type === 'object');
71
71
  }
72
- exports.isObject = isObject;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expensify-common",
3
- "version": "2.0.45",
3
+ "version": "2.0.47",
4
4
  "author": "Expensify, Inc.",
5
5
  "description": "Expensify libraries and components shared across different repos",
6
6
  "homepage": "https://expensify.com",
@@ -68,7 +68,7 @@
68
68
  "jest-environment-jsdom": "^29.7.0",
69
69
  "jit-grunt": "^0.10.0",
70
70
  "prettier": "^3.3.2",
71
- "typescript": "^5.4.5"
71
+ "typescript": "^5.5.2"
72
72
  },
73
73
  "browserify": {
74
74
  "transform": [