sec-edgar-api 0.5.4 → 0.5.5

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.
@@ -5,6 +5,7 @@ interface ReportWithPeriod extends ReportRaw {
5
5
  period: number;
6
6
  startDate: string;
7
7
  endDate: string;
8
+ isCurrentPeriod: boolean;
8
9
  }
9
10
  export interface DocumentXbrlResult extends XbrlParseResult {
10
11
  report: ReportRaw | null;
@@ -81,21 +81,22 @@ function buildReportsFromFacts(params) {
81
81
  var fiscalPeriod_1 = (period === 12 && quarter === 4 ? 'FY' : "Q".concat(quarter));
82
82
  fiscalsByDateKey.set(dateKey, { fiscalYear: year, fiscalPeriod: fiscalPeriod_1 });
83
83
  }
84
- (_j = reportByDateRange[dateKey]) !== null && _j !== void 0 ? _j : (reportByDateRange[dateKey] = {
84
+ var isSplitFact = fact === splitFact;
85
+ var isFocusFact = (_j = isFocusFactByDateKey.get(dateKey)) !== null && _j !== void 0 ? _j : (isWithinDays({ dateA: fact.end, dateB: reportFocus.dateReport, days: 45 }) || isSplitFact);
86
+ (_k = reportByDateRange[dateKey]) !== null && _k !== void 0 ? _k : (reportByDateRange[dateKey] = {
85
87
  cik: reportFocus.cik,
86
88
  url: '',
87
- splitDate: (_k = splitFact === null || splitFact === void 0 ? void 0 : splitFact.end) !== null && _k !== void 0 ? _k : null,
89
+ splitDate: (_l = splitFact === null || splitFact === void 0 ? void 0 : splitFact.end) !== null && _l !== void 0 ? _l : null,
88
90
  splitRatio: (splitFact === null || splitFact === void 0 ? void 0 : splitFact.value) ? Number(splitFact.value) : null,
89
91
  dateFiled: reportFocus.dateFiled,
90
92
  dateReport: fact.end,
91
- fiscalPeriod: (_l = fiscalsByDateKey.get(dateKey)) === null || _l === void 0 ? void 0 : _l.fiscalPeriod,
92
- startDate: (_m = fact.start) !== null && _m !== void 0 ? _m : '',
93
+ fiscalPeriod: (_m = fiscalsByDateKey.get(dateKey)) === null || _m === void 0 ? void 0 : _m.fiscalPeriod,
94
+ startDate: (_o = fact.start) !== null && _o !== void 0 ? _o : '',
93
95
  endDate: fact.end,
94
- fiscalYear: (_o = fiscalsByDateKey.get(dateKey)) === null || _o === void 0 ? void 0 : _o.fiscalYear,
96
+ fiscalYear: (_p = fiscalsByDateKey.get(dateKey)) === null || _p === void 0 ? void 0 : _p.fiscalYear,
95
97
  period: FactPeriodResolver_1.default.getPeriod({ start: fact.start, end: fact.end }),
98
+ isCurrentPeriod: isFocusFact,
96
99
  });
97
- var isSplitFact = fact === splitFact;
98
- var isFocusFact = (_p = isFocusFactByDateKey.get(dateKey)) !== null && _p !== void 0 ? _p : (isWithinDays({ dateA: fact.end, dateB: reportFocus.dateReport, days: 45 }) || isSplitFact);
99
100
  if (isFocusFact) {
100
101
  fact.isCurrentPeriod = true;
101
102
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sec-edgar-api",
3
- "version": "0.5.4",
3
+ "version": "0.5.5",
4
4
  "description": "Fetch and parse SEC earnings reports and other filings. Useful for financial analysis.",
5
5
  "main": "build/index.js",
6
6
  "author": "Andrew Evers (https://github.com/andyevers)",