5etools-utils 0.9.48 → 0.9.49

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.
@@ -22,9 +22,18 @@ class _BrewIndexTimestamps extends _BrewIndex {
22
22
  static _DISPLAY_NAME = "timestamp";
23
23
 
24
24
  addToIndex (fileInfo) {
25
+ // Use the most recent source in the `_meta`, as we assume this is the most relevant/interesting
26
+ const datePublished = (fileInfo.contents._meta.sources || [])
27
+ .map(src => src.dateReleased)
28
+ .filter(Boolean)
29
+ .map(str => new Date(str))
30
+ .sort((a, b) => b.getTime() - a.getTime())
31
+ .find(Boolean);
32
+
25
33
  this._index[fileInfo.cleanName] = {
26
34
  a: fileInfo.contents._meta.dateAdded,
27
35
  m: fileInfo.contents._meta.dateLastModified,
36
+ p: datePublished ? (datePublished.getTime() / 1000) : undefined,
28
37
  };
29
38
  }
30
39
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "5etools-utils",
3
- "version": "0.9.48",
3
+ "version": "0.9.49",
4
4
  "description": "Shared utilities for the 5etools ecosystem.",
5
5
  "type": "module",
6
6
  "main": "lib/Api.js",