From a5ae25f029ea0b0040545b65b4c3b7a30031242f Mon Sep 17 00:00:00 2001 From: maxlath Date: Wed, 29 Mar 2017 12:51:51 +0200 Subject: [PATCH] helpers: removed normalizeWikidataTime legacy alias --- lib/helpers/helpers.js | 3 --- test/general.js | 2 -- test/helpers.js | 10 +++++----- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/lib/helpers/helpers.js b/lib/helpers/helpers.js index c3ff2926..acc949a2 100644 --- a/lib/helpers/helpers.js +++ b/lib/helpers/helpers.js @@ -15,7 +15,4 @@ helpers.wikidataTimeToISOString = function (wikidataTime) { return wikidataTimeToDateObject(wikidataTime).toISOString() } -// keeping normalizeWikidataTime as legacy -helpers.normalizeWikidataTime = helpers.wikidataTimeToEpochTime - module.exports = helpers diff --git a/test/general.js b/test/general.js index 0fb23116..ec5762ac 100644 --- a/test/general.js +++ b/test/general.js @@ -31,7 +31,6 @@ describe('general', function () { helpers.wikidataTimeToDateObject.should.be.a.Function() helpers.wikidataTimeToEpochTime.should.be.a.Function() helpers.wikidataTimeToISOString.should.be.a.Function() - helpers.normalizeWikidataTime.should.be.a.Function() wdk.isEntityId.should.be.a.Function() wdk.isItemId.should.be.a.Function() @@ -39,7 +38,6 @@ describe('general', function () { wdk.wikidataTimeToDateObject.should.be.a.Function() wdk.wikidataTimeToEpochTime.should.be.a.Function() wdk.wikidataTimeToISOString.should.be.a.Function() - wdk.normalizeWikidataTime.should.be.a.Function() done() }) }) diff --git a/test/helpers.js b/test/helpers.js index 4e16f409..de9a5040 100644 --- a/test/helpers.js +++ b/test/helpers.js @@ -15,7 +15,7 @@ describe('helpers', function () { const negativeWdTime = '-0044-03-15T00:00:00Z' const negativeEpoch = -63549360000000 - describe('normalizeWikidataTime', function () { + describe('wikidataTimeToEpochTime', function () { it('env', function (done) { new Date(epoch).toISOString().should.equal(ISOtime) new Date(negativeEpoch).toISOString().should.equal(ISOnegativeTime) @@ -23,22 +23,22 @@ describe('helpers', function () { }) it('should return a number (epoch time)', function (done) { - helpers.normalizeWikidataTime(wdTime).should.be.a.Number() + helpers.wikidataTimeToEpochTime(wdTime).should.be.a.Number() done() }) it('should return a number for negative time', function (done) { - helpers.normalizeWikidataTime(negativeWdTime).should.be.a.Number() + helpers.wikidataTimeToEpochTime(negativeWdTime).should.be.a.Number() done() }) it('should return the right number', function (done) { - helpers.normalizeWikidataTime(wdTime).should.equal(epoch) + helpers.wikidataTimeToEpochTime(wdTime).should.equal(epoch) done() }) it('should return the right number for negative time too', function (done) { - helpers.normalizeWikidataTime(negativeWdTime).should.equal(negativeEpoch) + helpers.wikidataTimeToEpochTime(negativeWdTime).should.equal(negativeEpoch) done() }) })