From 53bc482f15734531d1be4a62c9261b29169fe9a4 Mon Sep 17 00:00:00 2001 From: bredele Date: Fri, 6 Apr 2018 12:02:05 -0600 Subject: [PATCH] Use data-resolve to parse dates --- index.js | 18 +++++------------- package.json | 9 ++++++--- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/index.js b/index.js index 2212017..f32d03c 100644 --- a/index.js +++ b/index.js @@ -1,3 +1,8 @@ +/** + * Dependencie + */ + +const parse = require('date-resolve') /** @@ -26,16 +31,3 @@ module.exports = (arr, limit, soon = 0) => { }) return obj } - - -/** - * Parse given time into a date in ms. - * - * @param {Date|Number|String} time - * @return {Number} - * @api private - */ - -function parse (time) { - return typeof time === 'number' ? time : Date.parse(time) -} diff --git a/package.json b/package.json index ef0ac1c..2028b67 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,13 @@ { "name": "runout", - "version": "1.0.0", + "version": "1.0.1", "description": "Helper to know if something is running out of time or not", "main": "index.js", "directories": { "test": "test" }, - "engines" : { - "node" : ">8.0.0" + "engines": { + "node": ">8.0.0" }, "scripts": { "test": "tape test/*.js" @@ -30,5 +30,8 @@ "homepage": "https://github.com/bredele/runout#readme", "devDependencies": { "tape": "^4.9.0" + }, + "dependencies": { + "date-resolve": "^1.0.0" } }