dce-reactkit 3.7.33 → 3.7.35

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/cjs/index.js CHANGED
@@ -14636,16 +14636,16 @@ const genRouteHandler = (opts) => {
14636
14636
  const { timestamp, year, month, day, hour, minute, } = getTimeInfoInET();
14637
14637
  // Main log info
14638
14638
  const mainLogInfo = {
14639
- id: `${launchInfo.userId}-${Date.now()}-${Math.floor(Math.random() * 100000)}-${Math.floor(Math.random() * 100000)}`,
14640
- userFirstName: launchInfo.userFirstName,
14641
- userLastName: launchInfo.userLastName,
14642
- userEmail: launchInfo.userEmail,
14643
- userId: launchInfo.userId,
14644
- isLearner: !!launchInfo.isLearner,
14645
- isAdmin: !!launchInfo.isAdmin,
14646
- isTTM: !!launchInfo.isTTM,
14647
- courseId: launchInfo.courseId,
14648
- courseName: launchInfo.contextLabel,
14639
+ id: `${launchInfo ? 'unknown' : launchInfo.userId}-${Date.now()}-${Math.floor(Math.random() * 100000)}-${Math.floor(Math.random() * 100000)}`,
14640
+ userFirstName: (launchInfo ? 'unknown' : launchInfo.userFirstName),
14641
+ userLastName: (launchInfo ? 'unknown' : launchInfo.userLastName),
14642
+ userEmail: (launchInfo ? 'unknown' : launchInfo.userEmail),
14643
+ userId: (launchInfo ? 'unknown' : launchInfo.userId),
14644
+ isLearner: (launchInfo && !!launchInfo.isLearner),
14645
+ isAdmin: (launchInfo && !!launchInfo.isAdmin),
14646
+ isTTM: (launchInfo && !!launchInfo.isTTM),
14647
+ courseId: (launchInfo ? 'unknown' : launchInfo.courseId),
14648
+ courseName: (launchInfo ? 'unknown' : launchInfo.contextLabel),
14649
14649
  browser,
14650
14650
  device,
14651
14651
  year,
@@ -15764,6 +15764,23 @@ const someAsync = (array, operatorFunction) => __awaiter(void 0, void 0, void 0,
15764
15764
  return false;
15765
15765
  });
15766
15766
 
15767
+ /**
15768
+ * Capitalize every word in a string (just the first letter)
15769
+ * @param str string to capitalize
15770
+ * @returns string with every word capitalized
15771
+ */
15772
+ const capitalize = (str) => {
15773
+ return (str
15774
+ // Split into words
15775
+ .split(' ')
15776
+ // Capitalize first letter of each word
15777
+ .map((word) => {
15778
+ return word.charAt(0).toUpperCase() + word.substring(1);
15779
+ })
15780
+ // Join back together
15781
+ .join(' '));
15782
+ };
15783
+
15767
15784
  /**
15768
15785
  * Days of the week
15769
15786
  * @author Gabe Abrams
@@ -15826,6 +15843,7 @@ exports.addFatalErrorHandler = addFatalErrorHandler;
15826
15843
  exports.alert = alert;
15827
15844
  exports.avg = avg;
15828
15845
  exports.canReviewLogs = canReviewLogs;
15846
+ exports.capitalize = capitalize;
15829
15847
  exports.ceilToNumDecimals = ceilToNumDecimals;
15830
15848
  exports.combineClassNames = combineClassNames;
15831
15849
  exports.compareArraysByProp = compareArraysByProp;