box-ui-elements 21.0.1-beta.2 → 21.0.1

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/openwith.js CHANGED
@@ -27959,10 +27959,21 @@ function getFileLastModifiedAsISONoMSIfPossible(file) {
27959
27959
  // The compatibility chart at https://developer.mozilla.org/en-US/docs/Web/API/File/lastModified#Browser_compatibility
27960
27960
  // is not up to date as of 12-13-2018. Edge & ie11 do not support lastModified, but support lastModifiedDate.
27961
27961
  const lastModified = file.lastModified || file.lastModifiedDate;
27962
- if (lastModified && (typeof lastModified === 'string' || typeof lastModified === 'number' || lastModified instanceof Date)) {
27963
- const lastModifiedDate = new Date(lastModified);
27964
- if (isValidDateObject(lastModifiedDate)) {
27965
- return toISOStringNoMS(lastModifiedDate);
27962
+ if (lastModified) {
27963
+ let lastModifiedDate = null;
27964
+ if (typeof lastModified === 'number') {
27965
+ // Only non-negative timestamps are valid. In rare cases, the timestamp may be erroneously set to a negative value
27966
+ // https://issues.chromium.org/issues/393149335
27967
+ if (lastModified < 0) {
27968
+ return null;
27969
+ }
27970
+ lastModifiedDate = new Date(lastModified); // Try number first
27971
+ } else if (typeof lastModified === 'string' || lastModified instanceof Date) {
27972
+ lastModifiedDate = new Date(lastModified);
27973
+ }
27974
+ if (lastModifiedDate && isValidDateObject(lastModifiedDate)) {
27975
+ const isoString = toISOStringNoMS(lastModifiedDate);
27976
+ return isoString;
27966
27977
  }
27967
27978
  }
27968
27979
  return null;
package/dist/picker.js CHANGED
@@ -33829,10 +33829,21 @@ function getFileLastModifiedAsISONoMSIfPossible(file) {
33829
33829
  // The compatibility chart at https://developer.mozilla.org/en-US/docs/Web/API/File/lastModified#Browser_compatibility
33830
33830
  // is not up to date as of 12-13-2018. Edge & ie11 do not support lastModified, but support lastModifiedDate.
33831
33831
  const lastModified = file.lastModified || file.lastModifiedDate;
33832
- if (lastModified && (typeof lastModified === 'string' || typeof lastModified === 'number' || lastModified instanceof Date)) {
33833
- const lastModifiedDate = new Date(lastModified);
33834
- if (isValidDateObject(lastModifiedDate)) {
33835
- return toISOStringNoMS(lastModifiedDate);
33832
+ if (lastModified) {
33833
+ let lastModifiedDate = null;
33834
+ if (typeof lastModified === 'number') {
33835
+ // Only non-negative timestamps are valid. In rare cases, the timestamp may be erroneously set to a negative value
33836
+ // https://issues.chromium.org/issues/393149335
33837
+ if (lastModified < 0) {
33838
+ return null;
33839
+ }
33840
+ lastModifiedDate = new Date(lastModified); // Try number first
33841
+ } else if (typeof lastModified === 'string' || lastModified instanceof Date) {
33842
+ lastModifiedDate = new Date(lastModified);
33843
+ }
33844
+ if (lastModifiedDate && isValidDateObject(lastModifiedDate)) {
33845
+ const isoString = toISOStringNoMS(lastModifiedDate);
33846
+ return isoString;
33836
33847
  }
33837
33848
  }
33838
33849
  return null;