javascript-time-ago 2.5.4 → 2.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.
Files changed (3) hide show
  1. package/README.md +2 -2
  2. package/index.d.ts +2 -2
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -181,7 +181,7 @@ timeAgo.format(Date.now() - 1.5 * 60 * 1000, 'round')
181
181
  * 1 hour ago
182
182
  * 2 hours ago
183
183
  * …
184
- * 59 hours ago
184
+ * 23 hours ago
185
185
  * 1 day ago
186
186
  * 2 days ago
187
187
  * …
@@ -938,4 +938,4 @@ On March 9th, 2020, GitHub, Inc. silently [banned](https://medium.com/@catamphet
938
938
 
939
939
  ## License
940
940
 
941
- [MIT](LICENSE)
941
+ [MIT](LICENSE)
package/index.d.ts CHANGED
@@ -126,8 +126,8 @@ export default class TimeAgo {
126
126
  // Perhaps it's not the best solution, and it would be better to introduce a new function called
127
127
  // `.formatAndGetTimeToNextUpdate()`. But at this stage that would require a "major" version number update,
128
128
  // and I wouldn't prefer doing that for such an insignificant change.
129
- format(date: DateInput, style?: FormatStyleName | Style, options?: FormatOptions): string | [string, number?];
130
- format(date: DateInput, options: FormatOptions): string | [string, number?];
129
+ format(date: DateInput, style?: FormatStyleName | Style, options?: FormatOptions): FormatOptions['getTimeToNextUpdate'] extends true ? [string, number?] : string;
130
+ format(date: DateInput, options: FormatOptions): FormatOptions['getTimeToNextUpdate'] extends true ? [string, number?] : string;
131
131
  getLabels(labelsType: LabelStyleName | LabelStyleName[]): Labels;
132
132
  static addLocale(localeData: LocaleData): void;
133
133
  static addDefaultLocale(localeData: LocaleData): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "javascript-time-ago",
3
- "version": "2.5.4",
3
+ "version": "2.5.5",
4
4
  "description": "Localized relative date/time formatting",
5
5
  "main": "index.cjs",
6
6
  "module": "index.js",