Initial import from local backup (Documents-Playground/pakerpale)
This commit is contained in:
20
node_modules/javascript-time-ago/.nycrc
generated
vendored
Normal file
20
node_modules/javascript-time-ago/.nycrc
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"require": [
|
||||
"@babel/register"
|
||||
],
|
||||
"reporter": [
|
||||
"lcov",
|
||||
"text-summary"
|
||||
],
|
||||
"include": [
|
||||
"source/**/*.js"
|
||||
],
|
||||
"exclude": [
|
||||
"source/PropTypes.js",
|
||||
"**/*.test.js"
|
||||
],
|
||||
"sourceMap": false,
|
||||
"instrument": false,
|
||||
"cache": true,
|
||||
"all": true
|
||||
}
|
||||
91
node_modules/javascript-time-ago/CHANGELOG.md
generated
vendored
Normal file
91
node_modules/javascript-time-ago/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,91 @@
|
||||
2.0.0 / 14.01.2018
|
||||
==================
|
||||
|
||||
* Moved `RelativeTimeFormat` to a separate `relative-time-format` package.
|
||||
|
||||
* (breaking change) Removed `.locale()` static function. Use `.addLocale()` instead.
|
||||
|
||||
* (breaking change) `flavour` property renamed in non-single-word cases: underscores (`_`) got replaced with dashes (`-`). Examples: `short_convenient` -> `short-convenient`, `long_convenient` -> `long-convenient`, `short_time` -> `short-time`, `long_time` -> `long-time`. The relevant keys in locale `index.js` files got renamed the same way.
|
||||
|
||||
* (breaking change) `RelativeTimeFormat` is no longer exported from this library.
|
||||
|
||||
* (could be a breaking change) Re-did `/prop-types`, `/gradation`, `/cache` exports as sub-packages. This could possibly change their import behavior. Maybe `/prop-types` did change — I changed some export strategies for it.
|
||||
|
||||
* (unlikely a breaking change) `yue-Hant` locale removed (due to its removal from CLDR).
|
||||
|
||||
* (unlikely to be a breaking change) Removed handling for a case when "now" unit had "past"/"future" which is an object of quantifier messages instead of a string. The rationale that having "now" unit with "past"/"future" which are objects of quantifier messages wouldn't make sense because "now" is a moment and one can't differentiate between "past moment", "current moment" and "next moment" in real life.
|
||||
|
||||
1.0.33 / 29.11.2018
|
||||
===================
|
||||
|
||||
* Resolved cyclic dependency between `JavascriptTimeAgo.js` and `RelativeTimeFormat.js`.
|
||||
|
||||
* `JavascriptTimeAgo.default_locale` variable no longer exists (it wasn't public or documented).
|
||||
|
||||
1.0.32 / 04.11.2018
|
||||
===================
|
||||
|
||||
* Added `.addLocale()` alias for `.locale()` function (better naming). The old `.locale()` function name is now deprecated and will be removed in some next major version release.
|
||||
|
||||
* Added `RelativeTimeFormat.addLocale()` proxy function which simply calls `JavascriptTimeAgo.addLocale()`.
|
||||
|
||||
1.0.19 / 12.01.2018
|
||||
===================
|
||||
|
||||
* Refactored `twitter` style and styles overall: style can now have `threshold(now)` function and also gradation step can have `format(value, locale)` function instead of `unit`.
|
||||
|
||||
1.0.17 / 11.01.2018
|
||||
===================
|
||||
|
||||
* Renamed `override` to `custom` for styles
|
||||
|
||||
1.0.15 / 11.01.2018
|
||||
===================
|
||||
|
||||
* Renamed `fuzzy` style to `time`.
|
||||
* Refactored `gradation`s and `style`s.
|
||||
* `gradation` is now not being exported from `index.js` along with `day`, `month` and `year` (one can still `import` it manually from `gradation.js`).
|
||||
* `es6` folder got renamed to `modules`
|
||||
* `build` folder got renamed to `commonjs`
|
||||
|
||||
1.0.11 / 10.01.2018
|
||||
===================
|
||||
|
||||
* Renamed `plural` to `quantify` inside locale data.
|
||||
* Implemented `Intl.RelativeTimeFormat` proposal polyfill which is now being exported.
|
||||
|
||||
1.0.10 / 09.01.2018
|
||||
===================
|
||||
|
||||
* (can be a breaking change for custom styles) Renamed `just-now` unit to `now` and `xxx-concise` flavour to `xxx_time` (+ flavour `.json` files got renamed accordingly).
|
||||
|
||||
1.0.8 / 09.01.2018
|
||||
===================
|
||||
|
||||
* (breaking change) When defining a custom `style` its `override()` function takes `date` and `time` parameters: now `date` parameter of `override()` is not guaranteed to be set (can be inferred from `time`).
|
||||
|
||||
1.0.2 / 08.01.2018
|
||||
===================
|
||||
|
||||
* (breaking change) Due to a long-standing engineering flaw in `intl-messageformat` library (the locale data loading process) I dismissed it and this library is now using raw CLDR locale data instead so built-in locale data now holds an extra property: the `plural` function taking a number and returning the pluralization type of that number ("one", "few", etc). Therefore, if adding raw CLDR locale data for locales which are not built-in this pluralization function must be passed as the second argument to `.locale(localeDataCLDR, pluralsClassifier)`.
|
||||
|
||||
* (breaking change) `javascriptTimeAgo.styles` is no more accesible: pass `style` as a string instead.
|
||||
|
||||
* (breaking change) `locales` folder inside the package renamed to `locale` (e.g. `javascript-time-ago/locales/en` -> `javascript-time-ago/locale/en`).
|
||||
|
||||
* `style.flavour` can now be an array
|
||||
|
||||
0.4.4 / 22.12.2016
|
||||
===================
|
||||
|
||||
* Changed `yesterday` and `tomorrow` labels for Russian localization
|
||||
|
||||
0.2.0 / 13.04.2016
|
||||
===================
|
||||
|
||||
* Moved `intl-messageformat` to `peerDependencies`
|
||||
|
||||
0.1.0 / 03.04.2016
|
||||
===================
|
||||
|
||||
* Initial release
|
||||
22
node_modules/javascript-time-ago/LICENSE
generated
vendored
Normal file
22
node_modules/javascript-time-ago/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
(The MIT License)
|
||||
|
||||
Copyright (c) 2016 @catamphetamine <purecatamphetamine@gmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
'Software'), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
18
node_modules/javascript-time-ago/MIGRATION.md
generated
vendored
Normal file
18
node_modules/javascript-time-ago/MIGRATION.md
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
# Migration from version `1.x`
|
||||
|
||||
### `.locale()` function removed.
|
||||
|
||||
If there're any `.locale()` static function calls then replace them with `.addLocale()`.
|
||||
|
||||
### `flavour`s that got renamed.
|
||||
|
||||
If any custom styles were defined replace the following `flavour`s in their definition:
|
||||
|
||||
* `short_convenient` -> `short-convenient`
|
||||
* `long_convenient` -> `long-convenient`
|
||||
* `short_time` -> `short-time`
|
||||
* `long_time` -> `long-time`
|
||||
|
||||
### `RelativeTimeFormat` is no longer exported
|
||||
|
||||
If `RelativeTimeFormat` was imported from `javascript-time-ago` then it must now be imported from `relative-time-format` instead.
|
||||
351
node_modules/javascript-time-ago/README.md
generated
vendored
Normal file
351
node_modules/javascript-time-ago/README.md
generated
vendored
Normal file
@@ -0,0 +1,351 @@
|
||||
# javascript-time-ago
|
||||
|
||||
[](https://www.npmjs.com/package/javascript-time-ago)
|
||||
[](https://www.npmjs.com/package/javascript-time-ago)
|
||||
[](https://coveralls.io/r/catamphetamine/javascript-time-ago?branch=master)
|
||||
|
||||
International higly customizable relative date/time formatter (both for past and future dates).
|
||||
|
||||
Formats a date/timestamp to:
|
||||
|
||||
* just now
|
||||
* 5m
|
||||
* 15 min
|
||||
* 25 minutes
|
||||
* an hour ago
|
||||
* 1 mo.
|
||||
* 5 years ago
|
||||
* … or whatever else
|
||||
|
||||
For React users there's also a [React component](https://github.com/catamphetamine/react-time-ago).
|
||||
|
||||
This is a readme for version `2.x`. [See version `1.x` readme](https://github.com/catamphetamine/javascript-time-ago/tree/1.x). See a [migration guide](https://github.com/catamphetamine/javascript-time-ago/blob/master/MIGRATION.md) from version `1.x` to version `2.x`.
|
||||
|
||||
## Usage
|
||||
|
||||
```
|
||||
npm install javascript-time-ago --save
|
||||
```
|
||||
|
||||
```js
|
||||
import TimeAgo from 'javascript-time-ago'
|
||||
|
||||
// Load locale-specific relative date/time formatting rules.
|
||||
import en from 'javascript-time-ago/locale/en'
|
||||
|
||||
// Add locale-specific relative date/time formatting rules.
|
||||
TimeAgo.addLocale(en)
|
||||
|
||||
// Create relative date/time formatter.
|
||||
const timeAgo = new TimeAgo('en-US')
|
||||
|
||||
timeAgo.format(new Date())
|
||||
// "just now"
|
||||
|
||||
timeAgo.format(Date.now() - 60 * 1000)
|
||||
// "a minute ago"
|
||||
|
||||
timeAgo.format(Date.now() - 2 * 60 * 60 * 1000)
|
||||
// "2 hours ago"
|
||||
|
||||
timeAgo.format(Date.now() - 24 * 60 * 60 * 1000)
|
||||
// "a day ago"
|
||||
```
|
||||
|
||||
Russian
|
||||
|
||||
```js
|
||||
import TimeAgo from 'javascript-time-ago'
|
||||
|
||||
// Load locale-specific relative date/time formatting rules.
|
||||
import en from 'javascript-time-ago/locale/en'
|
||||
import ru from 'javascript-time-ago/locale/ru'
|
||||
|
||||
// Add locale-specific relative date/time formatting rules.
|
||||
TimeAgo.addLocale(en)
|
||||
TimeAgo.addLocale(ru)
|
||||
|
||||
// cyka blyat
|
||||
const timeAgo = new TimeAgo('ru-RU')
|
||||
|
||||
timeAgo.format(new Date())
|
||||
// "только что"
|
||||
|
||||
timeAgo.format(Date.now() - 60 * 1000)
|
||||
// "1 минуту назад"
|
||||
|
||||
timeAgo.format(Date.now() - 2 * 60 * 60 * 1000)
|
||||
// "2 часа назад"
|
||||
|
||||
timeAgo.format(Date.now() - 24 * 60 * 60 * 1000)
|
||||
// "1 день назад"
|
||||
```
|
||||
|
||||
## Twitter style
|
||||
|
||||
Mimics Twitter style of time ago ("1m", "2h", "Mar 3", "Apr 4, 2012")
|
||||
|
||||
```js
|
||||
timeAgo.format(new Date(), 'twitter')
|
||||
// ""
|
||||
|
||||
timeAgo.format(Date.now() - 60 * 1000, 'twitter')
|
||||
// "1m"
|
||||
|
||||
timeAgo.format(Date.now() - 2 * 60 * 60 * 1000, 'twitter')
|
||||
// "2h"
|
||||
|
||||
timeAgo.format(Date.now() - 2 * 24 * 60 * 60 * 1000, 'twitter')
|
||||
// "Mar 3"
|
||||
|
||||
timeAgo.format(Date.now() - 365 * 24 * 60 * 60 * 1000, 'twitter')
|
||||
// "Mar 5, 2017"
|
||||
```
|
||||
|
||||
Twitter style uses [`Intl`](https://github.com/catamphetamine/javascript-time-ago#intl) for formatting `day/month/year` labels. If `Intl` is not available then it falls back to the default style.
|
||||
|
||||
## "Just time" style
|
||||
|
||||
```js
|
||||
timeAgo.format(Date.now() - 60 * 1000, 'time')
|
||||
// "1 minute"
|
||||
```
|
||||
|
||||
Similar to the default style but with "ago" omitted:
|
||||
|
||||
* just now
|
||||
* 1 minute
|
||||
* 2 minutes
|
||||
* 5 minutes
|
||||
* 10 minutes
|
||||
* 15 minutes
|
||||
* 20 minutes
|
||||
* 1 hour
|
||||
* 2 hours
|
||||
* …
|
||||
* 20 hours
|
||||
* 1 day
|
||||
* 2 days
|
||||
* 3 days
|
||||
* 4 days
|
||||
* 5 days
|
||||
* 1 week
|
||||
* 2 weeks
|
||||
* 3 weeks
|
||||
* 1 month
|
||||
* 2 months
|
||||
* 3 months
|
||||
* 4 months
|
||||
* 1 year
|
||||
* 2 years
|
||||
* 3 years
|
||||
* …
|
||||
|
||||
## Loading locales
|
||||
|
||||
No locale data is loaded by default: a developer must manually choose which locales must be loaded. This is to reduce the resulting javascript bundle size.
|
||||
|
||||
If the resulting bundle size is of no concern (for example, when building a big enterprise application), or if the code is being run on server side (Node.js), then one can use this helper to load all available locales:
|
||||
|
||||
```js
|
||||
require('javascript-time-ago/load-all-locales')
|
||||
```
|
||||
|
||||
# Advanced
|
||||
|
||||
The above sections explained all the basics required for using this library in a project.
|
||||
|
||||
This part of the documentation contains some advanced topics for those willing to have a better understanding of how this library works internally.
|
||||
|
||||
## Customization
|
||||
|
||||
This library comes with three "styles" built-in: the default one, "twitter" style and "time" style. Each of these styles is an object defining its own `flavour` and `gradation`. If none of them suits a project then a custom "style" object may be passed as a second parameter to `.format(date, style)` having the following shape:
|
||||
|
||||
* [`flavour`](https://github.com/catamphetamine/javascript-time-ago#flavour) – Preferred labels variant. Is `"long"` by default. Can be either a string (e.g. `"short"`) or an array of preferred flavours in which case each one of them is tried until a match is found. E.g. `["tiny", "short"]` searches for `tiny` first and falls back to `short`. `short`, `long` and `narrow` are always present for each locale.
|
||||
|
||||
* [`gradation`](https://github.com/catamphetamine/javascript-time-ago#gradation) – Time interval measurement units scale. Is [`convenient`](https://github.com/catamphetamine/javascript-time-ago/blob/master/source/gradation/convenient.js) by default. Another one available is [`canonical`](https://github.com/catamphetamine/javascript-time-ago/blob/master/source/gradation/canonical.js). A developer may supply a custom `gradation` which must be an array of steps each of them having either a `unit : string` or a `format(value, locale) : string` function. See [Twitter style](https://github.com/catamphetamine/javascript-time-ago/blob/master/source/style/twitter.js) for such an advanced example.
|
||||
|
||||
* `units` – A list of time interval measurement units which can be used in the output. E.g. `["second", "minute", "hour", ...]`. By default all available units are used. This is only used to filter out some of the non-conventional time units like `"quarter"` which is present in CLDR data.
|
||||
|
||||
## Flavour
|
||||
|
||||
Relative date/time labels come in various "flavours": `long`, `short`, `narrow` are the standard CLDR ones (always present) possibly accompanied by other ones like `tiny` which is defined for `en`, `ru` and `ko`. Refer to [`locale/en`](https://github.com/catamphetamine/javascript-time-ago/blob/master/locale/en) for an example.
|
||||
|
||||
```js
|
||||
import english from 'javascript-time-ago/locale/en'
|
||||
|
||||
english.tiny // '1s', '2m', '3h', '4d', …
|
||||
english.narrow // '1 sec. ago', '2 min. ago', …
|
||||
english.short // '1 sec. ago', '2 min. ago', …
|
||||
english.long // '1 second ago', '2 minutes ago', …
|
||||
```
|
||||
|
||||
* `tiny` is supposed to be the shortest one possible. It's not a CLDR-defined one and has been defined for `en`, `ru` and `ko` so far.
|
||||
* `narrow` is a CLDR-defined one and is supposed to be shorter than `short`, or at least no longer than it. I find `narrow` a weird one because for some locales it's the same as `short` and for other locales it's a really weird one (e.g. for Russian).
|
||||
* `short` is "short".
|
||||
* `long` is "regular".
|
||||
|
||||
## Gradation
|
||||
|
||||
A `gradation` is a list of time interval measurement steps.
|
||||
|
||||
```js
|
||||
[
|
||||
{
|
||||
unit: 'second',
|
||||
},
|
||||
{
|
||||
unit: 'minute',
|
||||
factor: 60,
|
||||
threshold: 59.5
|
||||
},
|
||||
{
|
||||
unit: 'hour',
|
||||
factor: 60 * 60,
|
||||
threshold: 59.5 * 60
|
||||
},
|
||||
…
|
||||
]
|
||||
```
|
||||
|
||||
Each step is described by:
|
||||
|
||||
* `unit` — a localized time measurement unit: `second`, `minute`, `hour`, `day`, `month`, `year` are the standardized CLDR ones.
|
||||
* `factor` — a divider for the supplied time interval (in seconds).
|
||||
* `threshold` — a minimum time interval value (in seconds) required for this gradation step. Each step must have a `threshold` defined except for the first one. Can a `number` or a `function(now: number, future: boolean)` returning a `number`. Some advanced `threshold` customization is possible like `threshold_for_[prev-unit]` (see `./source/gradation/convenient.js`).
|
||||
* `granularity` — for example, `5` for `minute` to allow only 5-minute intervals: `0 minutes`, `5 minutes`, `10 minutes`, etc.
|
||||
|
||||
If a gradation step should output not simply a time interval of a certain time unit but something different instead then it may be described by:
|
||||
|
||||
* `threshold` — same as above.
|
||||
* `format` — a `function(value, locale)` returning a `string`. `value` argument is the date/time being formatted as passed to `TimeAgo.format(value)`: either a `number` or a `Date`. `locale` argument is the selected locale (aka "BCP 47 language tag", e.g. `ru-RU`). For example, the built-in Twitter gradation has regular `minute` and `hour` steps followed by a custom one formatting a date as "day/month/year", e.g. `Jan 24, 2018`.
|
||||
|
||||
For more gradation examples see [`source/gradation`](https://github.com/catamphetamine/javascript-time-ago/blob/master/source/gradation) folder.
|
||||
|
||||
Built-in gradations:
|
||||
|
||||
```js
|
||||
import {
|
||||
canonical, // '1 second ago', '2 minutes ago', …
|
||||
convenient // 'just now', '5 minutes ago', …
|
||||
} from 'javascript-time-ago/gradation'
|
||||
```
|
||||
|
||||
## Future
|
||||
|
||||
When given future dates `.format()` produces the corresponding output, e.g. "in 5 minutes", "in a year", etc.
|
||||
|
||||
## Default
|
||||
|
||||
The default locale is `en` and can be changed: `TimeAgo.setDefaultLocale('ru')`.
|
||||
|
||||
<!--
|
||||
## Caching
|
||||
|
||||
Constructing a new `JavascriptTimeAgo` class instance is assumed to be a potentially lengthy operation (even though in reality it isn't). One can use the exported `Cache` class for caching.
|
||||
|
||||
```js
|
||||
import Cache from 'javascript-time-ago/Cache'
|
||||
|
||||
const cache = new Cache()
|
||||
const object = cache.get('key1', 'key2', ...) || cache.put('key1', 'key2', ..., createObject())
|
||||
```
|
||||
-->
|
||||
|
||||
## Localization internals
|
||||
|
||||
This library is based on [`Intl.RelativeTimeFormat`](https://github.com/catamphetamine/relative-time-format).
|
||||
|
||||
## React
|
||||
|
||||
There is also a [React component](https://catamphetamine.github.io/react-time-ago/) built upon this library which autorefreshes itself.
|
||||
|
||||
## Intl
|
||||
|
||||
(this is an "advanced" section)
|
||||
|
||||
[`Intl`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl) global object is not required for this library, but, for example, if you choose to use the built-in `twitter` style then it will fall back to the default style if `Intl` is not available.
|
||||
|
||||
`Intl` is present in all modern web browsers and is absent from some of the old ones: [Internet Explorer 10, Safari 9 and iOS Safari 9.x](http://caniuse.com/#search=intl) (which can be solved using [`Intl` polyfill](https://github.com/andyearnshaw/Intl.js)).
|
||||
|
||||
Node.js starting from `0.12` has `Intl` built-in, but only includes English locale data by default. If your app needs to support more locales than English on server side (e.g. Server-Side Rendering) then you'll need to use [`Intl` polyfill](https://github.com/andyearnshaw/Intl.js).
|
||||
|
||||
An example of applying [`Intl` polyfill](https://github.com/andyearnshaw/Intl.js):
|
||||
|
||||
```
|
||||
npm install intl@1.2.4 --save
|
||||
```
|
||||
|
||||
Node.js
|
||||
|
||||
```js
|
||||
import IntlPolyfill from 'intl'
|
||||
|
||||
const locales = ['en', 'ru', ...]
|
||||
|
||||
if (typeof Intl === 'object') {
|
||||
if (!Intl.DateTimeFormat || Intl.DateTimeFormat.supportedLocalesOf(locales).length !== locales.length) {
|
||||
Intl.DateTimeFormat = IntlPolyfill.DateTimeFormat
|
||||
}
|
||||
} else {
|
||||
global.Intl = IntlPolyfill
|
||||
}
|
||||
```
|
||||
|
||||
Web browser: only download `intl` package if the web browser doesn't support it, and only download the required locale.
|
||||
|
||||
```js
|
||||
async function initIntl() {
|
||||
if (typeof Intl === 'object') {
|
||||
return
|
||||
}
|
||||
await Promise.all([
|
||||
import('intl'),
|
||||
import('intl/locale-data/jsonp/en'),
|
||||
import('intl/locale-data/jsonp/ru'),
|
||||
...
|
||||
])
|
||||
}
|
||||
|
||||
initIntl().then(...)
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
After cloning this repo, ensure dependencies are installed by running:
|
||||
|
||||
```sh
|
||||
npm install
|
||||
```
|
||||
|
||||
This module is written in ES6 and uses [Babel](http://babeljs.io/) for ES5
|
||||
transpilation. Widely consumable JavaScript can be produced by running:
|
||||
|
||||
```sh
|
||||
npm run build
|
||||
```
|
||||
|
||||
Once `npm run build` has run, you may `import` or `require()` directly from
|
||||
node.
|
||||
|
||||
After developing, the full test suite can be evaluated by running:
|
||||
|
||||
```sh
|
||||
npm test
|
||||
```
|
||||
|
||||
When you're ready to test your new functionality on a real project, you can run
|
||||
|
||||
```sh
|
||||
npm pack
|
||||
```
|
||||
|
||||
It will `build`, `test` and then create a `.tgz` archive which you can then install in your project folder
|
||||
|
||||
```sh
|
||||
npm install [module name with version].tar.gz
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
[MIT](LICENSE)
|
||||
29
node_modules/javascript-time-ago/bin/generate-load-all-locales.js
generated
vendored
Normal file
29
node_modules/javascript-time-ago/bin/generate-load-all-locales.js
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
import path from 'path'
|
||||
import fs from 'fs'
|
||||
|
||||
const locales = []
|
||||
|
||||
fs.readdirSync(path.resolve(__dirname, '../locale')).forEach((locale) => {
|
||||
const localePath = path.resolve(__dirname, '../locale', locale)
|
||||
if (fs.statSync(localePath).isDirectory()) {
|
||||
if (fs.existsSync(path.resolve(__dirname, '../locale', locale, 'index.js'))) {
|
||||
locales.push(locale)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
fs.writeFileSync(path.resolve(__dirname, '../load-all-locales.js'),
|
||||
`
|
||||
var TimeAgo = require("javascript-time-ago")
|
||||
${locales.map(locale => 'TimeAgo.addLocale(require("javascript-time-ago/locale/' + locale + '"))').join('\n')}
|
||||
`
|
||||
.trim())
|
||||
|
||||
// ES6
|
||||
// `
|
||||
// import TimeAgo from "javascript-time-ago"
|
||||
//
|
||||
// ${locales.map(locale => 'import ' + locale + ' from "javascript-time-ago/locale/' + locale + '"').join('\n')}
|
||||
//
|
||||
// ${locales.map(locale => 'TimeAgo.addLocale(' + locale + ')').join('\n')}
|
||||
// `
|
||||
85
node_modules/javascript-time-ago/bin/generate-locale-messages.js
generated
vendored
Normal file
85
node_modules/javascript-time-ago/bin/generate-locale-messages.js
generated
vendored
Normal file
@@ -0,0 +1,85 @@
|
||||
import path from 'path'
|
||||
import fs from 'fs-extra'
|
||||
|
||||
for (const locale of listAllRelativeTimeFormatLocales())
|
||||
{
|
||||
const localeData = require('relative-time-format/locale/' + locale)
|
||||
|
||||
const localeDirectory = path.join(__dirname, '../locale', locale)
|
||||
|
||||
// Extra flavors.
|
||||
const EXTRA_STYLES = [
|
||||
'short-time',
|
||||
'short-convenient',
|
||||
'long-time',
|
||||
'long-convenient',
|
||||
'tiny'
|
||||
]
|
||||
|
||||
const extraStyleDirectories = {}
|
||||
|
||||
for (const style of EXTRA_STYLES) {
|
||||
const directory = findFlavorDirectory(locale, style)
|
||||
if (directory) {
|
||||
extraStyleDirectories[style] = directory
|
||||
}
|
||||
}
|
||||
|
||||
// Create `index.js` file in the locale directory.
|
||||
fs.outputFileSync(
|
||||
path.join(localeDirectory, 'index.js'),
|
||||
`
|
||||
var locale = require('relative-time-format/locale/${locale}')
|
||||
|
||||
module.exports = {
|
||||
${[
|
||||
'locale: locale.locale',
|
||||
'// Standard styles.',
|
||||
'long: locale.long',
|
||||
'short: locale.short',
|
||||
'narrow: locale.narrow',
|
||||
Object.keys(extraStyleDirectories).length > 0 && '// Additional styles.',
|
||||
...Object.keys(extraStyleDirectories).map(style => "'" + style + "': require('" + extraStyleDirectories[style] + "/" + style + ".json')"),
|
||||
localeData.quantify && "// Quantifier.",
|
||||
localeData.quantify && "quantify: locale.quantify",
|
||||
]
|
||||
.filter(_ => _)
|
||||
.join(',\n\t')
|
||||
.replace(/\.,\n/g, '.\n')}
|
||||
}
|
||||
`.trim()
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list of all locales supported by `relative-time-format`.
|
||||
* @return {string[]}
|
||||
*/
|
||||
export function listAllRelativeTimeFormatLocales() {
|
||||
return fs.readdirSync(path.join(__dirname, '../node_modules/relative-time-format/locale/'))
|
||||
.filter(_ => fs.statSync(path.join(__dirname, '../node_modules/relative-time-format/locale', _)).isDirectory())
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the relative path to a directory where
|
||||
* a given "flavor" (short, long, narrow) labels file
|
||||
* resides for a given locale.
|
||||
* @param {string} locale
|
||||
* @param {string} flavor
|
||||
* @return {string} [directory]
|
||||
*/
|
||||
function findFlavorDirectory(locale, flavor) {
|
||||
if (fs.existsSync(path.join(__dirname, '../locale-more-styles', locale, `${flavor}.json`))) {
|
||||
return `../../locale-more-styles/${locale}`
|
||||
}
|
||||
}
|
||||
|
||||
// /**
|
||||
// * "long-convenient" -> "longConvenient".
|
||||
// * @param {string} string
|
||||
// * @return {string}
|
||||
// */
|
||||
// function toCamelCase(string) {
|
||||
// string = string.split('-').map(_ => _[0].toUpperCase() + _.slice(1)).join('')
|
||||
// return string[0].toLowerCase() + string.slice(1)
|
||||
// }
|
||||
2
node_modules/javascript-time-ago/bundle/javascript-time-ago.min.js
generated
vendored
Normal file
2
node_modules/javascript-time-ago/bundle/javascript-time-ago.min.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
node_modules/javascript-time-ago/bundle/javascript-time-ago.min.js.map
generated
vendored
Normal file
1
node_modules/javascript-time-ago/bundle/javascript-time-ago.min.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
2
node_modules/javascript-time-ago/cache/index.commonjs.js
generated
vendored
Normal file
2
node_modules/javascript-time-ago/cache/index.commonjs.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
exports = module.exports = require('../commonjs/cache').default
|
||||
exports['default'] = require('../commonjs/cache').default
|
||||
1
node_modules/javascript-time-ago/cache/index.js
generated
vendored
Normal file
1
node_modules/javascript-time-ago/cache/index.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export { default } from '../modules/cache'
|
||||
8
node_modules/javascript-time-ago/cache/package.json
generated
vendored
Normal file
8
node_modules/javascript-time-ago/cache/package.json
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "javascript-time-ago-cache",
|
||||
"version": "1.0.0",
|
||||
"main": "index.commonjs.js",
|
||||
"module": "index.js",
|
||||
"sideEffects": false
|
||||
}
|
||||
467
node_modules/javascript-time-ago/commonjs/JavascriptTimeAgo.js
generated
vendored
Normal file
467
node_modules/javascript-time-ago/commonjs/JavascriptTimeAgo.js
generated
vendored
Normal file
@@ -0,0 +1,467 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
var _relativeTimeFormat = _interopRequireDefault(require("relative-time-format"));
|
||||
|
||||
var _cache = _interopRequireDefault(require("./cache"));
|
||||
|
||||
var _grade = _interopRequireDefault(require("./grade"));
|
||||
|
||||
var _locale = _interopRequireDefault(require("./locale"));
|
||||
|
||||
var _style = require("./style");
|
||||
|
||||
var _LocaleDataStore = require("./LocaleDataStore");
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
// const EXTRA_STYLES = [
|
||||
// 'long-convenient',
|
||||
// 'long-time',
|
||||
// 'short-convenient',
|
||||
// 'short-time',
|
||||
// 'tiny'
|
||||
// ]
|
||||
// Valid time units.
|
||||
var UNITS = ['now', // The rest are the same as in `Intl.RelativeTimeFormat`.
|
||||
'second', 'minute', 'hour', 'day', 'week', 'month', 'quarter', 'year'];
|
||||
|
||||
var JavascriptTimeAgo =
|
||||
/*#__PURE__*/
|
||||
function () {
|
||||
/**
|
||||
* @param {(string|string[])} locales=[] - Preferred locales (or locale).
|
||||
*/
|
||||
function JavascriptTimeAgo() {
|
||||
var locales = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
||||
|
||||
_classCallCheck(this, JavascriptTimeAgo);
|
||||
|
||||
// Convert `locales` to an array.
|
||||
if (typeof locales === 'string') {
|
||||
locales = [locales];
|
||||
} // Choose the most appropriate locale
|
||||
// (one of the previously added ones)
|
||||
// based on the list of preferred `locales` supplied by the user.
|
||||
|
||||
|
||||
this.locale = (0, _locale.default)(locales.concat(_relativeTimeFormat.default.getDefaultLocale()), _LocaleDataStore.getLocaleData); // Use `Intl.NumberFormat` for formatting numbers (when available).
|
||||
|
||||
if (typeof Intl !== 'undefined' && Intl.NumberFormat) {
|
||||
this.numberFormat = new Intl.NumberFormat(this.locale);
|
||||
} // Cache `Intl.RelativeTimeFormat` instance.
|
||||
|
||||
|
||||
this.relativeTimeFormatCache = new _cache.default();
|
||||
} // Formats the relative date/time.
|
||||
//
|
||||
// @return {string} Returns the formatted relative date/time.
|
||||
//
|
||||
// @param {(Object|string)} [style] - Relative date/time formatting style.
|
||||
//
|
||||
// @param {string[]} [style.units] - A list of allowed time units
|
||||
// (e.g. ['second', 'minute', 'hour', …])
|
||||
//
|
||||
// @param {Function} [style.custom] - `function ({ elapsed, time, date, now })`.
|
||||
// If this function returns a value, then
|
||||
// the `.format()` call will return that value.
|
||||
// Otherwise it has no effect.
|
||||
//
|
||||
// @param {string} [style.flavour] - e.g. "long", "short", "tiny", etc.
|
||||
//
|
||||
// @param {Object[]} [style.gradation] - Time scale gradation steps.
|
||||
//
|
||||
// @param {string} style.gradation[].unit - Time interval measurement unit.
|
||||
// (e.g. ['second', 'minute', 'hour', …])
|
||||
//
|
||||
// @param {Number} style.gradation[].factor - Time interval measurement unit factor.
|
||||
// (e.g. `60` for 'minute')
|
||||
//
|
||||
// @param {Number} [style.gradation[].granularity] - A step for the unit's "amount" value.
|
||||
// (e.g. `5` for '0 minutes', '5 minutes', etc)
|
||||
//
|
||||
// @param {Number} [style.gradation[].threshold] - Time interval measurement unit threshold.
|
||||
// (e.g. `45` seconds for 'minute').
|
||||
// There can also be specific `threshold_[unit]`
|
||||
// thresholds for fine-tuning.
|
||||
//
|
||||
|
||||
|
||||
_createClass(JavascriptTimeAgo, [{
|
||||
key: "format",
|
||||
value: function format(input) {
|
||||
var style = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _style.defaultStyle;
|
||||
|
||||
if (typeof style === 'string') {
|
||||
switch (style) {
|
||||
case 'twitter':
|
||||
style = _style.twitterStyle;
|
||||
break;
|
||||
|
||||
case 'time':
|
||||
style = _style.timeStyle;
|
||||
break;
|
||||
|
||||
default:
|
||||
style = _style.defaultStyle;
|
||||
}
|
||||
}
|
||||
|
||||
var _getDateAndTimeBeingF = getDateAndTimeBeingFormatted(input),
|
||||
date = _getDateAndTimeBeingF.date,
|
||||
time = _getDateAndTimeBeingF.time; // Get locale messages for this formatting flavour
|
||||
|
||||
|
||||
var _this$getLocaleData = this.getLocaleData(style.flavour),
|
||||
flavour = _this$getLocaleData.flavour,
|
||||
localeData = _this$getLocaleData.localeData; // Can pass a custom `now`, e.g. for testing purposes.
|
||||
// Technically it doesn't belong to `style`
|
||||
// but since this is an undocumented internal feature,
|
||||
// taking it from the `style` argument will do (for now).
|
||||
|
||||
|
||||
var now = style.now || Date.now(); // how much time elapsed (in seconds)
|
||||
|
||||
var elapsed = (now - time) / 1000; // in seconds
|
||||
// `custom` – A function of `{ elapsed, time, date, now, locale }`.
|
||||
// If this function returns a value, then the `.format()` call will return that value.
|
||||
// Otherwise the relative date/time is formatted as usual.
|
||||
// This feature is currently not used anywhere and is here
|
||||
// just for providing the ultimate customization point
|
||||
// in case anyone would ever need that. Prefer using
|
||||
// `gradation[step].format(value, locale)` instead.
|
||||
//
|
||||
// I guess `custom` is deprecated and will be removed
|
||||
// in some future major version release.
|
||||
//
|
||||
|
||||
if (style.custom) {
|
||||
var custom = style.custom({
|
||||
now: now,
|
||||
date: date,
|
||||
time: time,
|
||||
elapsed: elapsed,
|
||||
locale: this.locale
|
||||
});
|
||||
|
||||
if (custom !== undefined) {
|
||||
return custom;
|
||||
}
|
||||
} // Available time interval measurement units.
|
||||
|
||||
|
||||
var units = getTimeIntervalMeasurementUnits(localeData, style.units); // If no available time unit is suitable, just output an empty string.
|
||||
|
||||
if (units.length === 0) {
|
||||
console.error("Units \"".concat(units.join(', '), "\" were not found in locale data for \"").concat(this.locale, "\"."));
|
||||
return '';
|
||||
} // Choose the appropriate time measurement unit
|
||||
// and get the corresponding rounded time amount.
|
||||
|
||||
|
||||
var step = (0, _grade.default)(elapsed, now, units, style.gradation); // If no time unit is suitable, just output an empty string.
|
||||
// E.g. when "now" unit is not available
|
||||
// and "second" has a threshold of `0.5`
|
||||
// (e.g. the "canonical" grading scale).
|
||||
|
||||
if (!step) {
|
||||
return '';
|
||||
}
|
||||
|
||||
if (step.format) {
|
||||
return step.format(date || time, this.locale);
|
||||
}
|
||||
|
||||
var unit = step.unit,
|
||||
factor = step.factor,
|
||||
granularity = step.granularity;
|
||||
var amount = Math.abs(elapsed) / factor; // Apply granularity to the time amount
|
||||
// (and fallback to the previous step
|
||||
// if the first level of granularity
|
||||
// isn't met by this amount)
|
||||
|
||||
if (granularity) {
|
||||
// Recalculate the elapsed time amount based on granularity
|
||||
amount = Math.round(amount / granularity) * granularity;
|
||||
} // `Intl.RelativeTimeFormat` doesn't operate in "now" units.
|
||||
|
||||
|
||||
if (unit === 'now') {
|
||||
return getNowMessage(localeData, -1 * Math.sign(elapsed));
|
||||
}
|
||||
|
||||
switch (flavour) {
|
||||
case 'long':
|
||||
case 'short':
|
||||
case 'narrow':
|
||||
// Format `value` using `Intl.RelativeTimeFormat`.
|
||||
return this.getFormatter(flavour).format(-1 * Math.sign(elapsed) * Math.round(amount), unit);
|
||||
|
||||
default:
|
||||
// Format `value`.
|
||||
// (mimicks `Intl.RelativeTimeFormat` with the addition of extra styles)
|
||||
return this.formatValue(-1 * Math.sign(elapsed) * Math.round(amount), unit, localeData);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Mimicks what `Intl.RelativeTimeFormat` does for additional locale styles.
|
||||
* @param {number} value
|
||||
* @param {string} unit
|
||||
* @param {object} localeData — Relative time messages for the flavor.
|
||||
* @return {string}
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: "formatValue",
|
||||
value: function formatValue(value, unit, localeData) {
|
||||
return this.getRule(value, unit, localeData).replace('{0}', this.formatNumber(Math.abs(value)));
|
||||
}
|
||||
/**
|
||||
* Returns formatting rule for `value` in `units` (either in past or in future).
|
||||
* @param {number} value - Time interval value.
|
||||
* @param {string} unit - Time interval measurement unit.
|
||||
* @param {object} localeData — Relative time messages for the flavor.
|
||||
* @return {string}
|
||||
* @example
|
||||
* // Returns "{0} days ago"
|
||||
* getRule(-2, "day")
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: "getRule",
|
||||
value: function getRule(value, unit, localeData) {
|
||||
var unitRules = localeData[unit]; // Bundle size optimization technique.
|
||||
|
||||
if (typeof unitRules === 'string') {
|
||||
return unitRules;
|
||||
} // Choose either "past" or "future" based on time `value` sign.
|
||||
// If "past" is same as "future" then they're stored as "other".
|
||||
// If there's only "other" then it's being collapsed.
|
||||
|
||||
|
||||
var quantifierRules = unitRules[value <= 0 ? 'past' : 'future'] || unitRules; // Bundle size optimization technique.
|
||||
|
||||
if (typeof quantifierRules === 'string') {
|
||||
return quantifierRules;
|
||||
} // Quantify `value`.
|
||||
|
||||
|
||||
var quantify = (0, _LocaleDataStore.getLocaleData)(this.locale).quantify;
|
||||
var quantifier = quantify && quantify(Math.abs(value)); // There seems to be no such locale in CLDR
|
||||
// for which `quantify` is missing
|
||||
// and still `past` and `future` messages
|
||||
// contain something other than "other".
|
||||
|
||||
/* istanbul ignore next */
|
||||
|
||||
quantifier = quantifier || 'other'; // "other" rule is supposed to always be present.
|
||||
// If only "other" rule is present then "rules" is not an object and is a string.
|
||||
|
||||
return quantifierRules[quantifier] || quantifierRules.other;
|
||||
}
|
||||
/**
|
||||
* Formats a number into a string.
|
||||
* Uses `Intl.NumberFormat` when available.
|
||||
* @param {number} number
|
||||
* @return {string}
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: "formatNumber",
|
||||
value: function formatNumber(number) {
|
||||
return this.numberFormat ? this.numberFormat.format(number) : String(number);
|
||||
}
|
||||
/**
|
||||
* Returns an `Intl.RelativeTimeFormat` for a given `flavor`.
|
||||
* @param {string} flavor
|
||||
* @return {object} `Intl.RelativeTimeFormat` instance
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: "getFormatter",
|
||||
value: function getFormatter(flavor) {
|
||||
// `Intl.RelativeTimeFormat` instance creation is assumed a
|
||||
// lengthy operation so the instances are cached and reused.
|
||||
return this.relativeTimeFormatCache.get(this.locale, flavor) || this.relativeTimeFormatCache.put(this.locale, flavor, new _relativeTimeFormat.default(this.locale, {
|
||||
style: flavor
|
||||
}));
|
||||
}
|
||||
/**
|
||||
* Gets locale messages for this formatting flavour
|
||||
*
|
||||
* @param {(string|string[])} flavour - Relative date/time formatting flavour.
|
||||
* If it's an array then all flavours are tried in order.
|
||||
*
|
||||
* @returns {Object} Returns an object of shape { flavour, localeData }
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: "getLocaleData",
|
||||
value: function getLocaleData() {
|
||||
var flavour = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
||||
// Get relative time formatting rules for this locale
|
||||
var localeData = (0, _LocaleDataStore.getLocaleData)(this.locale); // Convert `flavour` to an array.
|
||||
|
||||
if (typeof flavour === 'string') {
|
||||
flavour = [flavour];
|
||||
} // "long" flavour is the default one.
|
||||
// (it's always present)
|
||||
|
||||
|
||||
flavour = flavour.concat('long'); // Find a suitable flavour.
|
||||
|
||||
for (var _iterator = flavour, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
|
||||
var _ref;
|
||||
|
||||
if (_isArray) {
|
||||
if (_i >= _iterator.length) break;
|
||||
_ref = _iterator[_i++];
|
||||
} else {
|
||||
_i = _iterator.next();
|
||||
if (_i.done) break;
|
||||
_ref = _i.value;
|
||||
}
|
||||
|
||||
var _ = _ref;
|
||||
|
||||
if (localeData[_]) {
|
||||
return {
|
||||
flavour: _,
|
||||
localeData: localeData[_]
|
||||
};
|
||||
}
|
||||
} // Can't happen - "long" flavour is always present.
|
||||
// throw new Error(`None of the flavours - ${flavour.join(', ')} - was found for locale "${this.locale}".`)
|
||||
|
||||
}
|
||||
}]);
|
||||
|
||||
return JavascriptTimeAgo;
|
||||
}();
|
||||
/**
|
||||
* Gets default locale.
|
||||
* @return {string} locale
|
||||
*/
|
||||
|
||||
|
||||
exports.default = JavascriptTimeAgo;
|
||||
JavascriptTimeAgo.getDefaultLocale = _relativeTimeFormat.default.getDefaultLocale;
|
||||
/**
|
||||
* Sets default locale.
|
||||
* @param {string} locale
|
||||
*/
|
||||
|
||||
JavascriptTimeAgo.setDefaultLocale = _relativeTimeFormat.default.setDefaultLocale;
|
||||
/**
|
||||
* Adds locale data for a specific locale.
|
||||
* @param {Object} localeData
|
||||
*/
|
||||
|
||||
JavascriptTimeAgo.addLocale = function (localeData) {
|
||||
(0, _LocaleDataStore.addLocaleData)(localeData);
|
||||
|
||||
_relativeTimeFormat.default.addLocale(localeData);
|
||||
};
|
||||
/**
|
||||
* (legacy alias)
|
||||
* Adds locale data for a specific locale.
|
||||
* @param {Object} localeData
|
||||
* @deprecated
|
||||
*/
|
||||
|
||||
|
||||
JavascriptTimeAgo.locale = JavascriptTimeAgo.addLocale; // Normalizes `.format()` `time` argument.
|
||||
|
||||
function getDateAndTimeBeingFormatted(input) {
|
||||
if (input.constructor === Date || isMockedDate(input)) {
|
||||
return {
|
||||
date: input,
|
||||
time: input.getTime()
|
||||
};
|
||||
}
|
||||
|
||||
if (typeof input === 'number') {
|
||||
return {
|
||||
time: input // `date` is not required for formatting
|
||||
// relative times unless "twitter" preset is used.
|
||||
// date : new Date(input)
|
||||
|
||||
};
|
||||
} // For some weird reason istanbul doesn't see this `throw` covered.
|
||||
|
||||
/* istanbul ignore next */
|
||||
|
||||
|
||||
throw new Error("Unsupported relative time formatter input: ".concat(_typeof(input), ", ").concat(input));
|
||||
} // During testing via some testing libraries `Date`s aren't actually `Date`s.
|
||||
// https://github.com/catamphetamine/javascript-time-ago/issues/22
|
||||
|
||||
|
||||
function isMockedDate(object) {
|
||||
return _typeof(object) === 'object' && typeof object.getTime === 'function';
|
||||
} // Get available time interval measurement units.
|
||||
|
||||
|
||||
function getTimeIntervalMeasurementUnits(localeData, restrictedSetOfUnits) {
|
||||
// All available time interval measurement units.
|
||||
var units = Object.keys(localeData); // If only a specific set of available
|
||||
// time measurement units can be used.
|
||||
|
||||
if (restrictedSetOfUnits) {
|
||||
// Reduce available time interval measurement units
|
||||
// based on user's preferences.
|
||||
units = restrictedSetOfUnits.filter(function (_) {
|
||||
return units.indexOf(_) >= 0;
|
||||
});
|
||||
} // Stock `Intl.RelativeTimeFormat` locale data doesn't have "now" units.
|
||||
// So either "now" is present in extended locale data
|
||||
// or it's taken from ".second.current".
|
||||
|
||||
|
||||
if ((!restrictedSetOfUnits || restrictedSetOfUnits.indexOf('now') >= 0) && units.indexOf('now') < 0) {
|
||||
if (localeData.second.current) {
|
||||
units.unshift('now');
|
||||
}
|
||||
}
|
||||
|
||||
return units;
|
||||
}
|
||||
|
||||
function getNowMessage(localeData, value) {
|
||||
// Specific "now" message form extended locale data (if present).
|
||||
if (localeData.now) {
|
||||
// Bundle size optimization technique.
|
||||
if (typeof localeData.now === 'string') {
|
||||
return localeData.now;
|
||||
} // Not handling `value === 0` as `localeData.now.current` here
|
||||
// because it wouldn't make sense: "now" is a moment,
|
||||
// so one can't possibly differentiate between a
|
||||
// "previous" moment, a "current" moment and a "next moment".
|
||||
// It can only be differentiated between "past" and "future".
|
||||
|
||||
|
||||
if (value <= 0) {
|
||||
return localeData.now.past;
|
||||
} else {
|
||||
return localeData.now.future;
|
||||
}
|
||||
} // Use ".second.current" as "now" message.
|
||||
|
||||
|
||||
return localeData.second.current; // If this function was called then
|
||||
// it means that either "now" unit messages are
|
||||
// available or ".second.current" message is present.
|
||||
}
|
||||
//# sourceMappingURL=JavascriptTimeAgo.js.map
|
||||
1
node_modules/javascript-time-ago/commonjs/JavascriptTimeAgo.js.map
generated
vendored
Normal file
1
node_modules/javascript-time-ago/commonjs/JavascriptTimeAgo.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
264
node_modules/javascript-time-ago/commonjs/JavascriptTimeAgo.test.js
generated
vendored
Normal file
264
node_modules/javascript-time-ago/commonjs/JavascriptTimeAgo.test.js
generated
vendored
Normal file
@@ -0,0 +1,264 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.convenientGradationTest = convenientGradationTest;
|
||||
|
||||
var _JavascriptTimeAgo = _interopRequireDefault(require("../source/JavascriptTimeAgo"));
|
||||
|
||||
var _gradation = require("../source/gradation");
|
||||
|
||||
var _style = require("../source/style");
|
||||
|
||||
var _LocaleDataStore = require("../source/LocaleDataStore");
|
||||
|
||||
var _en = _interopRequireDefault(require("../locale/en"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }
|
||||
|
||||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
// Just so this function code is covered.
|
||||
_JavascriptTimeAgo.default.setDefaultLocale('en');
|
||||
|
||||
describe("time ago", function () {
|
||||
it("should try various flavours if some are not found", function () {
|
||||
var timeAgo = new _JavascriptTimeAgo.default('en');
|
||||
timeAgo.format(Date.now(), {
|
||||
flavour: ['exotic', 'short']
|
||||
}).should.equal('now');
|
||||
});
|
||||
it("should not use Intl.NumberFormat if it's not available", function () {
|
||||
var NumberFormat = Intl.NumberFormat;
|
||||
delete Intl.NumberFormat;
|
||||
var timeAgo = new _JavascriptTimeAgo.default('en');
|
||||
timeAgo.format(Date.now() + 60 * 1000).should.equal('in a minute');
|
||||
Intl.NumberFormat = NumberFormat;
|
||||
});
|
||||
it("should work when \"past\"/\"future\" messages are same for all quantifiers", function () {
|
||||
var timeAgo = new _JavascriptTimeAgo.default('en');
|
||||
timeAgo.format(Date.now() + 365 * 24 * 60 * 60 * 1000, {
|
||||
flavour: ['short-convenient']
|
||||
}).should.equal('in 1 yr.');
|
||||
});
|
||||
it("should work when \"now\" is a string (doesn't differentiate between \"past\" and \"future\")", function () {
|
||||
var timeAgo = new _JavascriptTimeAgo.default('en');
|
||||
timeAgo.format(Date.now(), {
|
||||
flavour: ['short-time']
|
||||
}).should.equal('now');
|
||||
});
|
||||
it("should format \"now\" for \"past\" time", function () {
|
||||
var timeAgo = new _JavascriptTimeAgo.default('en');
|
||||
timeAgo.format(Date.now() + 10, {
|
||||
flavour: ['long-convenient']
|
||||
}).should.equal('in a moment');
|
||||
});
|
||||
it("should accept a string style argument", function () {
|
||||
var timeAgo = new _JavascriptTimeAgo.default('en');
|
||||
timeAgo.format(Date.now(), 'twitter').should.equal('');
|
||||
timeAgo.format(Date.now(), 'time').should.equal('just now');
|
||||
timeAgo.format(Date.now(), 'exotic').should.equal('just now');
|
||||
});
|
||||
it("should accept empty constructor parameters", function () {
|
||||
var timeAgo = new _JavascriptTimeAgo.default();
|
||||
timeAgo.format(new Date()).should.equal('just now');
|
||||
});
|
||||
it("should accept Dates", function () {
|
||||
var timeAgo = new _JavascriptTimeAgo.default('en');
|
||||
timeAgo.format(new Date()).should.equal('just now');
|
||||
});
|
||||
it("should accept mocked Dates when testing", function () {
|
||||
var timeAgo = new _JavascriptTimeAgo.default('en');
|
||||
var mockedDate = {
|
||||
getTime: function getTime() {
|
||||
return Date.now();
|
||||
}
|
||||
};
|
||||
timeAgo.format(mockedDate).should.equal('just now');
|
||||
});
|
||||
it("should not accept anything but Dates and timestamps", function () {
|
||||
var timeAgo = new _JavascriptTimeAgo.default('en');
|
||||
|
||||
var thrower = function thrower() {
|
||||
return timeAgo.format('Jan 14, 2017');
|
||||
};
|
||||
|
||||
thrower.should.throw('Unsupported relative time formatter input: string, Jan 14, 2017');
|
||||
});
|
||||
it("should return an empty string if the passed units are not available in locale data", function () {
|
||||
var timeAgo = new _JavascriptTimeAgo.default('en');
|
||||
timeAgo.format(Date.now(), {
|
||||
units: ['femtosecond']
|
||||
}).should.equal('');
|
||||
});
|
||||
it("should return an empty string if no unit is suitable", function () {
|
||||
var timeAgo = new _JavascriptTimeAgo.default('en');
|
||||
var now = Date.now(); // Remove 'now' unit formatting rule temporarily
|
||||
|
||||
var justNowFormatter = (0, _LocaleDataStore.getLocaleData)('en').long.now;
|
||||
var currentSecondMessage = (0, _LocaleDataStore.getLocaleData)('en').long.second.current;
|
||||
delete (0, _LocaleDataStore.getLocaleData)('en').long.now;
|
||||
delete (0, _LocaleDataStore.getLocaleData)('en').long.second.current;
|
||||
timeAgo.format(now, {
|
||||
now: now
|
||||
}).should.equal(''); // Restore 'now' unit formating rule
|
||||
|
||||
(0, _LocaleDataStore.getLocaleData)('en').long.now = justNowFormatter;
|
||||
(0, _LocaleDataStore.getLocaleData)('en').long.second.current = currentSecondMessage;
|
||||
});
|
||||
it("should format for a style with \"custom\" function", function () {
|
||||
var timeAgo = new _JavascriptTimeAgo.default('en'); // `custom` returns a string
|
||||
|
||||
timeAgo.format(Date.now(), {
|
||||
custom: function custom(_ref) {
|
||||
var now = _ref.now,
|
||||
time = _ref.time,
|
||||
date = _ref.date,
|
||||
locale = _ref.locale;
|
||||
return locale;
|
||||
}
|
||||
}).should.equal('en'); // `custom` returns `undefined`
|
||||
|
||||
timeAgo.format(Date.now(), {
|
||||
custom: function custom(_ref2) {
|
||||
var now = _ref2.now,
|
||||
time = _ref2.time,
|
||||
date = _ref2.date,
|
||||
locale = _ref2.locale;
|
||||
return;
|
||||
}
|
||||
}).should.equal('now');
|
||||
});
|
||||
it("should format time correctly for English language (short)", function () {
|
||||
convenientGradationTest(['now', '1 min. ago', '2 min. ago', '5 min. ago', '10 min. ago', '15 min. ago', '20 min. ago', '25 min. ago', '30 min. ago', '35 min. ago', '40 min. ago', '45 min. ago', '50 min. ago', '1 hr. ago', '2 hr. ago', '3 hr. ago', '4 hr. ago', '5 hr. ago', '6 hr. ago', '7 hr. ago', '8 hr. ago', '9 hr. ago', '10 hr. ago', '11 hr. ago', '12 hr. ago', '13 hr. ago', '14 hr. ago', '15 hr. ago', '16 hr. ago', '17 hr. ago', '18 hr. ago', '19 hr. ago', '20 hr. ago', '1 day ago', '2 days ago', '3 days ago', '4 days ago', '5 days ago', '1 wk. ago', '2 wk. ago', '3 wk. ago', '1 mo. ago', '2 mo. ago', '3 mo. ago', '4 mo. ago', '5 mo. ago', '6 mo. ago', '7 mo. ago', '8 mo. ago', '9 mo. ago', '9 mo. ago', '10 mo. ago', '1 yr. ago', '2 yr. ago', '3 yr. ago', '100 yr. ago'], 'en', {
|
||||
flavour: 'short'
|
||||
});
|
||||
});
|
||||
it("should format time correctly for English language (long)", function () {
|
||||
convenientGradationTest(['just now', 'a minute ago', '2 minutes ago', '5 minutes ago', '10 minutes ago', '15 minutes ago', '20 minutes ago', '25 minutes ago', '30 minutes ago', '35 minutes ago', '40 minutes ago', '45 minutes ago', '50 minutes ago', 'an hour ago', '2 hours ago', '3 hours ago', '4 hours ago', '5 hours ago', '6 hours ago', '7 hours ago', '8 hours ago', '9 hours ago', '10 hours ago', '11 hours ago', '12 hours ago', '13 hours ago', '14 hours ago', '15 hours ago', '16 hours ago', '17 hours ago', '18 hours ago', '19 hours ago', '20 hours ago', 'a day ago', '2 days ago', '3 days ago', '4 days ago', '5 days ago', 'a week ago', '2 weeks ago', '3 weeks ago', 'a month ago', '2 months ago', '3 months ago', '4 months ago', '5 months ago', '6 months ago', '7 months ago', '8 months ago', '9 months ago', '9 months ago', '10 months ago', 'a year ago', '2 years ago', '3 years ago', '100 years ago'], 'en', _style.defaultStyle);
|
||||
});
|
||||
it("should format time correctly for Russian language (short)", function () {
|
||||
convenientGradationTest(['сейчас', '1 мин. назад', '2 мин. назад', '5 мин. назад', '10 мин. назад', '15 мин. назад', '20 мин. назад', '25 мин. назад', '30 мин. назад', '35 мин. назад', '40 мин. назад', '45 мин. назад', '50 мин. назад', '1 ч. назад', '2 ч. назад', '3 ч. назад', '4 ч. назад', '5 ч. назад', '6 ч. назад', '7 ч. назад', '8 ч. назад', '9 ч. назад', '10 ч. назад', '11 ч. назад', '12 ч. назад', '13 ч. назад', '14 ч. назад', '15 ч. назад', '16 ч. назад', '17 ч. назад', '18 ч. назад', '19 ч. назад', '20 ч. назад', '1 дн. назад', '2 дн. назад', '3 дн. назад', '4 дн. назад', '5 дн. назад', '1 нед. назад', '2 нед. назад', '3 нед. назад', '1 мес. назад', '2 мес. назад', '3 мес. назад', '4 мес. назад', '5 мес. назад', '6 мес. назад', '7 мес. назад', '8 мес. назад', '9 мес. назад', '9 мес. назад', '10 мес. назад', '1 г. назад', '2 г. назад', '3 г. назад', '100 л. назад'], 'ru', {
|
||||
flavour: 'short'
|
||||
});
|
||||
});
|
||||
it("should format time correctly for Russian language (long)", function () {
|
||||
convenientGradationTest(['только что', '1 минуту назад', '2 минуты назад', '5 минут назад', '10 минут назад', '15 минут назад', '20 минут назад', '25 минут назад', '30 минут назад', '35 минут назад', '40 минут назад', '45 минут назад', '50 минут назад', '1 час назад', '2 часа назад', '3 часа назад', '4 часа назад', '5 часов назад', '6 часов назад', '7 часов назад', '8 часов назад', '9 часов назад', '10 часов назад', '11 часов назад', '12 часов назад', '13 часов назад', '14 часов назад', '15 часов назад', '16 часов назад', '17 часов назад', '18 часов назад', '19 часов назад', '20 часов назад', '1 день назад', '2 дня назад', '3 дня назад', '4 дня назад', '5 дней назад', '1 неделю назад', '2 недели назад', '3 недели назад', '1 месяц назад', '2 месяца назад', '3 месяца назад', '4 месяца назад', '5 месяцев назад', '6 месяцев назад', '7 месяцев назад', '8 месяцев назад', '9 месяцев назад', '9 месяцев назад', '10 месяцев назад', '1 год назад', '2 года назад', '3 года назад', '100 лет назад'], 'ru', _style.defaultStyle);
|
||||
});
|
||||
it("should format future dates", function () {
|
||||
new _JavascriptTimeAgo.default('en').format(Date.now() + 60 * 60 * 1000).should.equal('in an hour');
|
||||
new _JavascriptTimeAgo.default('ru').format(Date.now() + 45.1 * 1000).should.equal('через 1 минуту');
|
||||
});
|
||||
it("should have generated missing quantifier functions", function () {
|
||||
new _JavascriptTimeAgo.default('ccp').format(Date.now() + 60 * 1000).should.equal('1 𑄟𑄨𑄚𑄨𑄘𑄬');
|
||||
});
|
||||
it("should throw for non-existing locales", function () {
|
||||
(function () {
|
||||
return _JavascriptTimeAgo.default.addLocale();
|
||||
}).should.throw('No locale data passed');
|
||||
});
|
||||
});
|
||||
|
||||
function convenientGradationTest(convenientGradationLabels, timeAgo) {
|
||||
var style = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
||||
|
||||
if (typeof timeAgo === 'string') {
|
||||
timeAgo = new _JavascriptTimeAgo.default(timeAgo);
|
||||
}
|
||||
|
||||
var now = Date.now();
|
||||
|
||||
var elapsed = function elapsed(time) {
|
||||
return timeAgo.format(now - time * 1000, _objectSpread({
|
||||
now: now
|
||||
}, style));
|
||||
};
|
||||
|
||||
if (convenientGradation.length !== convenientGradationLabels.length) {
|
||||
throw new Error("Array length mismatch. Gradation steps: ".concat(convenientGradation.length, ", labels: ").concat(convenientGradationLabels.length));
|
||||
}
|
||||
|
||||
var i = 0;
|
||||
|
||||
while (i < convenientGradation.length) {
|
||||
for (var _iterator = convenientGradation[i], _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
|
||||
var _ref3;
|
||||
|
||||
if (_isArray) {
|
||||
if (_i >= _iterator.length) break;
|
||||
_ref3 = _iterator[_i++];
|
||||
} else {
|
||||
_i = _iterator.next();
|
||||
if (_i.done) break;
|
||||
_ref3 = _i.value;
|
||||
}
|
||||
|
||||
var time = _ref3;
|
||||
elapsed(time).should.equal(convenientGradationLabels[i]);
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
var convenientGradation = [// 'just now':
|
||||
[0, 44.9], // 'a minute ago':
|
||||
[45.1, 1.49 * 60], // '2 minutes ago':
|
||||
[1.51 * 60, 2.49 * 60], // '5 minutes ago':
|
||||
[2.51 * 60, 7.49 * 60], // '10 minutes ago':
|
||||
[7.51 * 60, 12.49 * 60], // '15 minutes ago':
|
||||
[12.51 * 60, 17.49 * 60], // '20 minutes ago':
|
||||
[17.51 * 60, 22.49 * 60], // '25 minutes ago':
|
||||
[22.51 * 60, 27.49 * 60], // '30 minutes ago':
|
||||
[27.51 * 60, 32.49 * 60], // '35 minutes ago':
|
||||
[32.51 * 60, 37.49 * 60], // '40 minutes ago':
|
||||
[37.51 * 60, 42.49 * 60], // '45 minutes ago':
|
||||
[42.51 * 60, 47.49 * 60], // '50 minutes ago':
|
||||
[47.51 * 60, 52.49 * 60], // 'an hour ago':
|
||||
[55.01 * 60, 1.49 * 60 * 60], // '2 hours ago':
|
||||
[1.51 * 60 * 60, 2.49 * 60 * 60], // '3 hours ago':
|
||||
[2.51 * 60 * 60, 3.49 * 60 * 60], // '4 hours ago':
|
||||
[3.51 * 60 * 60, 4.49 * 60 * 60], // '5 hours ago':
|
||||
[4.51 * 60 * 60, 5.49 * 60 * 60], // '6 hours ago':
|
||||
[5.51 * 60 * 60, 6.49 * 60 * 60], // '7 hours ago':
|
||||
[6.51 * 60 * 60, 7.49 * 60 * 60], // '8 hours ago':
|
||||
[7.51 * 60 * 60, 8.49 * 60 * 60], // '9 hours ago':
|
||||
[8.51 * 60 * 60, 9.49 * 60 * 60], // '10 hours ago':
|
||||
[9.51 * 60 * 60, 10.49 * 60 * 60], // '11 hours ago':
|
||||
[10.51 * 60 * 60, 11.49 * 60 * 60], // '12 hours ago':
|
||||
[11.51 * 60 * 60, 12.49 * 60 * 60], // '13 hours ago':
|
||||
[12.51 * 60 * 60, 13.49 * 60 * 60], // '14 hours ago':
|
||||
[13.51 * 60 * 60, 14.49 * 60 * 60], // '15 hours ago':
|
||||
[14.51 * 60 * 60, 15.49 * 60 * 60], // '16 hours ago':
|
||||
[15.51 * 60 * 60, 16.49 * 60 * 60], // '17 hours ago':
|
||||
[16.51 * 60 * 60, 17.49 * 60 * 60], // '18 hours ago':
|
||||
[17.51 * 60 * 60, 18.49 * 60 * 60], // '19 hours ago':
|
||||
[18.51 * 60 * 60, 19.49 * 60 * 60], // '20 hours ago':
|
||||
[19.51 * 60 * 60, 20.49 * 60 * 60], // 'a day ago':
|
||||
[20.51 * 60 * 60, 1.49 * _gradation.day], // '2 days ago':
|
||||
[1.51 * _gradation.day, 2.49 * _gradation.day], // '3 days ago':
|
||||
[2.51 * _gradation.day, 3.49 * _gradation.day], // '4 days ago':
|
||||
[3.51 * _gradation.day, 4.49 * _gradation.day], // '5 days ago':
|
||||
[4.51 * _gradation.day, 5.49 * _gradation.day], // 'a week ago':
|
||||
[5.51 * _gradation.day, 1.49 * 7 * _gradation.day], // '2 weeks ago':
|
||||
[1.51 * 7 * _gradation.day, 2.49 * 7 * _gradation.day], // '3 weeks ago':
|
||||
[2.51 * 7 * _gradation.day, 3.49 * 7 * _gradation.day], // 'a month ago':
|
||||
[3.51 * 7 * _gradation.day, 1.49 * _gradation.month], // '2 months ago':
|
||||
[1.51 * _gradation.month, 2.49 * _gradation.month], // '3 months ago':
|
||||
[2.51 * _gradation.month, 3.49 * _gradation.month], // '4 months ago':
|
||||
[3.51 * _gradation.month, 4.49 * _gradation.month], // '5 months ago':
|
||||
[4.51 * _gradation.month, 5.49 * _gradation.month], // '6 months ago':
|
||||
[5.51 * _gradation.month, 6.49 * _gradation.month], // '7 months ago':
|
||||
[6.51 * _gradation.month, 7.49 * _gradation.month], // '8 months ago':
|
||||
[7.51 * _gradation.month, 8.49 * _gradation.month], // '9 months ago':
|
||||
[8.51 * _gradation.month, 8.99 * _gradation.month], // '9 months ago':
|
||||
[9.01 * _gradation.month, 9.49 * _gradation.month], // '10 months ago':
|
||||
[9.51 * _gradation.month, 10.49 * _gradation.month], // 'a year ago':
|
||||
[10.51 * _gradation.month, 1.49 * _gradation.year], // '2 years ago':
|
||||
[1.51 * _gradation.year, 2.49 * _gradation.year], // '3 years ago':
|
||||
[2.51 * _gradation.year, 3.49 * _gradation.year], // '100 years ago':
|
||||
[99.51 * _gradation.year, 100.49 * _gradation.year]];
|
||||
//# sourceMappingURL=JavascriptTimeAgo.test.js.map
|
||||
1
node_modules/javascript-time-ago/commonjs/JavascriptTimeAgo.test.js.map
generated
vendored
Normal file
1
node_modules/javascript-time-ago/commonjs/JavascriptTimeAgo.test.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
28
node_modules/javascript-time-ago/commonjs/LocaleDataStore.js
generated
vendored
Normal file
28
node_modules/javascript-time-ago/commonjs/LocaleDataStore.js
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.getLocaleData = getLocaleData;
|
||||
exports.addLocaleData = addLocaleData;
|
||||
// Fallback locale.
|
||||
// (when not a single one of the supplied "preferred" locales is available)
|
||||
var defaultLocale = 'en'; // For all locales added
|
||||
// their relative time formatter messages will be stored here.
|
||||
|
||||
var localesData = {};
|
||||
|
||||
function getLocaleData(locale) {
|
||||
return localesData[locale];
|
||||
}
|
||||
|
||||
function addLocaleData(localeData) {
|
||||
if (!localeData) {
|
||||
throw new Error('[javascript-time-ago] No locale data passed.');
|
||||
} // This locale data is stored in a global variable
|
||||
// and later used when calling `.format(time)`.
|
||||
|
||||
|
||||
localesData[localeData.locale] = localeData;
|
||||
}
|
||||
//# sourceMappingURL=LocaleDataStore.js.map
|
||||
1
node_modules/javascript-time-ago/commonjs/LocaleDataStore.js.map
generated
vendored
Normal file
1
node_modules/javascript-time-ago/commonjs/LocaleDataStore.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../source/LocaleDataStore.js"],"names":["defaultLocale","localesData","getLocaleData","locale","addLocaleData","localeData","Error"],"mappings":";;;;;;;AAAA;AACA;AACA,IAAIA,aAAa,GAAG,IAApB,C,CAEA;AACA;;AACA,IAAMC,WAAW,GAAG,EAApB;;AAEO,SAASC,aAAT,CAAuBC,MAAvB,EAA+B;AACrC,SAAOF,WAAW,CAACE,MAAD,CAAlB;AACA;;AAEM,SAASC,aAAT,CAAuBC,UAAvB,EAAmC;AACzC,MAAI,CAACA,UAAL,EAAiB;AAChB,UAAM,IAAIC,KAAJ,CAAU,8CAAV,CAAN;AACA,GAHwC,CAIzC;AACA;;;AACAL,EAAAA,WAAW,CAACI,UAAU,CAACF,MAAZ,CAAX,GAAiCE,UAAjC;AACA","sourcesContent":["// Fallback locale.\r\n// (when not a single one of the supplied \"preferred\" locales is available)\r\nlet defaultLocale = 'en'\r\n\r\n// For all locales added\r\n// their relative time formatter messages will be stored here.\r\nconst localesData = {}\r\n\r\nexport function getLocaleData(locale) {\r\n\treturn localesData[locale]\r\n}\r\n\r\nexport function addLocaleData(localeData) {\r\n\tif (!localeData) {\r\n\t\tthrow new Error('[javascript-time-ago] No locale data passed.')\r\n\t}\r\n\t// This locale data is stored in a global variable\r\n\t// and later used when calling `.format(time)`.\r\n\tlocalesData[localeData.locale] = localeData\r\n}"],"file":"LocaleDataStore.js"}
|
||||
31
node_modules/javascript-time-ago/commonjs/PropTypes.js
generated
vendored
Normal file
31
node_modules/javascript-time-ago/commonjs/PropTypes.js
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.style = void 0;
|
||||
|
||||
var _propTypes = require("prop-types");
|
||||
|
||||
var threshold = (0, _propTypes.oneOfType)([_propTypes.number, _propTypes.func]);
|
||||
var gradation = (0, _propTypes.arrayOf)((0, _propTypes.oneOfType)([(0, _propTypes.shape)({
|
||||
unit: _propTypes.string.isRequired,
|
||||
factor: _propTypes.number,
|
||||
granularity: _propTypes.number,
|
||||
threshold: threshold // Specific `threshold_[unit]` properties may also be defined
|
||||
|
||||
}), (0, _propTypes.shape)({
|
||||
format: _propTypes.func.isRequired,
|
||||
threshold: threshold // Specific `threshold_[unit]` properties may also be defined
|
||||
|
||||
})])); // Date/time formatting style.
|
||||
// E.g. 'twitter', 'fuzzy', or custom (`{ gradation: […], units: […], flavour: 'long', custom: function }`)
|
||||
|
||||
var style = (0, _propTypes.oneOfType)([_propTypes.string, (0, _propTypes.shape)({
|
||||
gradation: gradation,
|
||||
units: (0, _propTypes.arrayOf)(_propTypes.string),
|
||||
flavour: (0, _propTypes.oneOfType)([_propTypes.string, (0, _propTypes.arrayOf)(_propTypes.string)]),
|
||||
custom: _propTypes.func
|
||||
})]);
|
||||
exports.style = style;
|
||||
//# sourceMappingURL=PropTypes.js.map
|
||||
1
node_modules/javascript-time-ago/commonjs/PropTypes.js.map
generated
vendored
Normal file
1
node_modules/javascript-time-ago/commonjs/PropTypes.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../source/PropTypes.js"],"names":["threshold","number","func","gradation","unit","string","isRequired","factor","granularity","format","style","units","flavour","custom"],"mappings":";;;;;;;AAAA;;AASA,IAAMA,SAAS,GAAG,0BAAU,CAC3BC,iBAD2B,EAE3BC,eAF2B,CAAV,CAAlB;AAKA,IAAMC,SAAS,GAAG,wBAAQ,0BAAU,CACnC,sBAAM;AACLC,EAAAA,IAAI,EAAUC,kBAAOC,UADhB;AAELC,EAAAA,MAAM,EAAQN,iBAFT;AAGLO,EAAAA,WAAW,EAAGP,iBAHT;AAILD,EAAAA,SAAS,EAATA,SAJK,CAKL;;AALK,CAAN,CADmC,EAQnC,sBAAM;AACLS,EAAAA,MAAM,EAAGP,gBAAKI,UADT;AAELN,EAAAA,SAAS,EAATA,SAFK,CAGL;;AAHK,CAAN,CARmC,CAAV,CAAR,CAAlB,C,CAeA;AACA;;AACO,IAAMU,KAAK,GAAG,0BAAU,CAC9BL,iBAD8B,EAE9B,sBAAM;AACLF,EAAAA,SAAS,EAATA,SADK;AAELQ,EAAAA,KAAK,EAAK,wBAAQN,iBAAR,CAFL;AAGLO,EAAAA,OAAO,EAAG,0BAAU,CACnBP,iBADmB,EAEnB,wBAAQA,iBAAR,CAFmB,CAAV,CAHL;AAOLQ,EAAAA,MAAM,EAAGX;AAPJ,CAAN,CAF8B,CAAV,CAAd","sourcesContent":["import {\r\n\toneOfType,\r\n\tarrayOf,\r\n\tstring,\r\n\tnumber,\r\n\tshape,\r\n\tfunc\r\n} from 'prop-types'\r\n\r\nconst threshold = oneOfType([\r\n\tnumber,\r\n\tfunc\r\n])\r\n\r\nconst gradation = arrayOf(oneOfType([\r\n\tshape({\r\n\t\tunit : string.isRequired,\r\n\t\tfactor : number,\r\n\t\tgranularity : number,\r\n\t\tthreshold\r\n\t\t// Specific `threshold_[unit]` properties may also be defined\r\n\t}),\r\n\tshape({\r\n\t\tformat : func.isRequired,\r\n\t\tthreshold\r\n\t\t// Specific `threshold_[unit]` properties may also be defined\r\n\t})\r\n]))\r\n\r\n// Date/time formatting style.\r\n// E.g. 'twitter', 'fuzzy', or custom (`{ gradation: […], units: […], flavour: 'long', custom: function }`)\r\nexport const style = oneOfType([\r\n\tstring,\r\n\tshape({\r\n\t\tgradation,\r\n\t\tunits : arrayOf(string),\r\n\t\tflavour : oneOfType([\r\n\t\t\tstring,\r\n\t\t\tarrayOf(string)\r\n\t\t]),\r\n\t\tcustom : func\r\n\t})\r\n])"],"file":"PropTypes.js"}
|
||||
84
node_modules/javascript-time-ago/commonjs/cache.js
generated
vendored
Normal file
84
node_modules/javascript-time-ago/commonjs/cache.js
generated
vendored
Normal file
@@ -0,0 +1,84 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
/**
|
||||
* A basic in-memory cache.
|
||||
*
|
||||
* import Cache from 'javascript-time-ago/Cache'
|
||||
* const cache = new Cache()
|
||||
* const object = cache.get('key1', 'key2', ...) || cache.put('key1', 'key2', ..., createObject())
|
||||
*/
|
||||
var Cache =
|
||||
/*#__PURE__*/
|
||||
function () {
|
||||
function Cache() {
|
||||
_classCallCheck(this, Cache);
|
||||
|
||||
_defineProperty(this, "cache", {});
|
||||
}
|
||||
|
||||
_createClass(Cache, [{
|
||||
key: "get",
|
||||
value: function get() {
|
||||
var cache = this.cache;
|
||||
|
||||
for (var _len = arguments.length, keys = new Array(_len), _key = 0; _key < _len; _key++) {
|
||||
keys[_key] = arguments[_key];
|
||||
}
|
||||
|
||||
for (var _i = 0; _i < keys.length; _i++) {
|
||||
var key = keys[_i];
|
||||
|
||||
if (_typeof(cache) !== 'object') {
|
||||
return;
|
||||
}
|
||||
|
||||
cache = cache[key];
|
||||
}
|
||||
|
||||
return cache;
|
||||
}
|
||||
}, {
|
||||
key: "put",
|
||||
value: function put() {
|
||||
for (var _len2 = arguments.length, keys = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
||||
keys[_key2] = arguments[_key2];
|
||||
}
|
||||
|
||||
var value = keys.pop();
|
||||
var lastKey = keys.pop();
|
||||
var cache = this.cache;
|
||||
|
||||
for (var _i2 = 0; _i2 < keys.length; _i2++) {
|
||||
var key = keys[_i2];
|
||||
|
||||
if (_typeof(cache[key]) !== 'object') {
|
||||
cache[key] = {};
|
||||
}
|
||||
|
||||
cache = cache[key];
|
||||
}
|
||||
|
||||
return cache[lastKey] = value;
|
||||
}
|
||||
}]);
|
||||
|
||||
return Cache;
|
||||
}();
|
||||
|
||||
exports.default = Cache;
|
||||
//# sourceMappingURL=cache.js.map
|
||||
1
node_modules/javascript-time-ago/commonjs/cache.js.map
generated
vendored
Normal file
1
node_modules/javascript-time-ago/commonjs/cache.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../source/cache.js"],"names":["Cache","cache","keys","key","value","pop","lastKey"],"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;IAOqBA,K;;;;;;mCACZ,E;;;;;0BAEK;AACZ,UAAIC,KAAK,GAAG,KAAKA,KAAjB;;AADY,wCAANC,IAAM;AAANA,QAAAA,IAAM;AAAA;;AAEZ,4BAAkBA,IAAlB,eAAwB;AAAnB,YAAMC,GAAG,GAAID,IAAJ,IAAT;;AACJ,YAAI,QAAOD,KAAP,MAAiB,QAArB,EAA+B;AAC9B;AACA;;AACDA,QAAAA,KAAK,GAAGA,KAAK,CAACE,GAAD,CAAb;AACA;;AACD,aAAOF,KAAP;AACA;;;0BAEY;AAAA,yCAANC,IAAM;AAANA,QAAAA,IAAM;AAAA;;AACZ,UAAME,KAAK,GAAGF,IAAI,CAACG,GAAL,EAAd;AACA,UAAMC,OAAO,GAAGJ,IAAI,CAACG,GAAL,EAAhB;AACA,UAAIJ,KAAK,GAAG,KAAKA,KAAjB;;AACA,8BAAkBC,IAAlB,gBAAwB;AAAnB,YAAMC,GAAG,GAAID,IAAJ,KAAT;;AACJ,YAAI,QAAOD,KAAK,CAACE,GAAD,CAAZ,MAAsB,QAA1B,EAAoC;AACnCF,UAAAA,KAAK,CAACE,GAAD,CAAL,GAAa,EAAb;AACA;;AACDF,QAAAA,KAAK,GAAGA,KAAK,CAACE,GAAD,CAAb;AACA;;AACD,aAAOF,KAAK,CAACK,OAAD,CAAL,GAAiBF,KAAxB;AACA","sourcesContent":["/**\r\n * A basic in-memory cache.\r\n *\r\n * import Cache from 'javascript-time-ago/Cache'\r\n * const cache = new Cache()\r\n * const object = cache.get('key1', 'key2', ...) || cache.put('key1', 'key2', ..., createObject())\r\n */\r\nexport default class Cache {\r\n\tcache = {}\r\n\r\n\tget(...keys) {\r\n\t\tlet cache = this.cache\r\n\t\tfor (const key of keys) {\r\n\t\t\tif (typeof cache !== 'object') {\r\n\t\t\t\treturn\r\n\t\t\t}\r\n\t\t\tcache = cache[key]\r\n\t\t}\r\n\t\treturn cache\r\n\t}\r\n\r\n\tput(...keys) {\r\n\t\tconst value = keys.pop()\r\n\t\tconst lastKey = keys.pop()\r\n\t\tlet cache = this.cache\r\n\t\tfor (const key of keys) {\r\n\t\t\tif (typeof cache[key] !== 'object') {\r\n\t\t\t\tcache[key] = {}\r\n\t\t\t}\r\n\t\t\tcache = cache[key]\r\n\t\t}\r\n\t\treturn cache[lastKey] = value\r\n\t}\r\n}"],"file":"cache.js"}
|
||||
17
node_modules/javascript-time-ago/commonjs/cache.test.js
generated
vendored
Normal file
17
node_modules/javascript-time-ago/commonjs/cache.test.js
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
"use strict";
|
||||
|
||||
var _cache = _interopRequireDefault(require("./cache"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
describe('cache', function () {
|
||||
it('should cache', function () {
|
||||
var cache = new _cache.default();
|
||||
var value = {};
|
||||
expect(cache.get('123', '456')).to.be.undefined;
|
||||
expect(cache.put('123', '456', value)).to.equal(value);
|
||||
expect(cache.get('123', '456')).to.equal(value);
|
||||
expect(cache.put('123', '789', 123)).to.equal(123);
|
||||
});
|
||||
});
|
||||
//# sourceMappingURL=cache.test.js.map
|
||||
1
node_modules/javascript-time-ago/commonjs/cache.test.js.map
generated
vendored
Normal file
1
node_modules/javascript-time-ago/commonjs/cache.test.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../source/cache.test.js"],"names":["describe","it","cache","Cache","value","expect","get","to","be","undefined","put","equal"],"mappings":";;AAAA;;;;AAEAA,QAAQ,CAAC,OAAD,EAAU,YAClB;AACCC,EAAAA,EAAE,CAAC,cAAD,EAAiB,YACnB;AACC,QAAMC,KAAK,GAAG,IAAIC,cAAJ,EAAd;AAEA,QAAMC,KAAK,GAAG,EAAd;AACAC,IAAAA,MAAM,CAACH,KAAK,CAACI,GAAN,CAAU,KAAV,EAAiB,KAAjB,CAAD,CAAN,CAAgCC,EAAhC,CAAmCC,EAAnC,CAAsCC,SAAtC;AACAJ,IAAAA,MAAM,CAACH,KAAK,CAACQ,GAAN,CAAU,KAAV,EAAiB,KAAjB,EAAwBN,KAAxB,CAAD,CAAN,CAAuCG,EAAvC,CAA0CI,KAA1C,CAAgDP,KAAhD;AACAC,IAAAA,MAAM,CAACH,KAAK,CAACI,GAAN,CAAU,KAAV,EAAiB,KAAjB,CAAD,CAAN,CAAgCC,EAAhC,CAAmCI,KAAnC,CAAyCP,KAAzC;AAEAC,IAAAA,MAAM,CAACH,KAAK,CAACQ,GAAN,CAAU,KAAV,EAAiB,KAAjB,EAAwB,GAAxB,CAAD,CAAN,CAAqCH,EAArC,CAAwCI,KAAxC,CAA8C,GAA9C;AACA,GAVC,CAAF;AAWA,CAbO,CAAR","sourcesContent":["import Cache from './cache'\r\n\r\ndescribe('cache', () =>\r\n{\r\n\tit('should cache', () =>\r\n\t{\r\n\t\tconst cache = new Cache()\r\n\r\n\t\tconst value = {}\r\n\t\texpect(cache.get('123', '456')).to.be.undefined\r\n\t\texpect(cache.put('123', '456', value)).to.equal(value)\r\n\t\texpect(cache.get('123', '456')).to.equal(value)\r\n\r\n\t\texpect(cache.put('123', '789', 123)).to.equal(123)\r\n\t})\r\n})\r\n"],"file":"cache.test.js"}
|
||||
71
node_modules/javascript-time-ago/commonjs/gradation/canonical.js
generated
vendored
Normal file
71
node_modules/javascript-time-ago/commonjs/gradation/canonical.js
generated
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
var _helpers = require("./helpers");
|
||||
|
||||
// just now
|
||||
// 1 second ago
|
||||
// 2 seconds ago
|
||||
// …
|
||||
// 59 seconds ago
|
||||
// 1 minute ago
|
||||
// 2 minutes ago
|
||||
// …
|
||||
// 59 minutes ago
|
||||
// 1 hour ago
|
||||
// 2 hours ago
|
||||
// …
|
||||
// 24 hours ago
|
||||
// 1 day ago
|
||||
// 2 days ago
|
||||
// …
|
||||
// 7 days ago
|
||||
// 1 week ago
|
||||
// 2 weeks ago
|
||||
// …
|
||||
// 3 weeks ago
|
||||
// 1 month ago
|
||||
// 2 months ago
|
||||
// …
|
||||
// 11 months ago
|
||||
// 1 year ago
|
||||
// 2 years ago
|
||||
// …
|
||||
var _default = [{
|
||||
factor: 1,
|
||||
unit: 'now'
|
||||
}, {
|
||||
threshold: 0.5,
|
||||
factor: 1,
|
||||
unit: 'second'
|
||||
}, {
|
||||
threshold: 59.5,
|
||||
factor: 60,
|
||||
unit: 'minute'
|
||||
}, {
|
||||
threshold: 59.5 * 60,
|
||||
factor: 60 * 60,
|
||||
unit: 'hour'
|
||||
}, {
|
||||
threshold: 23.5 * 60 * 60,
|
||||
factor: _helpers.day,
|
||||
unit: 'day'
|
||||
}, {
|
||||
threshold: 6.5 * _helpers.day,
|
||||
factor: 7 * _helpers.day,
|
||||
unit: 'week'
|
||||
}, {
|
||||
threshold: 3.5 * 7 * _helpers.day,
|
||||
factor: _helpers.month,
|
||||
unit: 'month'
|
||||
}, {
|
||||
threshold: 11.5 * _helpers.month,
|
||||
factor: _helpers.year,
|
||||
unit: 'year'
|
||||
}];
|
||||
exports.default = _default;
|
||||
//# sourceMappingURL=canonical.js.map
|
||||
1
node_modules/javascript-time-ago/commonjs/gradation/canonical.js.map
generated
vendored
Normal file
1
node_modules/javascript-time-ago/commonjs/gradation/canonical.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../source/gradation/canonical.js"],"names":["factor","unit","threshold","day","month","year"],"mappings":";;;;;;;AAAA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;eAEA,CACC;AACCA,EAAAA,MAAM,EAAE,CADT;AAECC,EAAAA,IAAI,EAAE;AAFP,CADD,EAKC;AACCC,EAAAA,SAAS,EAAE,GADZ;AAECF,EAAAA,MAAM,EAAE,CAFT;AAGCC,EAAAA,IAAI,EAAE;AAHP,CALD,EAUC;AACCC,EAAAA,SAAS,EAAE,IADZ;AAECF,EAAAA,MAAM,EAAE,EAFT;AAGCC,EAAAA,IAAI,EAAE;AAHP,CAVD,EAeC;AACCC,EAAAA,SAAS,EAAE,OAAO,EADnB;AAECF,EAAAA,MAAM,EAAE,KAAK,EAFd;AAGCC,EAAAA,IAAI,EAAE;AAHP,CAfD,EAoBC;AACCC,EAAAA,SAAS,EAAE,OAAO,EAAP,GAAY,EADxB;AAECF,EAAAA,MAAM,EAAEG,YAFT;AAGCF,EAAAA,IAAI,EAAE;AAHP,CApBD,EAyBC;AACCC,EAAAA,SAAS,EAAE,MAAMC,YADlB;AAECH,EAAAA,MAAM,EAAE,IAAIG,YAFb;AAGCF,EAAAA,IAAI,EAAE;AAHP,CAzBD,EA8BC;AACCC,EAAAA,SAAS,EAAE,MAAM,CAAN,GAAUC,YADtB;AAECH,EAAAA,MAAM,EAAEI,cAFT;AAGCH,EAAAA,IAAI,EAAE;AAHP,CA9BD,EAmCC;AACCC,EAAAA,SAAS,EAAE,OAAOE,cADnB;AAECJ,EAAAA,MAAM,EAAEK,aAFT;AAGCJ,EAAAA,IAAI,EAAE;AAHP,CAnCD,C","sourcesContent":["import { day, month, year } from './helpers'\r\n\r\n// just now\r\n// 1 second ago\r\n// 2 seconds ago\r\n// …\r\n// 59 seconds ago\r\n// 1 minute ago\r\n// 2 minutes ago\r\n// …\r\n// 59 minutes ago\r\n// 1 hour ago\r\n// 2 hours ago\r\n// …\r\n// 24 hours ago\r\n// 1 day ago\r\n// 2 days ago\r\n// …\r\n// 7 days ago\r\n// 1 week ago\r\n// 2 weeks ago\r\n// …\r\n// 3 weeks ago\r\n// 1 month ago\r\n// 2 months ago\r\n// …\r\n// 11 months ago\r\n// 1 year ago\r\n// 2 years ago\r\n// …\r\nexport default\r\n[\r\n\t{\r\n\t\tfactor: 1,\r\n\t\tunit: 'now'\r\n\t},\r\n\t{\r\n\t\tthreshold: 0.5,\r\n\t\tfactor: 1,\r\n\t\tunit: 'second'\r\n\t},\r\n\t{\r\n\t\tthreshold: 59.5,\r\n\t\tfactor: 60,\r\n\t\tunit: 'minute'\r\n\t},\r\n\t{\r\n\t\tthreshold: 59.5 * 60,\r\n\t\tfactor: 60 * 60,\r\n\t\tunit: 'hour'\r\n\t},\r\n\t{\r\n\t\tthreshold: 23.5 * 60 * 60,\r\n\t\tfactor: day,\r\n\t\tunit: 'day'\r\n\t},\r\n\t{\r\n\t\tthreshold: 6.5 * day,\r\n\t\tfactor: 7 * day,\r\n\t\tunit: 'week'\r\n\t},\r\n\t{\r\n\t\tthreshold: 3.5 * 7 * day,\r\n\t\tfactor: month,\r\n\t\tunit: 'month'\r\n\t},\r\n\t{\r\n\t\tthreshold: 11.5 * month,\r\n\t\tfactor: year,\r\n\t\tunit: 'year'\r\n\t}\r\n]"],"file":"canonical.js"}
|
||||
29
node_modules/javascript-time-ago/commonjs/gradation/canonical.test.js
generated
vendored
Normal file
29
node_modules/javascript-time-ago/commonjs/gradation/canonical.test.js
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
"use strict";
|
||||
|
||||
var _grade = _interopRequireDefault(require("../grade"));
|
||||
|
||||
var _canonical = _interopRequireDefault(require("./canonical"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
// Perhaps this should be part of `grade.test.js` instead.
|
||||
describe('canonical gradation', function () {
|
||||
it('should grade correctly', function () {
|
||||
var test = function test(elapsed) {
|
||||
return (0, _grade.default)(elapsed, null, ['second', 'minute', 'hour', 'day', 'month', 'year'], _canonical.default);
|
||||
};
|
||||
|
||||
expect(test(0)).to.be.undefined;
|
||||
expect(test(0.5).unit).to.equal('second');
|
||||
expect(test(0.5).factor).to.equal(1);
|
||||
expect(test(59.4).unit).to.equal('second');
|
||||
expect(test(59.4).factor).to.equal(1);
|
||||
expect(test(59.5).unit).to.equal('minute');
|
||||
expect(test(59.5).factor).to.equal(60);
|
||||
expect(test(59.5 * 60 - 1).unit).to.equal('minute');
|
||||
expect(test(59.5 * 60 - 1).factor).to.equal(60);
|
||||
expect(test(59.5 * 60).unit).to.equal('hour');
|
||||
expect(test(59.5 * 60).factor).to.equal(60 * 60);
|
||||
});
|
||||
});
|
||||
//# sourceMappingURL=canonical.test.js.map
|
||||
1
node_modules/javascript-time-ago/commonjs/gradation/canonical.test.js.map
generated
vendored
Normal file
1
node_modules/javascript-time-ago/commonjs/gradation/canonical.test.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../source/gradation/canonical.test.js"],"names":["describe","it","test","elapsed","gradation","expect","to","be","undefined","unit","equal","factor"],"mappings":";;AAAA;;AACA;;;;AAEA;AAEAA,QAAQ,CAAC,qBAAD,EAAwB,YAChC;AACCC,EAAAA,EAAE,CAAC,wBAAD,EAA2B,YAC7B;AACC,QAAMC,IAAI,GAAG,SAAPA,IAAO,CAACC,OAAD;AAAA,aAAa,oBAAMA,OAAN,EAAe,IAAf,EAAqB,CAC9C,QAD8C,EAE9C,QAF8C,EAG9C,MAH8C,EAI9C,KAJ8C,EAK9C,OAL8C,EAM9C,MAN8C,CAArB,EAOvBC,kBAPuB,CAAb;AAAA,KAAb;;AASAC,IAAAA,MAAM,CAACH,IAAI,CAAC,CAAD,CAAL,CAAN,CAAgBI,EAAhB,CAAmBC,EAAnB,CAAsBC,SAAtB;AAEAH,IAAAA,MAAM,CAACH,IAAI,CAAC,GAAD,CAAJ,CAAUO,IAAX,CAAN,CAAuBH,EAAvB,CAA0BI,KAA1B,CAAgC,QAAhC;AACAL,IAAAA,MAAM,CAACH,IAAI,CAAC,GAAD,CAAJ,CAAUS,MAAX,CAAN,CAAyBL,EAAzB,CAA4BI,KAA5B,CAAkC,CAAlC;AAEAL,IAAAA,MAAM,CAACH,IAAI,CAAC,IAAD,CAAJ,CAAWO,IAAZ,CAAN,CAAwBH,EAAxB,CAA2BI,KAA3B,CAAiC,QAAjC;AACAL,IAAAA,MAAM,CAACH,IAAI,CAAC,IAAD,CAAJ,CAAWS,MAAZ,CAAN,CAA0BL,EAA1B,CAA6BI,KAA7B,CAAmC,CAAnC;AAEAL,IAAAA,MAAM,CAACH,IAAI,CAAC,IAAD,CAAJ,CAAWO,IAAZ,CAAN,CAAwBH,EAAxB,CAA2BI,KAA3B,CAAiC,QAAjC;AACAL,IAAAA,MAAM,CAACH,IAAI,CAAC,IAAD,CAAJ,CAAWS,MAAZ,CAAN,CAA0BL,EAA1B,CAA6BI,KAA7B,CAAmC,EAAnC;AAEAL,IAAAA,MAAM,CAACH,IAAI,CAAC,OAAO,EAAP,GAAY,CAAb,CAAJ,CAAoBO,IAArB,CAAN,CAAiCH,EAAjC,CAAoCI,KAApC,CAA0C,QAA1C;AACAL,IAAAA,MAAM,CAACH,IAAI,CAAC,OAAO,EAAP,GAAY,CAAb,CAAJ,CAAoBS,MAArB,CAAN,CAAmCL,EAAnC,CAAsCI,KAAtC,CAA4C,EAA5C;AAEAL,IAAAA,MAAM,CAACH,IAAI,CAAC,OAAO,EAAR,CAAJ,CAAgBO,IAAjB,CAAN,CAA6BH,EAA7B,CAAgCI,KAAhC,CAAsC,MAAtC;AACAL,IAAAA,MAAM,CAACH,IAAI,CAAC,OAAO,EAAR,CAAJ,CAAgBS,MAAjB,CAAN,CAA+BL,EAA/B,CAAkCI,KAAlC,CAAwC,KAAK,EAA7C;AACA,GA3BC,CAAF;AA4BA,CA9BO,CAAR","sourcesContent":["import grade from '../grade'\r\nimport gradation from './canonical'\r\n\r\n// Perhaps this should be part of `grade.test.js` instead.\r\n\r\ndescribe('canonical gradation', () =>\r\n{\r\n\tit('should grade correctly', () =>\r\n\t{\r\n\t\tconst test = (elapsed) => grade(elapsed, null, [\r\n\t\t\t'second',\r\n\t\t\t'minute',\r\n\t\t\t'hour',\r\n\t\t\t'day',\r\n\t\t\t'month',\r\n\t\t\t'year'\r\n\t\t], gradation)\r\n\r\n\t\texpect(test(0)).to.be.undefined\r\n\r\n\t\texpect(test(0.5).unit).to.equal('second')\r\n\t\texpect(test(0.5).factor).to.equal(1)\r\n\r\n\t\texpect(test(59.4).unit).to.equal('second')\r\n\t\texpect(test(59.4).factor).to.equal(1)\r\n\r\n\t\texpect(test(59.5).unit).to.equal('minute')\r\n\t\texpect(test(59.5).factor).to.equal(60)\r\n\r\n\t\texpect(test(59.5 * 60 - 1).unit).to.equal('minute')\r\n\t\texpect(test(59.5 * 60 - 1).factor).to.equal(60)\r\n\r\n\t\texpect(test(59.5 * 60).unit).to.equal('hour')\r\n\t\texpect(test(59.5 * 60).factor).to.equal(60 * 60)\r\n\t})\r\n})"],"file":"canonical.test.js"}
|
||||
77
node_modules/javascript-time-ago/commonjs/gradation/convenient.js
generated
vendored
Normal file
77
node_modules/javascript-time-ago/commonjs/gradation/convenient.js
generated
vendored
Normal file
@@ -0,0 +1,77 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
var _helpers = require("./helpers");
|
||||
|
||||
// just now
|
||||
// 1 minute ago
|
||||
// 2 minutes ago
|
||||
// 5 minutes ago
|
||||
// 10 minutes ago
|
||||
// 15 minutes ago
|
||||
// 20 minutes ago
|
||||
// an hour ago
|
||||
// 2 hours ago
|
||||
// …
|
||||
// 20 hours ago
|
||||
// a day ago
|
||||
// 2 days ago
|
||||
// 5 days ago
|
||||
// a week ago
|
||||
// 2 weeks ago
|
||||
// 3 weeks ago
|
||||
// a month ago
|
||||
// 2 months ago
|
||||
// 4 months ago
|
||||
// a year ago
|
||||
// 2 years ago
|
||||
// …
|
||||
var _default = [{
|
||||
factor: 1,
|
||||
unit: 'now'
|
||||
}, {
|
||||
threshold: 1,
|
||||
threshold_for_now: 45,
|
||||
factor: 1,
|
||||
unit: 'second'
|
||||
}, {
|
||||
threshold: 45,
|
||||
factor: 60,
|
||||
unit: 'minute'
|
||||
}, {
|
||||
threshold: 2.5 * 60,
|
||||
factor: 60,
|
||||
granularity: 5,
|
||||
unit: 'minute'
|
||||
}, {
|
||||
threshold: 22.5 * 60,
|
||||
factor: 30 * 60,
|
||||
unit: 'half-hour'
|
||||
}, {
|
||||
threshold: 42.5 * 60,
|
||||
threshold_for_minute: 52.5 * 60,
|
||||
factor: 60 * 60,
|
||||
unit: 'hour'
|
||||
}, {
|
||||
threshold: 20.5 / 24 * _helpers.day,
|
||||
factor: _helpers.day,
|
||||
unit: 'day'
|
||||
}, {
|
||||
threshold: 5.5 * _helpers.day,
|
||||
factor: 7 * _helpers.day,
|
||||
unit: 'week'
|
||||
}, {
|
||||
threshold: 3.5 * 7 * _helpers.day,
|
||||
factor: _helpers.month,
|
||||
unit: 'month'
|
||||
}, {
|
||||
threshold: 10.5 * _helpers.month,
|
||||
factor: _helpers.year,
|
||||
unit: 'year'
|
||||
}];
|
||||
exports.default = _default;
|
||||
//# sourceMappingURL=convenient.js.map
|
||||
1
node_modules/javascript-time-ago/commonjs/gradation/convenient.js.map
generated
vendored
Normal file
1
node_modules/javascript-time-ago/commonjs/gradation/convenient.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../source/gradation/convenient.js"],"names":["factor","unit","threshold","threshold_for_now","granularity","threshold_for_minute","day","month","year"],"mappings":";;;;;;;AAAA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;eAEA,CACC;AACCA,EAAAA,MAAM,EAAE,CADT;AAECC,EAAAA,IAAI,EAAE;AAFP,CADD,EAKC;AACCC,EAAAA,SAAS,EAAE,CADZ;AAECC,EAAAA,iBAAiB,EAAE,EAFpB;AAGCH,EAAAA,MAAM,EAAE,CAHT;AAICC,EAAAA,IAAI,EAAE;AAJP,CALD,EAWC;AACCC,EAAAA,SAAS,EAAE,EADZ;AAECF,EAAAA,MAAM,EAAE,EAFT;AAGCC,EAAAA,IAAI,EAAE;AAHP,CAXD,EAgBC;AACCC,EAAAA,SAAS,EAAE,MAAM,EADlB;AAECF,EAAAA,MAAM,EAAE,EAFT;AAGCI,EAAAA,WAAW,EAAE,CAHd;AAICH,EAAAA,IAAI,EAAE;AAJP,CAhBD,EAsBC;AACCC,EAAAA,SAAS,EAAE,OAAO,EADnB;AAECF,EAAAA,MAAM,EAAE,KAAK,EAFd;AAGCC,EAAAA,IAAI,EAAE;AAHP,CAtBD,EA2BC;AACCC,EAAAA,SAAS,EAAE,OAAO,EADnB;AAECG,EAAAA,oBAAoB,EAAE,OAAO,EAF9B;AAGCL,EAAAA,MAAM,EAAE,KAAK,EAHd;AAICC,EAAAA,IAAI,EAAE;AAJP,CA3BD,EAiCC;AACCC,EAAAA,SAAS,EAAG,OAAO,EAAR,GAAcI,YAD1B;AAECN,EAAAA,MAAM,EAAEM,YAFT;AAGCL,EAAAA,IAAI,EAAE;AAHP,CAjCD,EAsCC;AACCC,EAAAA,SAAS,EAAE,MAAMI,YADlB;AAECN,EAAAA,MAAM,EAAE,IAAIM,YAFb;AAGCL,EAAAA,IAAI,EAAE;AAHP,CAtCD,EA2CC;AACCC,EAAAA,SAAS,EAAE,MAAM,CAAN,GAAUI,YADtB;AAECN,EAAAA,MAAM,EAAEO,cAFT;AAGCN,EAAAA,IAAI,EAAE;AAHP,CA3CD,EAgDC;AACCC,EAAAA,SAAS,EAAE,OAAOK,cADnB;AAECP,EAAAA,MAAM,EAAEQ,aAFT;AAGCP,EAAAA,IAAI,EAAE;AAHP,CAhDD,C","sourcesContent":["import { day, month, year } from './helpers'\r\n\r\n// just now\r\n// 1 minute ago\r\n// 2 minutes ago\r\n// 5 minutes ago\r\n// 10 minutes ago\r\n// 15 minutes ago\r\n// 20 minutes ago\r\n// an hour ago\r\n// 2 hours ago\r\n// …\r\n// 20 hours ago\r\n// a day ago\r\n// 2 days ago\r\n// 5 days ago\r\n// a week ago\r\n// 2 weeks ago\r\n// 3 weeks ago\r\n// a month ago\r\n// 2 months ago\r\n// 4 months ago\r\n// a year ago\r\n// 2 years ago\r\n// …\r\nexport default\r\n[\r\n\t{\r\n\t\tfactor: 1,\r\n\t\tunit: 'now'\r\n\t},\r\n\t{\r\n\t\tthreshold: 1,\r\n\t\tthreshold_for_now: 45,\r\n\t\tfactor: 1,\r\n\t\tunit: 'second'\r\n\t},\r\n\t{\r\n\t\tthreshold: 45,\r\n\t\tfactor: 60,\r\n\t\tunit: 'minute'\r\n\t},\r\n\t{\r\n\t\tthreshold: 2.5 * 60,\r\n\t\tfactor: 60,\r\n\t\tgranularity: 5,\r\n\t\tunit: 'minute'\r\n\t},\r\n\t{\r\n\t\tthreshold: 22.5 * 60,\r\n\t\tfactor: 30 * 60,\r\n\t\tunit: 'half-hour'\r\n\t},\r\n\t{\r\n\t\tthreshold: 42.5 * 60,\r\n\t\tthreshold_for_minute: 52.5 * 60,\r\n\t\tfactor: 60 * 60,\r\n\t\tunit: 'hour'\r\n\t},\r\n\t{\r\n\t\tthreshold: (20.5 / 24) * day,\r\n\t\tfactor: day,\r\n\t\tunit: 'day'\r\n\t},\r\n\t{\r\n\t\tthreshold: 5.5 * day,\r\n\t\tfactor: 7 * day,\r\n\t\tunit: 'week'\r\n\t},\r\n\t{\r\n\t\tthreshold: 3.5 * 7 * day,\r\n\t\tfactor: month,\r\n\t\tunit: 'month'\r\n\t},\r\n\t{\r\n\t\tthreshold: 10.5 * month,\r\n\t\tfactor: year,\r\n\t\tunit: 'year'\r\n\t}\r\n]"],"file":"convenient.js"}
|
||||
37
node_modules/javascript-time-ago/commonjs/gradation/convenient.test.js
generated
vendored
Normal file
37
node_modules/javascript-time-ago/commonjs/gradation/convenient.test.js
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
"use strict";
|
||||
|
||||
var _grade = _interopRequireDefault(require("../grade"));
|
||||
|
||||
var _convenient = _interopRequireDefault(require("./convenient"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
// Perhaps this should be part of `grade.test.js` instead.
|
||||
describe('convenient gradation', function () {
|
||||
it('should grade correctly', function () {
|
||||
var test = function test(elapsed) {
|
||||
return (0, _grade.default)(elapsed, null, ['second', 'minute', 'hour', 'day', 'month', 'year'], _convenient.default);
|
||||
};
|
||||
|
||||
expect(test(0)).to.be.undefined;
|
||||
expect(test(1).unit).to.equal('second');
|
||||
expect(test(1).factor).to.equal(1);
|
||||
expect(test(44).unit).to.equal('second');
|
||||
expect(test(44).factor).to.equal(1);
|
||||
expect(test(45).unit).to.equal('minute');
|
||||
expect(test(45).factor).to.equal(60);
|
||||
expect(test(45).granularity).to.be.undefined;
|
||||
expect(test(2.5 * 60 - 1).unit).to.equal('minute');
|
||||
expect(test(2.5 * 60 - 1).factor).to.equal(60);
|
||||
expect(test(2.5 * 60 - 1).granularity).to.be.undefined;
|
||||
expect(test(2.5 * 60).unit).to.equal('minute');
|
||||
expect(test(2.5 * 60).factor).to.equal(60);
|
||||
expect(test(2.5 * 60).granularity).to.equal(5);
|
||||
expect(test(52.5 * 60 - 1).unit).to.equal('minute');
|
||||
expect(test(52.5 * 60 - 1).factor).to.equal(60);
|
||||
expect(test(52.5 * 60 - 1).granularity).to.equal(5);
|
||||
expect(test(52.5 * 60).unit).to.equal('hour');
|
||||
expect(test(52.5 * 60).factor).to.equal(60 * 60);
|
||||
});
|
||||
});
|
||||
//# sourceMappingURL=convenient.test.js.map
|
||||
1
node_modules/javascript-time-ago/commonjs/gradation/convenient.test.js.map
generated
vendored
Normal file
1
node_modules/javascript-time-ago/commonjs/gradation/convenient.test.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../source/gradation/convenient.test.js"],"names":["describe","it","test","elapsed","gradation","expect","to","be","undefined","unit","equal","factor","granularity"],"mappings":";;AAAA;;AACA;;;;AAEA;AAEAA,QAAQ,CAAC,sBAAD,EAAyB,YACjC;AACCC,EAAAA,EAAE,CAAC,wBAAD,EAA2B,YAC7B;AACC,QAAMC,IAAI,GAAG,SAAPA,IAAO,CAACC,OAAD;AAAA,aAAa,oBAAMA,OAAN,EAAe,IAAf,EAAqB,CAC9C,QAD8C,EAE9C,QAF8C,EAG9C,MAH8C,EAI9C,KAJ8C,EAK9C,OAL8C,EAM9C,MAN8C,CAArB,EAOvBC,mBAPuB,CAAb;AAAA,KAAb;;AASAC,IAAAA,MAAM,CAACH,IAAI,CAAC,CAAD,CAAL,CAAN,CAAgBI,EAAhB,CAAmBC,EAAnB,CAAsBC,SAAtB;AAEAH,IAAAA,MAAM,CAACH,IAAI,CAAC,CAAD,CAAJ,CAAQO,IAAT,CAAN,CAAqBH,EAArB,CAAwBI,KAAxB,CAA8B,QAA9B;AACAL,IAAAA,MAAM,CAACH,IAAI,CAAC,CAAD,CAAJ,CAAQS,MAAT,CAAN,CAAuBL,EAAvB,CAA0BI,KAA1B,CAAgC,CAAhC;AAEAL,IAAAA,MAAM,CAACH,IAAI,CAAC,EAAD,CAAJ,CAASO,IAAV,CAAN,CAAsBH,EAAtB,CAAyBI,KAAzB,CAA+B,QAA/B;AACAL,IAAAA,MAAM,CAACH,IAAI,CAAC,EAAD,CAAJ,CAASS,MAAV,CAAN,CAAwBL,EAAxB,CAA2BI,KAA3B,CAAiC,CAAjC;AAEAL,IAAAA,MAAM,CAACH,IAAI,CAAC,EAAD,CAAJ,CAASO,IAAV,CAAN,CAAsBH,EAAtB,CAAyBI,KAAzB,CAA+B,QAA/B;AACAL,IAAAA,MAAM,CAACH,IAAI,CAAC,EAAD,CAAJ,CAASS,MAAV,CAAN,CAAwBL,EAAxB,CAA2BI,KAA3B,CAAiC,EAAjC;AACAL,IAAAA,MAAM,CAACH,IAAI,CAAC,EAAD,CAAJ,CAASU,WAAV,CAAN,CAA6BN,EAA7B,CAAgCC,EAAhC,CAAmCC,SAAnC;AAEAH,IAAAA,MAAM,CAACH,IAAI,CAAC,MAAM,EAAN,GAAW,CAAZ,CAAJ,CAAmBO,IAApB,CAAN,CAAgCH,EAAhC,CAAmCI,KAAnC,CAAyC,QAAzC;AACAL,IAAAA,MAAM,CAACH,IAAI,CAAC,MAAM,EAAN,GAAW,CAAZ,CAAJ,CAAmBS,MAApB,CAAN,CAAkCL,EAAlC,CAAqCI,KAArC,CAA2C,EAA3C;AACAL,IAAAA,MAAM,CAACH,IAAI,CAAC,MAAM,EAAN,GAAW,CAAZ,CAAJ,CAAmBU,WAApB,CAAN,CAAuCN,EAAvC,CAA0CC,EAA1C,CAA6CC,SAA7C;AAEAH,IAAAA,MAAM,CAACH,IAAI,CAAC,MAAM,EAAP,CAAJ,CAAeO,IAAhB,CAAN,CAA4BH,EAA5B,CAA+BI,KAA/B,CAAqC,QAArC;AACAL,IAAAA,MAAM,CAACH,IAAI,CAAC,MAAM,EAAP,CAAJ,CAAeS,MAAhB,CAAN,CAA8BL,EAA9B,CAAiCI,KAAjC,CAAuC,EAAvC;AACAL,IAAAA,MAAM,CAACH,IAAI,CAAC,MAAM,EAAP,CAAJ,CAAeU,WAAhB,CAAN,CAAmCN,EAAnC,CAAsCI,KAAtC,CAA4C,CAA5C;AAEAL,IAAAA,MAAM,CAACH,IAAI,CAAC,OAAO,EAAP,GAAY,CAAb,CAAJ,CAAoBO,IAArB,CAAN,CAAiCH,EAAjC,CAAoCI,KAApC,CAA0C,QAA1C;AACAL,IAAAA,MAAM,CAACH,IAAI,CAAC,OAAO,EAAP,GAAY,CAAb,CAAJ,CAAoBS,MAArB,CAAN,CAAmCL,EAAnC,CAAsCI,KAAtC,CAA4C,EAA5C;AACAL,IAAAA,MAAM,CAACH,IAAI,CAAC,OAAO,EAAP,GAAY,CAAb,CAAJ,CAAoBU,WAArB,CAAN,CAAwCN,EAAxC,CAA2CI,KAA3C,CAAiD,CAAjD;AAEAL,IAAAA,MAAM,CAACH,IAAI,CAAC,OAAO,EAAR,CAAJ,CAAgBO,IAAjB,CAAN,CAA6BH,EAA7B,CAAgCI,KAAhC,CAAsC,MAAtC;AACAL,IAAAA,MAAM,CAACH,IAAI,CAAC,OAAO,EAAR,CAAJ,CAAgBS,MAAjB,CAAN,CAA+BL,EAA/B,CAAkCI,KAAlC,CAAwC,KAAK,EAA7C;AACA,GArCC,CAAF;AAsCA,CAxCO,CAAR","sourcesContent":["import grade from '../grade'\r\nimport gradation from './convenient'\r\n\r\n// Perhaps this should be part of `grade.test.js` instead.\r\n\r\ndescribe('convenient gradation', () =>\r\n{\r\n\tit('should grade correctly', () =>\r\n\t{\r\n\t\tconst test = (elapsed) => grade(elapsed, null, [\r\n\t\t\t'second',\r\n\t\t\t'minute',\r\n\t\t\t'hour',\r\n\t\t\t'day',\r\n\t\t\t'month',\r\n\t\t\t'year'\r\n\t\t], gradation)\r\n\r\n\t\texpect(test(0)).to.be.undefined\r\n\r\n\t\texpect(test(1).unit).to.equal('second')\r\n\t\texpect(test(1).factor).to.equal(1)\r\n\r\n\t\texpect(test(44).unit).to.equal('second')\r\n\t\texpect(test(44).factor).to.equal(1)\r\n\r\n\t\texpect(test(45).unit).to.equal('minute')\r\n\t\texpect(test(45).factor).to.equal(60)\r\n\t\texpect(test(45).granularity).to.be.undefined\r\n\r\n\t\texpect(test(2.5 * 60 - 1).unit).to.equal('minute')\r\n\t\texpect(test(2.5 * 60 - 1).factor).to.equal(60)\r\n\t\texpect(test(2.5 * 60 - 1).granularity).to.be.undefined\r\n\r\n\t\texpect(test(2.5 * 60).unit).to.equal('minute')\r\n\t\texpect(test(2.5 * 60).factor).to.equal(60)\r\n\t\texpect(test(2.5 * 60).granularity).to.equal(5)\r\n\r\n\t\texpect(test(52.5 * 60 - 1).unit).to.equal('minute')\r\n\t\texpect(test(52.5 * 60 - 1).factor).to.equal(60)\r\n\t\texpect(test(52.5 * 60 - 1).granularity).to.equal(5)\r\n\r\n\t\texpect(test(52.5 * 60).unit).to.equal('hour')\r\n\t\texpect(test(52.5 * 60).factor).to.equal(60 * 60)\r\n\t})\r\n})"],"file":"convenient.test.js"}
|
||||
64
node_modules/javascript-time-ago/commonjs/gradation/helpers.js
generated
vendored
Normal file
64
node_modules/javascript-time-ago/commonjs/gradation/helpers.js
generated
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.getStep = getStep;
|
||||
exports.getDate = getDate;
|
||||
exports.year = exports.month = exports.day = exports.hour = exports.minute = void 0;
|
||||
var minute = 60; // in seconds
|
||||
|
||||
exports.minute = minute;
|
||||
var hour = 60 * minute; // in seconds
|
||||
|
||||
exports.hour = hour;
|
||||
var day = 24 * hour; // in seconds
|
||||
// https://www.quora.com/What-is-the-average-number-of-days-in-a-month
|
||||
|
||||
exports.day = day;
|
||||
var month = 30.44 * day; // in seconds
|
||||
// "400 years have 146097 days (taking into account leap year rules)"
|
||||
|
||||
exports.month = month;
|
||||
var year = 146097 / 400 * day; // in seconds
|
||||
|
||||
/**
|
||||
* Returns a step of gradation corresponding to the unit.
|
||||
* @param {Object[]} gradation
|
||||
* @param {string} unit
|
||||
* @return {?Object}
|
||||
*/
|
||||
|
||||
exports.year = year;
|
||||
|
||||
function getStep(gradation, unit) {
|
||||
for (var _iterator = gradation, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
|
||||
var _ref;
|
||||
|
||||
if (_isArray) {
|
||||
if (_i >= _iterator.length) break;
|
||||
_ref = _iterator[_i++];
|
||||
} else {
|
||||
_i = _iterator.next();
|
||||
if (_i.done) break;
|
||||
_ref = _i.value;
|
||||
}
|
||||
|
||||
var step = _ref;
|
||||
|
||||
if (step.unit === unit) {
|
||||
return step;
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Converts value to a `Date`
|
||||
* @param {(number|Date)} value
|
||||
* @return {Date}
|
||||
*/
|
||||
|
||||
|
||||
function getDate(value) {
|
||||
return value instanceof Date ? value : new Date(value);
|
||||
}
|
||||
//# sourceMappingURL=helpers.js.map
|
||||
1
node_modules/javascript-time-ago/commonjs/gradation/helpers.js.map
generated
vendored
Normal file
1
node_modules/javascript-time-ago/commonjs/gradation/helpers.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../source/gradation/helpers.js"],"names":["minute","hour","day","month","year","getStep","gradation","unit","step","getDate","value","Date"],"mappings":";;;;;;;;AAAO,IAAMA,MAAM,GAAG,EAAf,C,CAAkB;;;AAElB,IAAMC,IAAI,GAAG,KAAKD,MAAlB,C,CAAyB;;;AAEzB,IAAME,GAAG,GAAG,KAAKD,IAAjB,C,CAAsB;AAE7B;;;AACO,IAAME,KAAK,GAAG,QAAQD,GAAtB,C,CAA0B;AAEjC;;;AACO,IAAME,IAAI,GAAI,SAAS,GAAV,GAAiBF,GAA9B,C,CAAkC;;AAEzC;;;;;;;;;AAMO,SAASG,OAAT,CAAiBC,SAAjB,EAA4BC,IAA5B,EAAkC;AACxC,uBAAmBD,SAAnB,kHAA8B;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA,QAAnBE,IAAmB;;AAC7B,QAAIA,IAAI,CAACD,IAAL,KAAcA,IAAlB,EAAwB;AACvB,aAAOC,IAAP;AACA;AACD;AACD;AAED;;;;;;;AAKO,SAASC,OAAT,CAAiBC,KAAjB,EAAwB;AAC9B,SAAOA,KAAK,YAAYC,IAAjB,GAAwBD,KAAxB,GAAgC,IAAIC,IAAJ,CAASD,KAAT,CAAvC;AACA","sourcesContent":["export const minute = 60 // in seconds\r\n\r\nexport const hour = 60 * minute // in seconds\r\n\r\nexport const day = 24 * hour // in seconds\r\n\r\n// https://www.quora.com/What-is-the-average-number-of-days-in-a-month\r\nexport const month = 30.44 * day // in seconds\r\n\r\n// \"400 years have 146097 days (taking into account leap year rules)\"\r\nexport const year = (146097 / 400) * day // in seconds\r\n\r\n/**\r\n * Returns a step of gradation corresponding to the unit.\r\n * @param {Object[]} gradation\r\n * @param {string} unit\r\n * @return {?Object}\r\n */\r\nexport function getStep(gradation, unit) {\r\n\tfor (const step of gradation) {\r\n\t\tif (step.unit === unit) {\r\n\t\t\treturn step\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Converts value to a `Date`\r\n * @param {(number|Date)} value\r\n * @return {Date}\r\n */\r\nexport function getDate(value) {\r\n\treturn value instanceof Date ? value : new Date(value)\r\n}"],"file":"helpers.js"}
|
||||
12
node_modules/javascript-time-ago/commonjs/gradation/helpers.test.js
generated
vendored
Normal file
12
node_modules/javascript-time-ago/commonjs/gradation/helpers.test.js
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
"use strict";
|
||||
|
||||
var _helpers = require("./helpers");
|
||||
|
||||
describe('gradation helpers', function () {
|
||||
it('should convert value to Date', function () {
|
||||
var today = new Date();
|
||||
(0, _helpers.getDate)(today.getTime()).getTime().should.equal(today.getTime());
|
||||
(0, _helpers.getDate)(today).getTime().should.equal(today.getTime());
|
||||
});
|
||||
});
|
||||
//# sourceMappingURL=helpers.test.js.map
|
||||
1
node_modules/javascript-time-ago/commonjs/gradation/helpers.test.js.map
generated
vendored
Normal file
1
node_modules/javascript-time-ago/commonjs/gradation/helpers.test.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../source/gradation/helpers.test.js"],"names":["describe","it","today","Date","getTime","should","equal"],"mappings":";;AAAA;;AAEAA,QAAQ,CAAC,mBAAD,EAAsB,YAC9B;AACCC,EAAAA,EAAE,CAAC,8BAAD,EAAiC,YACnC;AACC,QAAMC,KAAK,GAAG,IAAIC,IAAJ,EAAd;AACA,0BAAQD,KAAK,CAACE,OAAN,EAAR,EAAyBA,OAAzB,GAAmCC,MAAnC,CAA0CC,KAA1C,CAAgDJ,KAAK,CAACE,OAAN,EAAhD;AACA,0BAAQF,KAAR,EAAeE,OAAf,GAAyBC,MAAzB,CAAgCC,KAAhC,CAAsCJ,KAAK,CAACE,OAAN,EAAtC;AACA,GALC,CAAF;AAMA,CARO,CAAR","sourcesContent":["import { getDate } from './helpers'\r\n\r\ndescribe('gradation helpers', () =>\r\n{\r\n\tit('should convert value to Date', () =>\r\n\t{\r\n\t\tconst today = new Date()\r\n\t\tgetDate(today.getTime()).getTime().should.equal(today.getTime())\r\n\t\tgetDate(today).getTime().should.equal(today.getTime())\r\n\t})\r\n})"],"file":"helpers.test.js"}
|
||||
68
node_modules/javascript-time-ago/commonjs/gradation/index.js
generated
vendored
Normal file
68
node_modules/javascript-time-ago/commonjs/gradation/index.js
generated
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "canonical", {
|
||||
enumerable: true,
|
||||
get: function get() {
|
||||
return _canonical.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "convenient", {
|
||||
enumerable: true,
|
||||
get: function get() {
|
||||
return _convenient.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "minute", {
|
||||
enumerable: true,
|
||||
get: function get() {
|
||||
return _helpers.minute;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "hour", {
|
||||
enumerable: true,
|
||||
get: function get() {
|
||||
return _helpers.hour;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "day", {
|
||||
enumerable: true,
|
||||
get: function get() {
|
||||
return _helpers.day;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "month", {
|
||||
enumerable: true,
|
||||
get: function get() {
|
||||
return _helpers.month;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "year", {
|
||||
enumerable: true,
|
||||
get: function get() {
|
||||
return _helpers.year;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "getStep", {
|
||||
enumerable: true,
|
||||
get: function get() {
|
||||
return _helpers.getStep;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "getDate", {
|
||||
enumerable: true,
|
||||
get: function get() {
|
||||
return _helpers.getDate;
|
||||
}
|
||||
});
|
||||
|
||||
var _canonical = _interopRequireDefault(require("./canonical"));
|
||||
|
||||
var _convenient = _interopRequireDefault(require("./convenient"));
|
||||
|
||||
var _helpers = require("./helpers");
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
node_modules/javascript-time-ago/commonjs/gradation/index.js.map
generated
vendored
Normal file
1
node_modules/javascript-time-ago/commonjs/gradation/index.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../source/gradation/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA;;AACA;;AACA","sourcesContent":["// A gradation is a mapping from a time interval (in seconds)\r\n// to the most appropriate time interval measurement unit\r\n// for describing it, along with the amount of such units.\r\n//\r\n// E.g. for \"canonical\" gradation:\r\n//\r\n// 0 -> 1 'now'\r\n// 0.5 -> 1 'second'\r\n// 60 -> 1 'minute'\r\n// 91 -> 2 'minute's\r\n// ...\r\n//\r\n// Each gradation unit can have:\r\n//\r\n// * unit - (required) The name of the time interval measurement unit.\r\n//\r\n// * factor - (required) The amount of seconds will be divided by this number for this unit.\r\n//\r\n// * granularity - A step for the unit's resulting \"amount\" value.\r\n//\r\n// * threshold - Min value (in seconds) for this unit. Is required for non-first unit.\r\n//\r\n// * threshold_for_[unit] - A specific threshold required for moving from `[unit]` to this unit.\r\n// E.g. if \"now\" unit is present in time units gradation\r\n// then `threshold_for_now` can be set to `45` seconds.\r\n// Otherwise, if \"now\" unit is omitted from time units gradation,\r\n// then `elapsed(0)` will output \"0 seconds\" because there's no `threshold`.\r\n//\r\n// A user can supply his own gradation.\r\n//\r\n// Don't name a gradation \"default\"\r\n// because that would conflict with the\r\n// CommonJS \"interoperability\" export layer.\r\n//\r\nexport { default as canonical } from './canonical'\r\nexport { default as convenient } from './convenient'\r\nexport { minute, hour, day, month, year, getStep, getDate } from './helpers'"],"file":"index.js"}
|
||||
164
node_modules/javascript-time-ago/commonjs/grade.js
generated
vendored
Normal file
164
node_modules/javascript-time-ago/commonjs/grade.js
generated
vendored
Normal file
@@ -0,0 +1,164 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = grade;
|
||||
|
||||
var _gradation = require("./gradation");
|
||||
|
||||
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||
|
||||
/**
|
||||
* Takes seconds `elapsed` and measures them against
|
||||
* `gradation` to return the suitable `gradation` step.
|
||||
*
|
||||
* @param {number} elapsed - Time interval (in seconds). Is < 0 for past dates and > 0 for future dates.
|
||||
*
|
||||
* @param {string[]} units - A list of allowed time units
|
||||
* (e.g. ['second', 'minute', 'hour', …])
|
||||
*
|
||||
* @param {Object} [gradation] - Time scale gradation steps.
|
||||
*
|
||||
* E.g.:
|
||||
* [
|
||||
* { unit: 'second', factor: 1 },
|
||||
* { unit: 'minute', factor: 60, threshold: 60 },
|
||||
* { format(), threshold: 24 * 60 * 60 },
|
||||
* …
|
||||
* ]
|
||||
*
|
||||
* @return {?Object} `gradation` step.
|
||||
*/
|
||||
function grade(elapsed, now, units) {
|
||||
var gradation = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : _gradation.convenient;
|
||||
// Leave only allowed time measurement units.
|
||||
// E.g. omit "quarter" unit.
|
||||
gradation = getAllowedSteps(gradation, units); // If no steps of gradation fit the conditions
|
||||
// then return nothing.
|
||||
|
||||
if (gradation.length === 0) {
|
||||
return;
|
||||
} // Find the most appropriate gradation step
|
||||
|
||||
|
||||
var i = findGradationStep(elapsed, now, gradation);
|
||||
var step = gradation[i]; // If time elapsed is too small and even
|
||||
// the first gradation step doesn't suit it
|
||||
// then return nothing.
|
||||
|
||||
if (i === -1) {
|
||||
return;
|
||||
} // Apply granularity to the time amount
|
||||
// (and fall back to the previous step
|
||||
// if the first level of granularity
|
||||
// isn't met by this amount)
|
||||
|
||||
|
||||
if (step.granularity) {
|
||||
// Recalculate the elapsed time amount based on granularity
|
||||
var amount = Math.round(Math.abs(elapsed) / step.factor / step.granularity) * step.granularity; // If the granularity for this step
|
||||
// is too high, then fallback
|
||||
// to the previous step of gradation.
|
||||
// (if there is any previous step of gradation)
|
||||
|
||||
if (amount === 0 && i > 0) {
|
||||
return gradation[i - 1];
|
||||
}
|
||||
}
|
||||
|
||||
return step;
|
||||
}
|
||||
/**
|
||||
* Gets threshold for moving from `fromStep` to `next_step`.
|
||||
* @param {Object} fromStep - From step.
|
||||
* @param {Object} next_step - To step.
|
||||
* @param {number} now - The current timestamp.
|
||||
* @param {boolean} future - Is `true` for future dates ("in 5 minutes").
|
||||
* @return {number}
|
||||
* @throws Will throw if no threshold is found.
|
||||
*/
|
||||
|
||||
|
||||
function getThreshold(fromStep, toStep, now, future) {
|
||||
var threshold; // Allows custom thresholds when moving
|
||||
// from a specific step to a specific step.
|
||||
|
||||
if (fromStep && (fromStep.id || fromStep.unit)) {
|
||||
threshold = toStep["threshold_for_".concat(fromStep.id || fromStep.unit)];
|
||||
} // If no custom threshold is set for this transition
|
||||
// then use the usual threshold for the next step.
|
||||
|
||||
|
||||
if (threshold === undefined) {
|
||||
threshold = toStep.threshold;
|
||||
} // Convert threshold to a number.
|
||||
|
||||
|
||||
if (typeof threshold === 'function') {
|
||||
threshold = threshold(now, future);
|
||||
} // Throw if no threshold is found.
|
||||
|
||||
|
||||
if (fromStep && typeof threshold !== 'number') {
|
||||
// Babel transforms `typeof` into some "branches"
|
||||
// so istanbul will show this as "branch not covered".
|
||||
|
||||
/* istanbul ignore next */
|
||||
var type = _typeof(threshold);
|
||||
|
||||
throw new Error("Each step of a gradation must have a threshold defined except for the first one. Got \"".concat(threshold, "\", ").concat(type, ". Step: ").concat(JSON.stringify(toStep)));
|
||||
}
|
||||
|
||||
return threshold;
|
||||
}
|
||||
/**
|
||||
* @param {number} elapsed - Time elapsed (in seconds).
|
||||
* @param {number} now - Current timestamp.
|
||||
* @param {Object} gradation - Gradation.
|
||||
* @param {number} i - Gradation step currently being tested.
|
||||
* @return {number} Gradation step index.
|
||||
*/
|
||||
|
||||
|
||||
function findGradationStep(elapsed, now, gradation) {
|
||||
var i = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
||||
|
||||
// If the threshold for moving from previous step
|
||||
// to this step is too high then return the previous step.
|
||||
if (Math.abs(elapsed) < getThreshold(gradation[i - 1], gradation[i], now, elapsed < 0)) {
|
||||
return i - 1;
|
||||
} // If it's the last step of gradation then return it.
|
||||
|
||||
|
||||
if (i === gradation.length - 1) {
|
||||
return i;
|
||||
} // Move to the next step.
|
||||
|
||||
|
||||
return findGradationStep(elapsed, now, gradation, i + 1);
|
||||
}
|
||||
/**
|
||||
* Leaves only allowed gradation steps.
|
||||
* @param {Object[]} gradation
|
||||
* @param {string[]} units - Allowed time units.
|
||||
* @return {Object[]}
|
||||
*/
|
||||
|
||||
|
||||
function getAllowedSteps(gradation, units) {
|
||||
return gradation.filter(function (_ref) {
|
||||
var unit = _ref.unit;
|
||||
|
||||
// If this step has a `unit` defined
|
||||
// then this `unit` must be in the list of `units` allowed.
|
||||
if (unit) {
|
||||
return units.indexOf(unit) >= 0;
|
||||
} // A gradation step is not required to specify a `unit`.
|
||||
// E.g. for Twitter gradation it specifies `format()` instead.
|
||||
|
||||
|
||||
return true;
|
||||
});
|
||||
}
|
||||
//# sourceMappingURL=grade.js.map
|
||||
1
node_modules/javascript-time-ago/commonjs/grade.js.map
generated
vendored
Normal file
1
node_modules/javascript-time-ago/commonjs/grade.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
38
node_modules/javascript-time-ago/commonjs/grade.test.js
generated
vendored
Normal file
38
node_modules/javascript-time-ago/commonjs/grade.test.js
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
"use strict";
|
||||
|
||||
var _grade = _interopRequireDefault(require("../source/grade"));
|
||||
|
||||
var _gradation = require("../source/gradation");
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
describe('grade', function () {
|
||||
it('should return nothing if no time units are applicable', function () {
|
||||
expect((0, _grade.default)(0, null, ['femtosecond'], _gradation.canonical)).to.be.undefined;
|
||||
});
|
||||
it('should throw if a non-first step does not have a threshold', function () {
|
||||
expect((0, _grade.default)(2, null, ['second'], [{
|
||||
unit: 'second'
|
||||
}])).to.deep.equal({
|
||||
unit: 'second'
|
||||
});
|
||||
expect(function () {
|
||||
(0, _grade.default)(2, null, ['second', 'minute'], [{
|
||||
unit: 'second'
|
||||
}, {
|
||||
unit: 'minute'
|
||||
}]);
|
||||
}).to.throw('Each step of a gradation must have a threshold defined except for the first one. Got "undefined", undefined. Step: {"unit":"minute"}');
|
||||
});
|
||||
it('should fall back to previous grading scale step if granularity is too high', function () {
|
||||
var gradation = _gradation.canonical.slice();
|
||||
|
||||
gradation[1].unit.should.equal('second');
|
||||
gradation[1].granularity = 3;
|
||||
(0, _grade.default)(1.49, null, ['now', 'second'], gradation).unit.should.equal('now'); // And if there's no previous step, then use the current one.
|
||||
|
||||
gradation.splice(0, 1);
|
||||
(0, _grade.default)(1.49, null, ['now', 'second'], gradation).unit.should.equal('second');
|
||||
});
|
||||
});
|
||||
//# sourceMappingURL=grade.test.js.map
|
||||
1
node_modules/javascript-time-ago/commonjs/grade.test.js.map
generated
vendored
Normal file
1
node_modules/javascript-time-ago/commonjs/grade.test.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../source/grade.test.js"],"names":["describe","it","expect","canonical","to","be","undefined","unit","deep","equal","throw","gradation","slice","should","granularity","splice"],"mappings":";;AAAA;;AACA;;;;AAEAA,QAAQ,CAAC,OAAD,EAAU,YAClB;AACCC,EAAAA,EAAE,CAAC,uDAAD,EAA0D,YAC5D;AACCC,IAAAA,MAAM,CAAC,oBAAM,CAAN,EAAS,IAAT,EAAe,CAAC,aAAD,CAAf,EAAgCC,oBAAhC,CAAD,CAAN,CAAmDC,EAAnD,CAAsDC,EAAtD,CAAyDC,SAAzD;AACA,GAHC,CAAF;AAKAL,EAAAA,EAAE,CAAC,4DAAD,EAA+D,YACjE;AACCC,IAAAA,MAAM,CAAC,oBAAM,CAAN,EAAS,IAAT,EAAe,CAAC,QAAD,CAAf,EAA2B,CAAC;AAAEK,MAAAA,IAAI,EAAE;AAAR,KAAD,CAA3B,CAAD,CAAN,CAAyDH,EAAzD,CAA4DI,IAA5D,CAAiEC,KAAjE,CAAuE;AAAEF,MAAAA,IAAI,EAAE;AAAR,KAAvE;AAEAL,IAAAA,MAAM,CAAC,YAAM;AACZ,0BAAM,CAAN,EAAS,IAAT,EAAe,CAAC,QAAD,EAAW,QAAX,CAAf,EAAqC,CAAC;AAAEK,QAAAA,IAAI,EAAE;AAAR,OAAD,EAAqB;AAAEA,QAAAA,IAAI,EAAE;AAAR,OAArB,CAArC;AACA,KAFK,CAAN,CAEGH,EAFH,CAEMM,KAFN,CAGC,sIAHD;AAKA,GATC,CAAF;AAWAT,EAAAA,EAAE,CAAC,4EAAD,EAA+E,YACjF;AACC,QAAMU,SAAS,GAAGR,qBAAUS,KAAV,EAAlB;;AAEAD,IAAAA,SAAS,CAAC,CAAD,CAAT,CAAaJ,IAAb,CAAkBM,MAAlB,CAAyBJ,KAAzB,CAA+B,QAA/B;AACAE,IAAAA,SAAS,CAAC,CAAD,CAAT,CAAaG,WAAb,GAA2B,CAA3B;AAEA,wBAAM,IAAN,EAAY,IAAZ,EAAkB,CAAC,KAAD,EAAQ,QAAR,CAAlB,EAAqCH,SAArC,EAAgDJ,IAAhD,CAAqDM,MAArD,CAA4DJ,KAA5D,CAAkE,KAAlE,EAND,CAQC;;AAEAE,IAAAA,SAAS,CAACI,MAAV,CAAiB,CAAjB,EAAoB,CAApB;AAEA,wBAAM,IAAN,EAAY,IAAZ,EAAkB,CAAC,KAAD,EAAQ,QAAR,CAAlB,EAAqCJ,SAArC,EAAgDJ,IAAhD,CAAqDM,MAArD,CAA4DJ,KAA5D,CAAkE,QAAlE;AACA,GAdC,CAAF;AAeA,CAjCO,CAAR","sourcesContent":["import grade from '../source/grade'\r\nimport { canonical } from '../source/gradation'\r\n\r\ndescribe('grade', () =>\r\n{\r\n\tit('should return nothing if no time units are applicable', () =>\r\n\t{\r\n\t\texpect(grade(0, null, ['femtosecond'], canonical)).to.be.undefined\r\n\t})\r\n\r\n\tit('should throw if a non-first step does not have a threshold', () =>\r\n\t{\r\n\t\texpect(grade(2, null, ['second'], [{ unit: 'second' }])).to.deep.equal({ unit: 'second' })\r\n\r\n\t\texpect(() => {\r\n\t\t\tgrade(2, null, ['second', 'minute'], [{ unit: 'second' }, { unit: 'minute' }])\r\n\t\t}).to.throw(\r\n\t\t\t'Each step of a gradation must have a threshold defined except for the first one. Got \"undefined\", undefined. Step: {\"unit\":\"minute\"}'\r\n\t\t)\r\n\t})\r\n\r\n\tit('should fall back to previous grading scale step if granularity is too high', () =>\r\n\t{\r\n\t\tconst gradation = canonical.slice()\r\n\r\n\t\tgradation[1].unit.should.equal('second')\r\n\t\tgradation[1].granularity = 3\r\n\r\n\t\tgrade(1.49, null, ['now', 'second'], gradation).unit.should.equal('now')\r\n\r\n\t\t// And if there's no previous step, then use the current one.\r\n\r\n\t\tgradation.splice(0, 1)\r\n\r\n\t\tgrade(1.49, null, ['now', 'second'], gradation).unit.should.equal('second')\r\n\t})\r\n})"],"file":"grade.test.js"}
|
||||
89
node_modules/javascript-time-ago/commonjs/locale.js
generated
vendored
Normal file
89
node_modules/javascript-time-ago/commonjs/locale.js
generated
vendored
Normal file
@@ -0,0 +1,89 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = chooseLocale;
|
||||
exports.intlDateTimeFormatSupportedLocale = intlDateTimeFormatSupportedLocale;
|
||||
exports.intlDateTimeFormatSupported = intlDateTimeFormatSupported;
|
||||
|
||||
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||
|
||||
// Chooses the most appropriate locale
|
||||
// (one of the registered ones)
|
||||
// based on the list of preferred `locales` supplied by the user.
|
||||
//
|
||||
// @param {string[]} locales - the list of preferable locales (in [IETF format](https://en.wikipedia.org/wiki/IETF_language_tag)).
|
||||
// @param {Function} isLocaleDataAvailable - tests if a locale is available.
|
||||
//
|
||||
// @returns {string} The most suitable locale
|
||||
//
|
||||
// @example
|
||||
// // Returns 'en'
|
||||
// chooseLocale(['en-US'], undefined, (locale) => locale === 'ru' || locale === 'en')
|
||||
//
|
||||
function chooseLocale(locales, isLocaleDataAvailable) {
|
||||
// This is not an intelligent algorithm,
|
||||
// but it will do for this library's case.
|
||||
// `sr-Cyrl-BA` -> `sr-Cyrl` -> `sr`.
|
||||
for (var _iterator = locales, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
|
||||
var _ref;
|
||||
|
||||
if (_isArray) {
|
||||
if (_i >= _iterator.length) break;
|
||||
_ref = _iterator[_i++];
|
||||
} else {
|
||||
_i = _iterator.next();
|
||||
if (_i.done) break;
|
||||
_ref = _i.value;
|
||||
}
|
||||
|
||||
var locale = _ref;
|
||||
|
||||
if (isLocaleDataAvailable(locale)) {
|
||||
return locale;
|
||||
}
|
||||
|
||||
var parts = locale.split('-');
|
||||
|
||||
while (parts.length > 1) {
|
||||
parts.pop();
|
||||
locale = parts.join('-');
|
||||
|
||||
if (isLocaleDataAvailable(locale)) {
|
||||
return locale;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
throw new Error("No locale data has been registered for any of the locales: ".concat(locales.join(', ')));
|
||||
}
|
||||
/**
|
||||
* Whether can use `Intl.DateTimeFormat` for these `locales`.
|
||||
* Returns the first suitable one.
|
||||
* @param {(string|string[])} locales
|
||||
* @return {?string} The first locale that can be used.
|
||||
*/
|
||||
|
||||
|
||||
function intlDateTimeFormatSupportedLocale(locales) {
|
||||
/* istanbul ignore else */
|
||||
if (intlDateTimeFormatSupported()) {
|
||||
return Intl.DateTimeFormat.supportedLocalesOf(locales)[0];
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Whether can use `Intl.DateTimeFormat`.
|
||||
* @return {boolean}
|
||||
*/
|
||||
|
||||
|
||||
function intlDateTimeFormatSupported() {
|
||||
// Babel transforms `typeof` into some "branches"
|
||||
// so istanbul will show this as "branch not covered".
|
||||
|
||||
/* istanbul ignore next */
|
||||
var isIntlAvailable = (typeof Intl === "undefined" ? "undefined" : _typeof(Intl)) === 'object';
|
||||
return isIntlAvailable && typeof Intl.DateTimeFormat === 'function';
|
||||
}
|
||||
//# sourceMappingURL=locale.js.map
|
||||
1
node_modules/javascript-time-ago/commonjs/locale.js.map
generated
vendored
Normal file
1
node_modules/javascript-time-ago/commonjs/locale.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../source/locale.js"],"names":["chooseLocale","locales","isLocaleDataAvailable","locale","parts","split","length","pop","join","Error","intlDateTimeFormatSupportedLocale","intlDateTimeFormatSupported","Intl","DateTimeFormat","supportedLocalesOf","isIntlAvailable"],"mappings":";;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,YAAT,CAAsBC,OAAtB,EAA+BC,qBAA/B,EACf;AACC;AACA;AACA;AACA,uBAAmBD,OAAnB,kHAA4B;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA,QAAnBE,MAAmB;;AAC3B,QAAID,qBAAqB,CAACC,MAAD,CAAzB,EAAmC;AAClC,aAAOA,MAAP;AACA;;AACD,QAAMC,KAAK,GAAGD,MAAM,CAACE,KAAP,CAAa,GAAb,CAAd;;AACA,WAAOD,KAAK,CAACE,MAAN,GAAe,CAAtB,EAAyB;AACxBF,MAAAA,KAAK,CAACG,GAAN;AACAJ,MAAAA,MAAM,GAAGC,KAAK,CAACI,IAAN,CAAW,GAAX,CAAT;;AACA,UAAIN,qBAAqB,CAACC,MAAD,CAAzB,EAAmC;AAClC,eAAOA,MAAP;AACA;AACD;AACD;;AAED,QAAM,IAAIM,KAAJ,sEAAwER,OAAO,CAACO,IAAR,CAAa,IAAb,CAAxE,EAAN;AACA;AAED;;;;;;;;AAMO,SAASE,iCAAT,CAA2CT,OAA3C,EAAoD;AAC1D;AACA,MAAIU,2BAA2B,EAA/B,EAAmC;AAClC,WAAOC,IAAI,CAACC,cAAL,CAAoBC,kBAApB,CAAuCb,OAAvC,EAAgD,CAAhD,CAAP;AACA;AACD;AACD;;;;;;AAIO,SAASU,2BAAT,GAAuC;AAC7C;AACA;;AACA;AACA,MAAMI,eAAe,GAAG,QAAOH,IAAP,yCAAOA,IAAP,OAAgB,QAAxC;AACA,SAAOG,eAAe,IAAI,OAAOH,IAAI,CAACC,cAAZ,KAA+B,UAAzD;AACA","sourcesContent":["// Chooses the most appropriate locale\r\n// (one of the registered ones)\r\n// based on the list of preferred `locales` supplied by the user.\r\n//\r\n// @param {string[]} locales - the list of preferable locales (in [IETF format](https://en.wikipedia.org/wiki/IETF_language_tag)).\r\n// @param {Function} isLocaleDataAvailable - tests if a locale is available.\r\n//\r\n// @returns {string} The most suitable locale\r\n//\r\n// @example\r\n// // Returns 'en'\r\n// chooseLocale(['en-US'], undefined, (locale) => locale === 'ru' || locale === 'en')\r\n//\r\nexport default function chooseLocale(locales, isLocaleDataAvailable)\r\n{\r\n\t// This is not an intelligent algorithm,\r\n\t// but it will do for this library's case.\r\n\t// `sr-Cyrl-BA` -> `sr-Cyrl` -> `sr`.\r\n\tfor (let locale of locales) {\r\n\t\tif (isLocaleDataAvailable(locale)) {\r\n\t\t\treturn locale\r\n\t\t}\r\n\t\tconst parts = locale.split('-')\r\n\t\twhile (parts.length > 1) {\r\n\t\t\tparts.pop()\r\n\t\t\tlocale = parts.join('-')\r\n\t\t\tif (isLocaleDataAvailable(locale)) {\r\n\t\t\t\treturn locale\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tthrow new Error(`No locale data has been registered for any of the locales: ${locales.join(', ')}`)\r\n}\r\n\r\n/**\r\n * Whether can use `Intl.DateTimeFormat` for these `locales`.\r\n * Returns the first suitable one.\r\n * @param {(string|string[])} locales\r\n * @return {?string} The first locale that can be used.\r\n */\r\nexport function intlDateTimeFormatSupportedLocale(locales) {\r\n\t/* istanbul ignore else */\r\n\tif (intlDateTimeFormatSupported()) {\r\n\t\treturn Intl.DateTimeFormat.supportedLocalesOf(locales)[0]\r\n\t}\r\n}\r\n/**\r\n * Whether can use `Intl.DateTimeFormat`.\r\n * @return {boolean}\r\n */\r\nexport function intlDateTimeFormatSupported() {\r\n\t// Babel transforms `typeof` into some \"branches\"\r\n\t// so istanbul will show this as \"branch not covered\".\r\n\t/* istanbul ignore next */\r\n\tconst isIntlAvailable = typeof Intl === 'object'\r\n\treturn isIntlAvailable && typeof Intl.DateTimeFormat === 'function'\r\n}\r\n"],"file":"locale.js"}
|
||||
46
node_modules/javascript-time-ago/commonjs/locale.test.js
generated
vendored
Normal file
46
node_modules/javascript-time-ago/commonjs/locale.test.js
generated
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
"use strict";
|
||||
|
||||
var _locale = _interopRequireWildcard(require("../source/locale"));
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
||||
|
||||
describe('locale', function () {
|
||||
it("should tell if can use Intl for date formatting", function () {
|
||||
(0, _locale.intlDateTimeFormatSupportedLocale)('en').should.equal('en');
|
||||
(0, _locale.intlDateTimeFormatSupportedLocale)('en-XX').should.equal('en-XX');
|
||||
(0, _locale.intlDateTimeFormatSupportedLocale)(['en', 'ru']).should.equal('en');
|
||||
});
|
||||
it("should choose the most appropriate locale", function () {
|
||||
function arrayToObject(array) {
|
||||
return array.reduce(function (object, locale) {
|
||||
object[locale] = true;
|
||||
return object;
|
||||
}, {});
|
||||
}
|
||||
|
||||
function choose(locale, locales) {
|
||||
var defaultLocale = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'en';
|
||||
|
||||
if (typeof locale === 'string') {
|
||||
locale = [locale];
|
||||
}
|
||||
|
||||
locale = locale.concat(defaultLocale);
|
||||
return (0, _locale.default)(locale, function (_) {
|
||||
return locales.includes(_);
|
||||
});
|
||||
}
|
||||
|
||||
choose('ru-RU', ['en', 'ru']).should.equal('ru');
|
||||
choose('en-GB', ['en', 'ru']).should.equal('en');
|
||||
choose('fr-FR', ['en', 'ru']).should.equal('en');
|
||||
choose(['fr-FR', 'de-DE'], ['en', 'ru']).should.equal('en');
|
||||
choose(['fr-FR', 'de-DE'], ['en', 'de']).should.equal('de');
|
||||
choose(['fr-FR', 'de-DE'], ['en', 'de', 'fr']).should.equal('fr');
|
||||
choose('fr-FR', ['en', 'fr-FR']).should.equal('fr-FR');
|
||||
expect(function () {
|
||||
return choose('fr-FR', ['de', 'ru']);
|
||||
}).to.throw('No locale data has been registered for any of the locales: fr-FR');
|
||||
});
|
||||
});
|
||||
//# sourceMappingURL=locale.test.js.map
|
||||
1
node_modules/javascript-time-ago/commonjs/locale.test.js.map
generated
vendored
Normal file
1
node_modules/javascript-time-ago/commonjs/locale.test.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../source/locale.test.js"],"names":["describe","it","should","equal","arrayToObject","array","reduce","object","locale","choose","locales","defaultLocale","concat","_","includes","expect","to","throw"],"mappings":";;AAAA;;;;AAEAA,QAAQ,CAAC,QAAD,EAAW,YACnB;AACCC,EAAAA,EAAE,oDAAoD,YACtD;AACC,mDAAkC,IAAlC,EAAwCC,MAAxC,CAA+CC,KAA/C,CAAqD,IAArD;AACA,mDAAkC,OAAlC,EAA2CD,MAA3C,CAAkDC,KAAlD,CAAwD,OAAxD;AACA,mDAAkC,CAAC,IAAD,EAAO,IAAP,CAAlC,EAAgDD,MAAhD,CAAuDC,KAAvD,CAA6D,IAA7D;AACA,GALC,CAAF;AAOAF,EAAAA,EAAE,8CAA8C,YAChD;AACC,aAASG,aAAT,CAAuBC,KAAvB,EACA;AACC,aAAOA,KAAK,CAACC,MAAN,CAAa,UAACC,MAAD,EAASC,MAAT,EAAoB;AACvCD,QAAAA,MAAM,CAACC,MAAD,CAAN,GAAiB,IAAjB;AACA,eAAOD,MAAP;AACA,OAHM,EAGJ,EAHI,CAAP;AAIA;;AAED,aAASE,MAAT,CAAgBD,MAAhB,EAAwBE,OAAxB,EACA;AAAA,UADiCC,aACjC,uEADiD,IACjD;;AACC,UAAI,OAAOH,MAAP,KAAkB,QAAtB,EAAgC;AAC/BA,QAAAA,MAAM,GAAG,CAACA,MAAD,CAAT;AACA;;AACDA,MAAAA,MAAM,GAAGA,MAAM,CAACI,MAAP,CAAcD,aAAd,CAAT;AACA,aAAO,qBAAaH,MAAb,EAAqB,UAAAK,CAAC;AAAA,eAAIH,OAAO,CAACI,QAAR,CAAiBD,CAAjB,CAAJ;AAAA,OAAtB,CAAP;AACA;;AAEDJ,IAAAA,MAAM,CAAC,OAAD,EAAU,CAAC,IAAD,EAAO,IAAP,CAAV,CAAN,CAA8BP,MAA9B,CAAqCC,KAArC,CAA2C,IAA3C;AACAM,IAAAA,MAAM,CAAC,OAAD,EAAU,CAAC,IAAD,EAAO,IAAP,CAAV,CAAN,CAA8BP,MAA9B,CAAqCC,KAArC,CAA2C,IAA3C;AACAM,IAAAA,MAAM,CAAC,OAAD,EAAU,CAAC,IAAD,EAAO,IAAP,CAAV,CAAN,CAA8BP,MAA9B,CAAqCC,KAArC,CAA2C,IAA3C;AACAM,IAAAA,MAAM,CAAC,CAAC,OAAD,EAAU,OAAV,CAAD,EAAqB,CAAC,IAAD,EAAO,IAAP,CAArB,CAAN,CAAyCP,MAAzC,CAAgDC,KAAhD,CAAsD,IAAtD;AACAM,IAAAA,MAAM,CAAC,CAAC,OAAD,EAAU,OAAV,CAAD,EAAqB,CAAC,IAAD,EAAO,IAAP,CAArB,CAAN,CAAyCP,MAAzC,CAAgDC,KAAhD,CAAsD,IAAtD;AACAM,IAAAA,MAAM,CAAC,CAAC,OAAD,EAAU,OAAV,CAAD,EAAqB,CAAC,IAAD,EAAO,IAAP,EAAa,IAAb,CAArB,CAAN,CAA+CP,MAA/C,CAAsDC,KAAtD,CAA4D,IAA5D;AACAM,IAAAA,MAAM,CAAC,OAAD,EAAU,CAAC,IAAD,EAAO,OAAP,CAAV,CAAN,CAAiCP,MAAjC,CAAwCC,KAAxC,CAA8C,OAA9C;AAEAY,IAAAA,MAAM,CAAC;AAAA,aAAMN,MAAM,CAAC,OAAD,EAAU,CAAC,IAAD,EAAO,IAAP,CAAV,CAAZ;AAAA,KAAD,CAAN,CAA4CO,EAA5C,CAA+CC,KAA/C,CACC,kEADD;AAGA,GA9BC,CAAF;AA+BA,CAxCO,CAAR","sourcesContent":["import chooseLocale, { intlDateTimeFormatSupportedLocale } from '../source/locale'\r\n\r\ndescribe('locale', function()\r\n{\r\n\tit(`should tell if can use Intl for date formatting`, function()\r\n\t{\r\n\t\tintlDateTimeFormatSupportedLocale('en').should.equal('en')\r\n\t\tintlDateTimeFormatSupportedLocale('en-XX').should.equal('en-XX')\r\n\t\tintlDateTimeFormatSupportedLocale(['en', 'ru']).should.equal('en')\r\n\t})\r\n\r\n\tit(`should choose the most appropriate locale`, function()\r\n\t{\r\n\t\tfunction arrayToObject(array)\r\n\t\t{\r\n\t\t\treturn array.reduce((object, locale) => {\r\n\t\t\t\tobject[locale] = true\r\n\t\t\t\treturn object\r\n\t\t\t}, {})\r\n\t\t}\r\n\r\n\t\tfunction choose(locale, locales, defaultLocale = 'en')\r\n\t\t{\r\n\t\t\tif (typeof locale === 'string') {\r\n\t\t\t\tlocale = [locale]\r\n\t\t\t}\r\n\t\t\tlocale = locale.concat(defaultLocale)\r\n\t\t\treturn chooseLocale(locale, _ => locales.includes(_))\r\n\t\t}\r\n\r\n\t\tchoose('ru-RU', ['en', 'ru']).should.equal('ru')\r\n\t\tchoose('en-GB', ['en', 'ru']).should.equal('en')\r\n\t\tchoose('fr-FR', ['en', 'ru']).should.equal('en')\r\n\t\tchoose(['fr-FR', 'de-DE'], ['en', 'ru']).should.equal('en')\r\n\t\tchoose(['fr-FR', 'de-DE'], ['en', 'de']).should.equal('de')\r\n\t\tchoose(['fr-FR', 'de-DE'], ['en', 'de', 'fr']).should.equal('fr')\r\n\t\tchoose('fr-FR', ['en', 'fr-FR']).should.equal('fr-FR')\r\n\r\n\t\texpect(() => choose('fr-FR', ['de', 'ru'])).to.throw(\r\n\t\t\t'No locale data has been registered for any of the locales: fr-FR'\r\n\t\t)\r\n\t})\r\n})"],"file":"locale.test.js"}
|
||||
16
node_modules/javascript-time-ago/commonjs/style/default.js
generated
vendored
Normal file
16
node_modules/javascript-time-ago/commonjs/style/default.js
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
var _gradation = require("../gradation");
|
||||
|
||||
var _default = {
|
||||
gradation: _gradation.convenient,
|
||||
flavour: ['long-convenient', 'long'],
|
||||
units: ['now', 'minute', 'hour', 'day', 'week', 'month', 'year']
|
||||
};
|
||||
exports.default = _default;
|
||||
//# sourceMappingURL=default.js.map
|
||||
1
node_modules/javascript-time-ago/commonjs/style/default.js.map
generated
vendored
Normal file
1
node_modules/javascript-time-ago/commonjs/style/default.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../source/style/default.js"],"names":["gradation","convenient","flavour","units"],"mappings":";;;;;;;AAAA;;eAGA;AACCA,EAAAA,SAAS,EAAEC,qBADZ;AAECC,EAAAA,OAAO,EAAE,CAAC,iBAAD,EAAoB,MAApB,CAFV;AAGCC,EAAAA,KAAK,EACL,CACC,KADD,EAEC,QAFD,EAGC,MAHD,EAIC,KAJD,EAKC,MALD,EAMC,OAND,EAOC,MAPD;AAJD,C","sourcesContent":["import { convenient } from '../gradation'\r\n\r\nexport default\r\n{\r\n\tgradation: convenient,\r\n\tflavour: ['long-convenient', 'long'],\r\n\tunits:\r\n\t[\r\n\t\t'now',\r\n\t\t'minute',\r\n\t\t'hour',\r\n\t\t'day',\r\n\t\t'week',\r\n\t\t'month',\r\n\t\t'year'\r\n\t]\r\n}"],"file":"default.js"}
|
||||
32
node_modules/javascript-time-ago/commonjs/style/index.js
generated
vendored
Normal file
32
node_modules/javascript-time-ago/commonjs/style/index.js
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "timeStyle", {
|
||||
enumerable: true,
|
||||
get: function get() {
|
||||
return _time.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "twitterStyle", {
|
||||
enumerable: true,
|
||||
get: function get() {
|
||||
return _twitter.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "defaultStyle", {
|
||||
enumerable: true,
|
||||
get: function get() {
|
||||
return _default.default;
|
||||
}
|
||||
});
|
||||
|
||||
var _time = _interopRequireDefault(require("./time"));
|
||||
|
||||
var _twitter = _interopRequireDefault(require("./twitter"));
|
||||
|
||||
var _default = _interopRequireDefault(require("./default"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
node_modules/javascript-time-ago/commonjs/style/index.js.map
generated
vendored
Normal file
1
node_modules/javascript-time-ago/commonjs/style/index.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../source/style/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAKA;;AACA;;AACA","sourcesContent":["// A preset (style) is an object having shape\r\n// `{ units, gradation, flavour, custom({ elapsed, time, date, now, locale }) }`.\r\n//\r\n// `date` parameter of `custom()` is not guaranteed to be set (can be inferred from `time`).\r\n//\r\nexport { default as timeStyle } from './time'\r\nexport { default as twitterStyle } from './twitter'\r\nexport { default as defaultStyle } from './default'"],"file":"index.js"}
|
||||
39
node_modules/javascript-time-ago/commonjs/style/time.js
generated
vendored
Normal file
39
node_modules/javascript-time-ago/commonjs/style/time.js
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
var _gradation = require("../gradation");
|
||||
|
||||
// Similar to the default style but with "ago" omitted.
|
||||
//
|
||||
// just now
|
||||
// 5 minutes
|
||||
// 10 minutes
|
||||
// 15 minutes
|
||||
// 20 minutes
|
||||
// an hour
|
||||
// 2 hours
|
||||
// …
|
||||
// 20 hours
|
||||
// 1 day
|
||||
// 2 days
|
||||
// a week
|
||||
// 2 weeks
|
||||
// 3 weeks
|
||||
// a month
|
||||
// 2 months
|
||||
// 3 months
|
||||
// 4 months
|
||||
// a year
|
||||
// 2 years
|
||||
//
|
||||
var _default = {
|
||||
gradation: _gradation.convenient,
|
||||
flavour: 'long-time',
|
||||
units: ['now', 'minute', 'hour', 'day', 'week', 'month', 'year']
|
||||
};
|
||||
exports.default = _default;
|
||||
//# sourceMappingURL=time.js.map
|
||||
1
node_modules/javascript-time-ago/commonjs/style/time.js.map
generated
vendored
Normal file
1
node_modules/javascript-time-ago/commonjs/style/time.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../source/style/time.js"],"names":["gradation","convenient","flavour","units"],"mappings":";;;;;;;AAAA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;eAEA;AACCA,EAAAA,SAAS,EAAEC,qBADZ;AAECC,EAAAA,OAAO,EAAE,WAFV;AAGCC,EAAAA,KAAK,EACL,CACC,KADD,EAEC,QAFD,EAGC,MAHD,EAIC,KAJD,EAKC,MALD,EAMC,OAND,EAOC,MAPD;AAJD,C","sourcesContent":["import { convenient } from '../gradation'\r\n\r\n// Similar to the default style but with \"ago\" omitted.\r\n//\r\n// just now\r\n// 5 minutes\r\n// 10 minutes\r\n// 15 minutes\r\n// 20 minutes\r\n// an hour\r\n// 2 hours\r\n// …\r\n// 20 hours\r\n// 1 day\r\n// 2 days\r\n// a week\r\n// 2 weeks\r\n// 3 weeks\r\n// a month\r\n// 2 months\r\n// 3 months\r\n// 4 months\r\n// a year\r\n// 2 years\r\n//\r\nexport default\r\n{\r\n\tgradation: convenient,\r\n\tflavour: 'long-time',\r\n\tunits:\r\n\t[\r\n\t\t'now',\r\n\t\t'minute',\r\n\t\t'hour',\r\n\t\t'day',\r\n\t\t'week',\r\n\t\t'month',\r\n\t\t'year'\r\n\t]\r\n}"],"file":"time.js"}
|
||||
17
node_modules/javascript-time-ago/commonjs/style/time.test.js
generated
vendored
Normal file
17
node_modules/javascript-time-ago/commonjs/style/time.test.js
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
"use strict";
|
||||
|
||||
var _time = _interopRequireDefault(require("./time"));
|
||||
|
||||
var _JavascriptTimeAgo = require("../JavascriptTimeAgo.test");
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
describe('"time" style', function () {
|
||||
it('should format "time" style relative time (English)', function () {
|
||||
(0, _JavascriptTimeAgo.convenientGradationTest)(['just now', '1 minute', '2 minutes', '5 minutes', '10 minutes', '15 minutes', '20 minutes', '25 minutes', '30 minutes', '35 minutes', '40 minutes', '45 minutes', '50 minutes', '1 hour', '2 hours', '3 hours', '4 hours', '5 hours', '6 hours', '7 hours', '8 hours', '9 hours', '10 hours', '11 hours', '12 hours', '13 hours', '14 hours', '15 hours', '16 hours', '17 hours', '18 hours', '19 hours', '20 hours', '1 day', '2 days', '3 days', '4 days', '5 days', '1 week', '2 weeks', '3 weeks', '1 month', '2 months', '3 months', '4 months', '5 months', '6 months', '7 months', '8 months', '9 months', '9 months', '10 months', '1 year', '2 years', '3 years', '100 years'], 'en-US', _time.default);
|
||||
});
|
||||
it('should format "time" style relative time (Russian)', function () {
|
||||
(0, _JavascriptTimeAgo.convenientGradationTest)(['только что', '1 минута', '2 минуты', '5 минут', '10 минут', '15 минут', '20 минут', '25 минут', '30 минут', '35 минут', '40 минут', '45 минут', '50 минут', '1 час', '2 часа', '3 часа', '4 часа', '5 часов', '6 часов', '7 часов', '8 часов', '9 часов', '10 часов', '11 часов', '12 часов', '13 часов', '14 часов', '15 часов', '16 часов', '17 часов', '18 часов', '19 часов', '20 часов', '1 день', '2 дня', '3 дня', '4 дня', '5 дней', '1 неделю', '2 недели', '3 недели', '1 месяц', '2 месяца', '3 месяца', '4 месяца', '5 месяцев', '6 месяцев', '7 месяцев', '8 месяцев', '9 месяцев', '9 месяцев', '10 месяцев', '1 год', '2 года', '3 года', '100 лет'], 'ru-RU', _time.default);
|
||||
});
|
||||
});
|
||||
//# sourceMappingURL=time.test.js.map
|
||||
1
node_modules/javascript-time-ago/commonjs/style/time.test.js.map
generated
vendored
Normal file
1
node_modules/javascript-time-ago/commonjs/style/time.test.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
113
node_modules/javascript-time-ago/commonjs/style/twitter.js
generated
vendored
Normal file
113
node_modules/javascript-time-ago/commonjs/style/twitter.js
generated
vendored
Normal file
@@ -0,0 +1,113 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
var _gradation = require("../gradation");
|
||||
|
||||
var _locale = require("../locale");
|
||||
|
||||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }
|
||||
|
||||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
// A cache for `Intl.DateTimeFormat` twitter formatters
|
||||
// for various locales (is a global variable).
|
||||
var formatters = {}; // Twitter style relative time formatting.
|
||||
// ("1m", "2h", "Mar 3", "Apr 4, 2012").
|
||||
// Seconds, minutes and hours are shown relatively,
|
||||
// and other intervals can be shown using full date format.
|
||||
|
||||
var _default = {
|
||||
// Twitter gradation is derived from "canonical" gradation
|
||||
// adjusting its "minute" `threshold` to be 45.
|
||||
gradation: [// Minutes
|
||||
_objectSpread({}, (0, _gradation.getStep)(_gradation.canonical, 'minute'), {
|
||||
threshold: 45
|
||||
}), // Hours
|
||||
(0, _gradation.getStep)(_gradation.canonical, 'hour'), // If `date` and `now` happened the same year,
|
||||
// then only output month and day.
|
||||
{
|
||||
threshold: _gradation.day - 0.5 * _gradation.hour,
|
||||
format: function format(value, locale) {
|
||||
// Whether can use `Intl.DateTimeFormat`.
|
||||
// If `Intl` is not available,
|
||||
// or the locale is not supported,
|
||||
// then don't override the default labels.
|
||||
|
||||
/* istanbul ignore if */
|
||||
if (!(0, _locale.intlDateTimeFormatSupported)()) {
|
||||
return;
|
||||
}
|
||||
/* istanbul ignore else */
|
||||
|
||||
|
||||
if (!formatters[locale]) {
|
||||
formatters[locale] = {};
|
||||
}
|
||||
/* istanbul ignore else */
|
||||
|
||||
|
||||
if (!formatters[locale].this_year) {
|
||||
// "Apr 11" (MMMd)
|
||||
formatters[locale].this_year = new Intl.DateTimeFormat(locale, {
|
||||
month: 'short',
|
||||
day: 'numeric'
|
||||
});
|
||||
} // Output month and day.
|
||||
|
||||
|
||||
return formatters[locale].this_year.format((0, _gradation.getDate)(value));
|
||||
}
|
||||
}, // If `date` and `now` happened in defferent years,
|
||||
// then output day, month and year.
|
||||
{
|
||||
threshold: function threshold(now, future) {
|
||||
if (future) {
|
||||
// Jan 1st 00:00 of the next year.
|
||||
var nextYear = new Date(new Date(now).getFullYear() + 1, 0);
|
||||
return (nextYear.getTime() - now) / 1000;
|
||||
} else {
|
||||
// Jan 1st of the current year.
|
||||
var thisYear = new Date(new Date(now).getFullYear(), 0);
|
||||
return (now - thisYear.getTime()) / 1000;
|
||||
}
|
||||
},
|
||||
format: function format(value, locale) {
|
||||
// Whether can use `Intl.DateTimeFormat`.
|
||||
// If `Intl` is not available,
|
||||
// or the locale is not supported,
|
||||
// then don't override the default labels.
|
||||
|
||||
/* istanbul ignore if */
|
||||
if (!(0, _locale.intlDateTimeFormatSupported)()) {
|
||||
return;
|
||||
}
|
||||
/* istanbul ignore if */
|
||||
|
||||
|
||||
if (!formatters[locale]) {
|
||||
formatters[locale] = {};
|
||||
}
|
||||
/* istanbul ignore else */
|
||||
|
||||
|
||||
if (!formatters[locale].other) {
|
||||
// "Apr 11, 2017" (yMMMd)
|
||||
formatters[locale].other = new Intl.DateTimeFormat(locale, {
|
||||
year: 'numeric',
|
||||
month: 'short',
|
||||
day: 'numeric'
|
||||
});
|
||||
} // Output day, month and year.
|
||||
|
||||
|
||||
return formatters[locale].other.format((0, _gradation.getDate)(value));
|
||||
}
|
||||
}],
|
||||
flavour: ['tiny', 'short-time', 'narrow', 'short']
|
||||
};
|
||||
exports.default = _default;
|
||||
//# sourceMappingURL=twitter.js.map
|
||||
1
node_modules/javascript-time-ago/commonjs/style/twitter.js.map
generated
vendored
Normal file
1
node_modules/javascript-time-ago/commonjs/style/twitter.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
87
node_modules/javascript-time-ago/commonjs/style/twitter.test.js
generated
vendored
Normal file
87
node_modules/javascript-time-ago/commonjs/style/twitter.test.js
generated
vendored
Normal file
@@ -0,0 +1,87 @@
|
||||
"use strict";
|
||||
|
||||
var _twitter = _interopRequireDefault(require("./twitter"));
|
||||
|
||||
var _JavascriptTimeAgo = _interopRequireDefault(require("../JavascriptTimeAgo"));
|
||||
|
||||
var _gradation = require("../gradation");
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }
|
||||
|
||||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
describe('"twitter" style', function () {
|
||||
it('should fallback from "tiny" to "narrow" for Twitter style for autogenerated locales', function () {
|
||||
var timeAgo = new _JavascriptTimeAgo.default('de');
|
||||
timeAgo.format(Date.now() - 3 * 60 * 60 * 1000, 'twitter').should.equal('vor 3 Std.');
|
||||
});
|
||||
it('should format Twitter style relative time (English)', function () {
|
||||
var timeAgo = new _JavascriptTimeAgo.default('en');
|
||||
var now = new Date(2016, 3, 10, 22, 59).getTime();
|
||||
|
||||
var elapsed = function elapsed(time) {
|
||||
return timeAgo.format(now - time * 1000, _objectSpread({
|
||||
now: now
|
||||
}, _twitter.default));
|
||||
};
|
||||
|
||||
elapsed(0).should.equal('');
|
||||
elapsed(44.9).should.equal('');
|
||||
elapsed(45.1).should.equal('1m');
|
||||
elapsed(1.49 * 60).should.equal('1m');
|
||||
elapsed(1.51 * 60).should.equal('2m');
|
||||
elapsed(2.49 * 60).should.equal('2m');
|
||||
elapsed(2.51 * 60).should.equal('3m'); // …
|
||||
|
||||
elapsed(59.49 * 60).should.equal('59m');
|
||||
elapsed(59.51 * 60).should.equal('1h');
|
||||
elapsed(1.49 * 60 * 60).should.equal('1h');
|
||||
elapsed(1.51 * 60 * 60).should.equal('2h');
|
||||
elapsed(2.49 * 60 * 60).should.equal('2h');
|
||||
elapsed(2.51 * 60 * 60).should.equal('3h'); // …
|
||||
|
||||
elapsed(23.49 * 60 * 60).should.equal('23h');
|
||||
elapsed(_gradation.day + 2 * 60 + 60 * 60).should.equal('Apr 9'); // …
|
||||
// "month" is an approximation.
|
||||
|
||||
elapsed(_gradation.month * 3).should.equal('Jan 10');
|
||||
elapsed(_gradation.month * 4).should.equal('Dec 11, 2015');
|
||||
elapsed(_gradation.year).should.equal('Apr 11, 2015'); // Test future dates.
|
||||
// "month" is an approximation.
|
||||
|
||||
elapsed(-1 * _gradation.month * 8).should.equal('Dec 10');
|
||||
elapsed(-1 * _gradation.month * 9).should.equal('Jan 9, 2017');
|
||||
});
|
||||
it('should format Twitter style relative time (Russian)', function () {
|
||||
var timeAgo = new _JavascriptTimeAgo.default('ru');
|
||||
var now = new Date(2016, 3, 10, 22, 59).getTime();
|
||||
|
||||
var elapsed = function elapsed(time) {
|
||||
return timeAgo.format(now - time * 1000, _objectSpread({
|
||||
now: now
|
||||
}, _twitter.default));
|
||||
};
|
||||
|
||||
elapsed(45.1).should.equal('1м');
|
||||
elapsed(59.51 * 60).should.equal('1ч');
|
||||
elapsed(_gradation.day + 62 * 60).should.equal('9 апр.');
|
||||
elapsed(_gradation.year).should.equal('11 апр. 2015 г.');
|
||||
});
|
||||
it('should format Twitter style relative time (Korean)', function () {
|
||||
var timeAgo = new _JavascriptTimeAgo.default('ko');
|
||||
var now = new Date(2016, 3, 10, 22, 59).getTime();
|
||||
|
||||
var elapsed = function elapsed(time) {
|
||||
return timeAgo.format(now - time * 1000, _objectSpread({
|
||||
now: now
|
||||
}, _twitter.default));
|
||||
};
|
||||
|
||||
elapsed(45.1).should.equal('1분');
|
||||
elapsed(59.51 * 60).should.equal('1시간'); // elapsed(day + 62 * 60).should.equal('9 апр.')
|
||||
// elapsed(year).should.equal('11 апр. 2015 г.')
|
||||
});
|
||||
});
|
||||
//# sourceMappingURL=twitter.test.js.map
|
||||
1
node_modules/javascript-time-ago/commonjs/style/twitter.test.js.map
generated
vendored
Normal file
1
node_modules/javascript-time-ago/commonjs/style/twitter.test.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
2
node_modules/javascript-time-ago/gradation/index.commonjs.js
generated
vendored
Normal file
2
node_modules/javascript-time-ago/gradation/index.commonjs.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
exports = module.exports = require('../commonjs/gradation')
|
||||
exports['default'] = require('../commonjs/gradation')
|
||||
1
node_modules/javascript-time-ago/gradation/index.js
generated
vendored
Normal file
1
node_modules/javascript-time-ago/gradation/index.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export * from '../modules/gradation'
|
||||
8
node_modules/javascript-time-ago/gradation/package.json
generated
vendored
Normal file
8
node_modules/javascript-time-ago/gradation/package.json
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "javascript-time-ago-gradation",
|
||||
"version": "1.0.0",
|
||||
"main": "index.commonjs.js",
|
||||
"module": "index.js",
|
||||
"sideEffects": false
|
||||
}
|
||||
9
node_modules/javascript-time-ago/index.commonjs.js
generated
vendored
Normal file
9
node_modules/javascript-time-ago/index.commonjs.js
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
'use strict'
|
||||
|
||||
exports = module.exports = require('./commonjs/JavascriptTimeAgo').default
|
||||
exports['default'] = require('./commonjs/JavascriptTimeAgo').default
|
||||
|
||||
var locale = require('./commonjs/locale')
|
||||
|
||||
exports.intlDateTimeFormatSupported = locale.intlDateTimeFormatSupported
|
||||
exports.intlDateTimeFormatSupportedLocale = locale.intlDateTimeFormatSupportedLocale
|
||||
6
node_modules/javascript-time-ago/index.js
generated
vendored
Normal file
6
node_modules/javascript-time-ago/index.js
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
export { default } from './modules/JavascriptTimeAgo'
|
||||
|
||||
export {
|
||||
intlDateTimeFormatSupported as intlDateTimeFormatSupported,
|
||||
intlDateTimeFormatSupportedLocale as intlDateTimeFormatSupportedLocale
|
||||
} from './modules/locale'
|
||||
135
node_modules/javascript-time-ago/load-all-locales.js
generated
vendored
Normal file
135
node_modules/javascript-time-ago/load-all-locales.js
generated
vendored
Normal file
@@ -0,0 +1,135 @@
|
||||
var TimeAgo = require("javascript-time-ago")
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/af"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/am"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/ar"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/ar-AE"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/as"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/ast"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/az"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/be"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/bg"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/bn"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/br"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/bs"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/bs-Cyrl"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/ca"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/ccp"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/ce"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/chr"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/cs"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/cy"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/da"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/de"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/dsb"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/dz"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/ee"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/el"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/en"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/es"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/es-AR"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/es-MX"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/es-PY"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/es-SV"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/es-US"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/et"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/eu"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/fa"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/fi"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/fil"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/fo"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/fr"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/fr-CA"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/fur"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/fy"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/ga"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/gd"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/gl"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/gu"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/he"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/hi"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/hr"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/hsb"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/hu"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/hy"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/ia"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/id"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/is"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/it"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/ja"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/jgo"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/jv"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/ka"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/kea"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/kk"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/kl"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/km"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/kn"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/ko"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/kok"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/ksh"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/ku"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/ky"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/lb"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/lkt"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/lo"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/lt"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/lv"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/mk"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/ml"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/mn"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/mr"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/ms"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/mt"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/my"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/mzn"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/nb"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/ne"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/nl"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/nn"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/or"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/pa"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/pl"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/ps"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/pt"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/qu"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/ro"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/ru"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/sah"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/sd"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/se"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/se-FI"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/si"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/sk"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/sl"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/so"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/sq"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/sr"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/sr-Latn"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/sv"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/sw"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/ta"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/te"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/th"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/ti"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/tk"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/to"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/tr"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/ug"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/uk"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/ur"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/ur-IN"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/uz"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/uz-Cyrl"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/vi"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/wae"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/yi"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/yue"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/yue-Hans"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/zh"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/zh-Hans-HK"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/zh-Hans-MO"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/zh-Hans-SG"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/zh-Hant"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/zh-Hant-HK"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/zh-Hant-MO"))
|
||||
TimeAgo.addLocale(require("javascript-time-ago/locale/zu"))
|
||||
34
node_modules/javascript-time-ago/locale-more-styles/de/long-time.json
generated
vendored
Normal file
34
node_modules/javascript-time-ago/locale-more-styles/de/long-time.json
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"year": {
|
||||
"one": "{0} Jahr",
|
||||
"other": "{0} Jahre"
|
||||
},
|
||||
"month": {
|
||||
"one": "{0} Monat",
|
||||
"other": "{0} Monate"
|
||||
},
|
||||
"week": {
|
||||
"one": "{0} Woche",
|
||||
"other": "{0} Wochen"
|
||||
},
|
||||
"day": {
|
||||
"one": "{0} Tag",
|
||||
"other": "{0} Tage"
|
||||
},
|
||||
"hour": {
|
||||
"one": "{0} Stunde",
|
||||
"other": "{0} Stunden"
|
||||
},
|
||||
"minute": {
|
||||
"one": "{0} Minute",
|
||||
"other": "{0} Minuten"
|
||||
},
|
||||
"second": {
|
||||
"one": "{0} Sekunde",
|
||||
"other": "{0} Sekunden"
|
||||
},
|
||||
"now": {
|
||||
"future": "in einem Moment",
|
||||
"past": "gerade jetzt"
|
||||
}
|
||||
}
|
||||
10
node_modules/javascript-time-ago/locale-more-styles/el/tiny.json
generated
vendored
Normal file
10
node_modules/javascript-time-ago/locale-more-styles/el/tiny.json
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"year": "{0}χρ.",
|
||||
"month": "{0}μην.",
|
||||
"week": "{0}εβδ.",
|
||||
"day": "{0}ημ.",
|
||||
"hour": "{0}ώρ.",
|
||||
"minute": "{0}λ.",
|
||||
"second": "τώρα",
|
||||
"now": "τώρα"
|
||||
}
|
||||
104
node_modules/javascript-time-ago/locale-more-styles/en/long-convenient.json
generated
vendored
Normal file
104
node_modules/javascript-time-ago/locale-more-styles/en/long-convenient.json
generated
vendored
Normal file
@@ -0,0 +1,104 @@
|
||||
{
|
||||
"year": {
|
||||
"previous": "last year",
|
||||
"current": "this year",
|
||||
"next": "next year",
|
||||
"past": {
|
||||
"one": "a year ago",
|
||||
"other": "{0} years ago"
|
||||
},
|
||||
"future": {
|
||||
"one": "in a year",
|
||||
"other": "in {0} years"
|
||||
}
|
||||
},
|
||||
"quarter": {
|
||||
"previous": "last quarter",
|
||||
"current": "this quarter",
|
||||
"next": "next quarter",
|
||||
"past": {
|
||||
"one": "a quarter ago",
|
||||
"other": "{0} quarters ago"
|
||||
},
|
||||
"future": {
|
||||
"one": "in a quarter",
|
||||
"other": "in {0} quarters"
|
||||
}
|
||||
},
|
||||
"month": {
|
||||
"previous": "last month",
|
||||
"current": "this month",
|
||||
"next": "next month",
|
||||
"past": {
|
||||
"one": "a month ago",
|
||||
"other": "{0} months ago"
|
||||
},
|
||||
"future": {
|
||||
"one": "in a month",
|
||||
"other": "in {0} months"
|
||||
}
|
||||
},
|
||||
"week": {
|
||||
"previous": "last week",
|
||||
"current": "this week",
|
||||
"next": "next week",
|
||||
"past": {
|
||||
"one": "a week ago",
|
||||
"other": "{0} weeks ago"
|
||||
},
|
||||
"future": {
|
||||
"one": "in a week",
|
||||
"other": "in {0} weeks"
|
||||
}
|
||||
},
|
||||
"day": {
|
||||
"previous": "yesterday",
|
||||
"current": "today",
|
||||
"next": "tomorrow",
|
||||
"past": {
|
||||
"one": "a day ago",
|
||||
"other": "{0} days ago"
|
||||
},
|
||||
"future": {
|
||||
"one": "in a day",
|
||||
"other": "in {0} days"
|
||||
}
|
||||
},
|
||||
"hour": {
|
||||
"current": "this hour",
|
||||
"past": {
|
||||
"one": "an hour ago",
|
||||
"other": "{0} hours ago"
|
||||
},
|
||||
"future": {
|
||||
"one": "in an hour",
|
||||
"other": "in {0} hours"
|
||||
}
|
||||
},
|
||||
"minute": {
|
||||
"current": "this minute",
|
||||
"past": {
|
||||
"one": "a minute ago",
|
||||
"other": "{0} minutes ago"
|
||||
},
|
||||
"future": {
|
||||
"one": "in a minute",
|
||||
"other": "in {0} minutes"
|
||||
}
|
||||
},
|
||||
"second": {
|
||||
"current": "now",
|
||||
"past": {
|
||||
"one": "a second ago",
|
||||
"other": "{0} seconds ago"
|
||||
},
|
||||
"future": {
|
||||
"one": "in a second",
|
||||
"other": "in {0} seconds"
|
||||
}
|
||||
},
|
||||
"now": {
|
||||
"future": "in a moment",
|
||||
"past": "just now"
|
||||
}
|
||||
}
|
||||
34
node_modules/javascript-time-ago/locale-more-styles/en/long-time.json
generated
vendored
Normal file
34
node_modules/javascript-time-ago/locale-more-styles/en/long-time.json
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"year": {
|
||||
"one": "{0} year",
|
||||
"other": "{0} years"
|
||||
},
|
||||
"month": {
|
||||
"one": "{0} month",
|
||||
"other": "{0} months"
|
||||
},
|
||||
"week": {
|
||||
"one": "{0} week",
|
||||
"other": "{0} weeks"
|
||||
},
|
||||
"day": {
|
||||
"one": "{0} day",
|
||||
"other": "{0} days"
|
||||
},
|
||||
"hour": {
|
||||
"one": "{0} hour",
|
||||
"other": "{0} hours"
|
||||
},
|
||||
"minute": {
|
||||
"one": "{0} minute",
|
||||
"other": "{0} minutes"
|
||||
},
|
||||
"second": {
|
||||
"one": "{0} second",
|
||||
"other": "{0} seconds"
|
||||
},
|
||||
"now": {
|
||||
"future": "in a moment",
|
||||
"past": "just now"
|
||||
}
|
||||
}
|
||||
68
node_modules/javascript-time-ago/locale-more-styles/en/short-convenient.json
generated
vendored
Normal file
68
node_modules/javascript-time-ago/locale-more-styles/en/short-convenient.json
generated
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
{
|
||||
"year": {
|
||||
"previous": "last yr.",
|
||||
"current": "this yr.",
|
||||
"next": "next yr.",
|
||||
"past": "{0} yr. ago",
|
||||
"future": "in {0} yr."
|
||||
},
|
||||
"quarter": {
|
||||
"previous": "last qtr.",
|
||||
"current": "this qtr.",
|
||||
"next": "next qtr.",
|
||||
"past": {
|
||||
"one": "{0} qtr. ago",
|
||||
"other": "{0} qtrs. ago"
|
||||
},
|
||||
"future": {
|
||||
"one": "in {0} qtr.",
|
||||
"other": "in {0} qtrs."
|
||||
}
|
||||
},
|
||||
"month": {
|
||||
"previous": "last mo.",
|
||||
"current": "this mo.",
|
||||
"next": "next mo.",
|
||||
"past": "{0} mo. ago",
|
||||
"future": "in {0} mo."
|
||||
},
|
||||
"week": {
|
||||
"previous": "last wk.",
|
||||
"current": "this wk.",
|
||||
"next": "next wk.",
|
||||
"past": "{0} wk. ago",
|
||||
"future": "in {0} wk."
|
||||
},
|
||||
"day": {
|
||||
"previous": "yesterday",
|
||||
"current": "today",
|
||||
"next": "tomorrow",
|
||||
"past": {
|
||||
"one": "{0} day ago",
|
||||
"other": "{0} days ago"
|
||||
},
|
||||
"future": {
|
||||
"one": "in {0} day",
|
||||
"other": "in {0} days"
|
||||
}
|
||||
},
|
||||
"hour": {
|
||||
"current": "this hour",
|
||||
"past": "{0} hr. ago",
|
||||
"future": "in {0} hr."
|
||||
},
|
||||
"minute": {
|
||||
"current": "this minute",
|
||||
"past": "{0} min. ago",
|
||||
"future": "in {0} min."
|
||||
},
|
||||
"second": {
|
||||
"current": "now",
|
||||
"past": "{0} sec. ago",
|
||||
"future": "in {0} sec."
|
||||
},
|
||||
"now": {
|
||||
"future": "in a moment",
|
||||
"past": "just now"
|
||||
}
|
||||
}
|
||||
13
node_modules/javascript-time-ago/locale-more-styles/en/short-time.json
generated
vendored
Normal file
13
node_modules/javascript-time-ago/locale-more-styles/en/short-time.json
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"year": "{0} yr.",
|
||||
"month": "{0} mo.",
|
||||
"week": "{0} wk.",
|
||||
"day": {
|
||||
"one": "{0} day",
|
||||
"other": "{0} days"
|
||||
},
|
||||
"hour": "{0} hr.",
|
||||
"minute": "{0} min.",
|
||||
"second": "{0} sec.",
|
||||
"now": "now"
|
||||
}
|
||||
10
node_modules/javascript-time-ago/locale-more-styles/en/tiny.json
generated
vendored
Normal file
10
node_modules/javascript-time-ago/locale-more-styles/en/tiny.json
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"year": "{0}yr",
|
||||
"month": "{0}mo",
|
||||
"week": "{0}wk",
|
||||
"day": "{0}d",
|
||||
"hour": "{0}h",
|
||||
"minute": "{0}m",
|
||||
"second": "{0}s",
|
||||
"now": "now"
|
||||
}
|
||||
10
node_modules/javascript-time-ago/locale-more-styles/es/tiny.json
generated
vendored
Normal file
10
node_modules/javascript-time-ago/locale-more-styles/es/tiny.json
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"year": "{0}año",
|
||||
"month": "{0}mes",
|
||||
"week": "{0}sem.",
|
||||
"day": "{0}d",
|
||||
"hour": "{0}h",
|
||||
"minute": "{0}m",
|
||||
"second": "{0}s",
|
||||
"now": "ahora"
|
||||
}
|
||||
11
node_modules/javascript-time-ago/locale-more-styles/ko/tiny.json
generated
vendored
Normal file
11
node_modules/javascript-time-ago/locale-more-styles/ko/tiny.json
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"year": "{0}년",
|
||||
"quarter": "{0}분기",
|
||||
"month": "{0}개월",
|
||||
"week": "{0}주",
|
||||
"day": "{0}일",
|
||||
"hour": "{0}시간",
|
||||
"minute": "{0}분",
|
||||
"second": "{0}초",
|
||||
"now": "지금"
|
||||
}
|
||||
120
node_modules/javascript-time-ago/locale-more-styles/ru/long-convenient.json
generated
vendored
Normal file
120
node_modules/javascript-time-ago/locale-more-styles/ru/long-convenient.json
generated
vendored
Normal file
@@ -0,0 +1,120 @@
|
||||
{
|
||||
"year": {
|
||||
"previous": "в прошлом году",
|
||||
"current": "в этом году",
|
||||
"next": "в следующем году",
|
||||
"past": {
|
||||
"one": "{0} год назад",
|
||||
"many": "{0} лет назад",
|
||||
"other": "{0} года назад"
|
||||
},
|
||||
"future": {
|
||||
"one": "через {0} год",
|
||||
"many": "через {0} лет",
|
||||
"other": "через {0} года"
|
||||
}
|
||||
},
|
||||
"quarter": {
|
||||
"previous": "в прошлом квартале",
|
||||
"current": "в текущем квартале",
|
||||
"next": "в следующем квартале",
|
||||
"past": {
|
||||
"one": "{0} квартал назад",
|
||||
"many": "{0} кварталов назад",
|
||||
"other": "{0} квартала назад"
|
||||
},
|
||||
"future": {
|
||||
"one": "через {0} квартал",
|
||||
"many": "через {0} кварталов",
|
||||
"other": "через {0} квартала"
|
||||
}
|
||||
},
|
||||
"month": {
|
||||
"previous": "в прошлом месяце",
|
||||
"current": "в этом месяце",
|
||||
"next": "в следующем месяце",
|
||||
"past": {
|
||||
"one": "{0} месяц назад",
|
||||
"many": "{0} месяцев назад",
|
||||
"other": "{0} месяца назад"
|
||||
},
|
||||
"future": {
|
||||
"one": "через {0} месяц",
|
||||
"many": "через {0} месяцев",
|
||||
"other": "через {0} месяца"
|
||||
}
|
||||
},
|
||||
"week": {
|
||||
"previous": "на прошлой неделе",
|
||||
"current": "на этой неделе",
|
||||
"next": "на следующей неделе",
|
||||
"past": {
|
||||
"one": "{0} неделю назад",
|
||||
"many": "{0} недель назад",
|
||||
"other": "{0} недели назад"
|
||||
},
|
||||
"future": {
|
||||
"one": "через {0} неделю",
|
||||
"many": "через {0} недель",
|
||||
"other": "через {0} недели"
|
||||
}
|
||||
},
|
||||
"day": {
|
||||
"previous": "вчера",
|
||||
"current": "сегодня",
|
||||
"next": "завтра",
|
||||
"past": {
|
||||
"one": "{0} день назад",
|
||||
"many": "{0} дней назад",
|
||||
"other": "{0} дня назад"
|
||||
},
|
||||
"future": {
|
||||
"one": "через {0} день",
|
||||
"many": "через {0} дней",
|
||||
"other": "через {0} дня"
|
||||
}
|
||||
},
|
||||
"hour": {
|
||||
"current": "в этот час",
|
||||
"past": {
|
||||
"one": "{0} час назад",
|
||||
"many": "{0} часов назад",
|
||||
"other": "{0} часа назад"
|
||||
},
|
||||
"future": {
|
||||
"one": "через {0} час",
|
||||
"many": "через {0} часов",
|
||||
"other": "через {0} часа"
|
||||
}
|
||||
},
|
||||
"minute": {
|
||||
"current": "в эту минуту",
|
||||
"past": {
|
||||
"one": "{0} минуту назад",
|
||||
"many": "{0} минут назад",
|
||||
"other": "{0} минуты назад"
|
||||
},
|
||||
"future": {
|
||||
"one": "через {0} минуту",
|
||||
"many": "через {0} минут",
|
||||
"other": "через {0} минуты"
|
||||
}
|
||||
},
|
||||
"second": {
|
||||
"current": "сейчас",
|
||||
"past": {
|
||||
"one": "{0} секунду назад",
|
||||
"many": "{0} секунд назад",
|
||||
"other": "{0} секунды назад"
|
||||
},
|
||||
"future": {
|
||||
"one": "через {0} секунду",
|
||||
"many": "через {0} секунд",
|
||||
"other": "через {0} секунды"
|
||||
}
|
||||
},
|
||||
"now": {
|
||||
"past": "только что",
|
||||
"future": "сейчас"
|
||||
}
|
||||
}
|
||||
41
node_modules/javascript-time-ago/locale-more-styles/ru/long-time.json
generated
vendored
Normal file
41
node_modules/javascript-time-ago/locale-more-styles/ru/long-time.json
generated
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"year": {
|
||||
"one": "{0} год",
|
||||
"many": "{0} лет",
|
||||
"other": "{0} года"
|
||||
},
|
||||
"month": {
|
||||
"one": "{0} месяц",
|
||||
"many": "{0} месяцев",
|
||||
"other": "{0} месяца"
|
||||
},
|
||||
"week": {
|
||||
"one": "{0} неделю",
|
||||
"many": "{0} недель",
|
||||
"other": "{0} недели"
|
||||
},
|
||||
"day": {
|
||||
"one": "{0} день",
|
||||
"few": "{0} дня",
|
||||
"other": "{0} дней"
|
||||
},
|
||||
"hour": {
|
||||
"one": "{0} час",
|
||||
"many": "{0} часов",
|
||||
"other": "{0} часа"
|
||||
},
|
||||
"minute": {
|
||||
"one": "{0} минута",
|
||||
"many": "{0} минут",
|
||||
"other": "{0} минуты"
|
||||
},
|
||||
"second": {
|
||||
"one": "{0} секунда",
|
||||
"many": "{0} секунд",
|
||||
"other": "{0} секунды"
|
||||
},
|
||||
"now": {
|
||||
"past": "только что",
|
||||
"future": "сейчас"
|
||||
}
|
||||
}
|
||||
68
node_modules/javascript-time-ago/locale-more-styles/ru/short-convenient.json
generated
vendored
Normal file
68
node_modules/javascript-time-ago/locale-more-styles/ru/short-convenient.json
generated
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
{
|
||||
"year": {
|
||||
"previous": "в прошлом г.",
|
||||
"current": "в этом г.",
|
||||
"next": "в след. г.",
|
||||
"past": {
|
||||
"many": "{0} л. назад",
|
||||
"other": "{0} г. назад"
|
||||
},
|
||||
"future": {
|
||||
"many": "через {0} л.",
|
||||
"other": "через {0} г."
|
||||
}
|
||||
},
|
||||
"quarter": {
|
||||
"previous": "последний кв.",
|
||||
"current": "текущий кв.",
|
||||
"next": "следующий кв.",
|
||||
"past": "{0} кв. назад",
|
||||
"future": "через {0} кв."
|
||||
},
|
||||
"month": {
|
||||
"previous": "в прошлом мес.",
|
||||
"current": "в этом мес.",
|
||||
"next": "в следующем мес.",
|
||||
"past": "{0} мес. назад",
|
||||
"future": "через {0} мес."
|
||||
},
|
||||
"week": {
|
||||
"previous": "на прошлой нед.",
|
||||
"current": "на этой нед.",
|
||||
"next": "на следующей нед.",
|
||||
"past": "{0} нед. назад",
|
||||
"future": "через {0} нед."
|
||||
},
|
||||
"day": {
|
||||
"previous": "вчера",
|
||||
"current": "сегодня",
|
||||
"next": "завтра",
|
||||
"past": "{0} дн. назад",
|
||||
"future": "через {0} дн."
|
||||
},
|
||||
"hour": {
|
||||
"current": "в этот час",
|
||||
"past": {
|
||||
"one": "{0} ч. назад",
|
||||
"other": "{0} ч. назад"
|
||||
},
|
||||
"future": {
|
||||
"one": "через {0} ч.",
|
||||
"other": "через {0} ч."
|
||||
}
|
||||
},
|
||||
"minute": {
|
||||
"current": "в эту минуту",
|
||||
"past": "{0} мин. назад",
|
||||
"future": "через {0} мин."
|
||||
},
|
||||
"second": {
|
||||
"current": "сейчас",
|
||||
"past": "{0} сек. назад",
|
||||
"future": "через {0} сек."
|
||||
},
|
||||
"now": {
|
||||
"past": "только что",
|
||||
"future": "сейчас"
|
||||
}
|
||||
}
|
||||
19
node_modules/javascript-time-ago/locale-more-styles/ru/short-time.json
generated
vendored
Normal file
19
node_modules/javascript-time-ago/locale-more-styles/ru/short-time.json
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"year": {
|
||||
"many": "{0} л.",
|
||||
"other": "{0} г."
|
||||
},
|
||||
"month": "{0} мес.",
|
||||
"week": "{0} нед.",
|
||||
"day": {
|
||||
"one": "{0} д.",
|
||||
"other": "{0} дн."
|
||||
},
|
||||
"hour": "{0} ч.",
|
||||
"minute": "{0} мин.",
|
||||
"second": "{0} сек.",
|
||||
"now": {
|
||||
"past": "только что",
|
||||
"future": "сейчас"
|
||||
}
|
||||
}
|
||||
9
node_modules/javascript-time-ago/locale-more-styles/ru/tiny.json
generated
vendored
Normal file
9
node_modules/javascript-time-ago/locale-more-styles/ru/tiny.json
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"year": "{0}г",
|
||||
"month": "{0}мес",
|
||||
"week": "{0}нед",
|
||||
"day": "{0}д",
|
||||
"hour": "{0}ч",
|
||||
"minute": "{0}м",
|
||||
"second": "{0}с"
|
||||
}
|
||||
11
node_modules/javascript-time-ago/locale/af/index.js
generated
vendored
Normal file
11
node_modules/javascript-time-ago/locale/af/index.js
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
var locale = require('relative-time-format/locale/af')
|
||||
|
||||
module.exports = {
|
||||
locale: locale.locale,
|
||||
// Standard styles.
|
||||
long: locale.long,
|
||||
short: locale.short,
|
||||
narrow: locale.narrow,
|
||||
// Quantifier.
|
||||
quantify: locale.quantify
|
||||
}
|
||||
11
node_modules/javascript-time-ago/locale/am/index.js
generated
vendored
Normal file
11
node_modules/javascript-time-ago/locale/am/index.js
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
var locale = require('relative-time-format/locale/am')
|
||||
|
||||
module.exports = {
|
||||
locale: locale.locale,
|
||||
// Standard styles.
|
||||
long: locale.long,
|
||||
short: locale.short,
|
||||
narrow: locale.narrow,
|
||||
// Quantifier.
|
||||
quantify: locale.quantify
|
||||
}
|
||||
11
node_modules/javascript-time-ago/locale/ar-AE/index.js
generated
vendored
Normal file
11
node_modules/javascript-time-ago/locale/ar-AE/index.js
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
var locale = require('relative-time-format/locale/ar-AE')
|
||||
|
||||
module.exports = {
|
||||
locale: locale.locale,
|
||||
// Standard styles.
|
||||
long: locale.long,
|
||||
short: locale.short,
|
||||
narrow: locale.narrow,
|
||||
// Quantifier.
|
||||
quantify: locale.quantify
|
||||
}
|
||||
11
node_modules/javascript-time-ago/locale/ar/index.js
generated
vendored
Normal file
11
node_modules/javascript-time-ago/locale/ar/index.js
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
var locale = require('relative-time-format/locale/ar')
|
||||
|
||||
module.exports = {
|
||||
locale: locale.locale,
|
||||
// Standard styles.
|
||||
long: locale.long,
|
||||
short: locale.short,
|
||||
narrow: locale.narrow,
|
||||
// Quantifier.
|
||||
quantify: locale.quantify
|
||||
}
|
||||
11
node_modules/javascript-time-ago/locale/as/index.js
generated
vendored
Normal file
11
node_modules/javascript-time-ago/locale/as/index.js
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
var locale = require('relative-time-format/locale/as')
|
||||
|
||||
module.exports = {
|
||||
locale: locale.locale,
|
||||
// Standard styles.
|
||||
long: locale.long,
|
||||
short: locale.short,
|
||||
narrow: locale.narrow,
|
||||
// Quantifier.
|
||||
quantify: locale.quantify
|
||||
}
|
||||
11
node_modules/javascript-time-ago/locale/ast/index.js
generated
vendored
Normal file
11
node_modules/javascript-time-ago/locale/ast/index.js
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
var locale = require('relative-time-format/locale/ast')
|
||||
|
||||
module.exports = {
|
||||
locale: locale.locale,
|
||||
// Standard styles.
|
||||
long: locale.long,
|
||||
short: locale.short,
|
||||
narrow: locale.narrow,
|
||||
// Quantifier.
|
||||
quantify: locale.quantify
|
||||
}
|
||||
11
node_modules/javascript-time-ago/locale/az/index.js
generated
vendored
Normal file
11
node_modules/javascript-time-ago/locale/az/index.js
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
var locale = require('relative-time-format/locale/az')
|
||||
|
||||
module.exports = {
|
||||
locale: locale.locale,
|
||||
// Standard styles.
|
||||
long: locale.long,
|
||||
short: locale.short,
|
||||
narrow: locale.narrow,
|
||||
// Quantifier.
|
||||
quantify: locale.quantify
|
||||
}
|
||||
11
node_modules/javascript-time-ago/locale/be/index.js
generated
vendored
Normal file
11
node_modules/javascript-time-ago/locale/be/index.js
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
var locale = require('relative-time-format/locale/be')
|
||||
|
||||
module.exports = {
|
||||
locale: locale.locale,
|
||||
// Standard styles.
|
||||
long: locale.long,
|
||||
short: locale.short,
|
||||
narrow: locale.narrow,
|
||||
// Quantifier.
|
||||
quantify: locale.quantify
|
||||
}
|
||||
11
node_modules/javascript-time-ago/locale/bg/index.js
generated
vendored
Normal file
11
node_modules/javascript-time-ago/locale/bg/index.js
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
var locale = require('relative-time-format/locale/bg')
|
||||
|
||||
module.exports = {
|
||||
locale: locale.locale,
|
||||
// Standard styles.
|
||||
long: locale.long,
|
||||
short: locale.short,
|
||||
narrow: locale.narrow,
|
||||
// Quantifier.
|
||||
quantify: locale.quantify
|
||||
}
|
||||
11
node_modules/javascript-time-ago/locale/bn/index.js
generated
vendored
Normal file
11
node_modules/javascript-time-ago/locale/bn/index.js
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
var locale = require('relative-time-format/locale/bn')
|
||||
|
||||
module.exports = {
|
||||
locale: locale.locale,
|
||||
// Standard styles.
|
||||
long: locale.long,
|
||||
short: locale.short,
|
||||
narrow: locale.narrow,
|
||||
// Quantifier.
|
||||
quantify: locale.quantify
|
||||
}
|
||||
11
node_modules/javascript-time-ago/locale/br/index.js
generated
vendored
Normal file
11
node_modules/javascript-time-ago/locale/br/index.js
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
var locale = require('relative-time-format/locale/br')
|
||||
|
||||
module.exports = {
|
||||
locale: locale.locale,
|
||||
// Standard styles.
|
||||
long: locale.long,
|
||||
short: locale.short,
|
||||
narrow: locale.narrow,
|
||||
// Quantifier.
|
||||
quantify: locale.quantify
|
||||
}
|
||||
11
node_modules/javascript-time-ago/locale/bs-Cyrl/index.js
generated
vendored
Normal file
11
node_modules/javascript-time-ago/locale/bs-Cyrl/index.js
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
var locale = require('relative-time-format/locale/bs-Cyrl')
|
||||
|
||||
module.exports = {
|
||||
locale: locale.locale,
|
||||
// Standard styles.
|
||||
long: locale.long,
|
||||
short: locale.short,
|
||||
narrow: locale.narrow,
|
||||
// Quantifier.
|
||||
quantify: locale.quantify
|
||||
}
|
||||
11
node_modules/javascript-time-ago/locale/bs/index.js
generated
vendored
Normal file
11
node_modules/javascript-time-ago/locale/bs/index.js
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
var locale = require('relative-time-format/locale/bs')
|
||||
|
||||
module.exports = {
|
||||
locale: locale.locale,
|
||||
// Standard styles.
|
||||
long: locale.long,
|
||||
short: locale.short,
|
||||
narrow: locale.narrow,
|
||||
// Quantifier.
|
||||
quantify: locale.quantify
|
||||
}
|
||||
11
node_modules/javascript-time-ago/locale/ca/index.js
generated
vendored
Normal file
11
node_modules/javascript-time-ago/locale/ca/index.js
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
var locale = require('relative-time-format/locale/ca')
|
||||
|
||||
module.exports = {
|
||||
locale: locale.locale,
|
||||
// Standard styles.
|
||||
long: locale.long,
|
||||
short: locale.short,
|
||||
narrow: locale.narrow,
|
||||
// Quantifier.
|
||||
quantify: locale.quantify
|
||||
}
|
||||
9
node_modules/javascript-time-ago/locale/ccp/index.js
generated
vendored
Normal file
9
node_modules/javascript-time-ago/locale/ccp/index.js
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
var locale = require('relative-time-format/locale/ccp')
|
||||
|
||||
module.exports = {
|
||||
locale: locale.locale,
|
||||
// Standard styles.
|
||||
long: locale.long,
|
||||
short: locale.short,
|
||||
narrow: locale.narrow
|
||||
}
|
||||
11
node_modules/javascript-time-ago/locale/ce/index.js
generated
vendored
Normal file
11
node_modules/javascript-time-ago/locale/ce/index.js
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
var locale = require('relative-time-format/locale/ce')
|
||||
|
||||
module.exports = {
|
||||
locale: locale.locale,
|
||||
// Standard styles.
|
||||
long: locale.long,
|
||||
short: locale.short,
|
||||
narrow: locale.narrow,
|
||||
// Quantifier.
|
||||
quantify: locale.quantify
|
||||
}
|
||||
11
node_modules/javascript-time-ago/locale/chr/index.js
generated
vendored
Normal file
11
node_modules/javascript-time-ago/locale/chr/index.js
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
var locale = require('relative-time-format/locale/chr')
|
||||
|
||||
module.exports = {
|
||||
locale: locale.locale,
|
||||
// Standard styles.
|
||||
long: locale.long,
|
||||
short: locale.short,
|
||||
narrow: locale.narrow,
|
||||
// Quantifier.
|
||||
quantify: locale.quantify
|
||||
}
|
||||
11
node_modules/javascript-time-ago/locale/cs/index.js
generated
vendored
Normal file
11
node_modules/javascript-time-ago/locale/cs/index.js
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
var locale = require('relative-time-format/locale/cs')
|
||||
|
||||
module.exports = {
|
||||
locale: locale.locale,
|
||||
// Standard styles.
|
||||
long: locale.long,
|
||||
short: locale.short,
|
||||
narrow: locale.narrow,
|
||||
// Quantifier.
|
||||
quantify: locale.quantify
|
||||
}
|
||||
11
node_modules/javascript-time-ago/locale/cy/index.js
generated
vendored
Normal file
11
node_modules/javascript-time-ago/locale/cy/index.js
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
var locale = require('relative-time-format/locale/cy')
|
||||
|
||||
module.exports = {
|
||||
locale: locale.locale,
|
||||
// Standard styles.
|
||||
long: locale.long,
|
||||
short: locale.short,
|
||||
narrow: locale.narrow,
|
||||
// Quantifier.
|
||||
quantify: locale.quantify
|
||||
}
|
||||
11
node_modules/javascript-time-ago/locale/da/index.js
generated
vendored
Normal file
11
node_modules/javascript-time-ago/locale/da/index.js
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
var locale = require('relative-time-format/locale/da')
|
||||
|
||||
module.exports = {
|
||||
locale: locale.locale,
|
||||
// Standard styles.
|
||||
long: locale.long,
|
||||
short: locale.short,
|
||||
narrow: locale.narrow,
|
||||
// Quantifier.
|
||||
quantify: locale.quantify
|
||||
}
|
||||
13
node_modules/javascript-time-ago/locale/de/index.js
generated
vendored
Normal file
13
node_modules/javascript-time-ago/locale/de/index.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
var locale = require('relative-time-format/locale/de')
|
||||
|
||||
module.exports = {
|
||||
locale: locale.locale,
|
||||
// Standard styles.
|
||||
long: locale.long,
|
||||
short: locale.short,
|
||||
narrow: locale.narrow,
|
||||
// Additional styles.
|
||||
'long-time': require('../../locale-more-styles/de/long-time.json'),
|
||||
// Quantifier.
|
||||
quantify: locale.quantify
|
||||
}
|
||||
11
node_modules/javascript-time-ago/locale/dsb/index.js
generated
vendored
Normal file
11
node_modules/javascript-time-ago/locale/dsb/index.js
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
var locale = require('relative-time-format/locale/dsb')
|
||||
|
||||
module.exports = {
|
||||
locale: locale.locale,
|
||||
// Standard styles.
|
||||
long: locale.long,
|
||||
short: locale.short,
|
||||
narrow: locale.narrow,
|
||||
// Quantifier.
|
||||
quantify: locale.quantify
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user