| # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. | ||
| # yarn lockfile v1 | ||
| moment@^2.18.1: | ||
| version "2.18.1" | ||
| resolved "https://registry.yarnpkg.com/moment/-/moment-2.18.1.tgz#c36193dd3ce1c2eed2adb7c802dbbc77a81b1c0f" |
+17
-0
| 'use strict' | ||
| const moment = require('moment') | ||
| const list = require('./resources/users.json') | ||
@@ -8,1 +9,17 @@ const length = list.length | ||
| exports.get = () => list[Math.floor(Math.random() * length)] | ||
| exports.format = (time, locale) => { | ||
| let client = exports.get() | ||
| return { | ||
| client: client.GivenName + ' form ' + client.City + ', ' + client.CountryFull, | ||
| time: moment().locale(locale || 'en').subtract(Math.floor(Math.random() * time), 'seconds').fromNow() | ||
| } | ||
| } | ||
| exports.route = (time) => { | ||
| return (req, res) => { | ||
| res.send({ | ||
| payload: exports.format(time, res.locals.locale) | ||
| }) | ||
| } | ||
| } |
+5
-2
| { | ||
| "name": "fake-user", | ||
| "version": "1.0.0", | ||
| "version": "1.1.0", | ||
| "description": "Return a dummy user.", | ||
@@ -8,3 +8,6 @@ "main": "index.js", | ||
| "author": "Ion Suman", | ||
| "license": "MIT" | ||
| "license": "MIT", | ||
| "dependencies": { | ||
| "moment": "^2.18.1" | ||
| } | ||
| } |
933082
0.08%7
16.67%50021
0.03%1
Infinity%+ Added
+ Added