From 998efe9c73498b765f24631bac93929e0c1925b1 Mon Sep 17 00:00:00 2001 From: Amir Sarabadani Date: Mon, 6 Jul 2020 21:33:12 +0200 Subject: [PATCH 1/2] Remove several methods - GlobeCoordinate. getDecimal has not been used since a50a48e5cedcb5 - QuantityValue.get(UpperBound|LowerBound|Amount) has not been used since fadb3ab8b5c --- .../globeCoordinate.GlobeCoordinate.js | 12 --------- src/values/QuantityValue.js | 27 ------------------- .../globeCoordinate.GlobeCoordinate.tests.js | 23 +++------------- 3 files changed, 3 insertions(+), 59 deletions(-) diff --git a/lib/globeCoordinate/globeCoordinate.GlobeCoordinate.js b/lib/globeCoordinate/globeCoordinate.GlobeCoordinate.js index ba4d1a9..d408e28 100644 --- a/lib/globeCoordinate/globeCoordinate.GlobeCoordinate.js +++ b/lib/globeCoordinate/globeCoordinate.GlobeCoordinate.js @@ -107,18 +107,6 @@ */ getPrecision: function() { return this._precision; }, - /** - * @return {Object} - * @private - */ - getDecimal: function() { - return { - latitude: this._latitude, - longitude: this._longitude, - precision: this._precision - }; - }, - /** * Compares the object to another GlobeCoordinate object and returns whether both represent * the same information. diff --git a/src/values/QuantityValue.js b/src/values/QuantityValue.js index aff5681..4dcee45 100644 --- a/src/values/QuantityValue.js +++ b/src/values/QuantityValue.js @@ -80,15 +80,6 @@ var SELF return this; }, - /** - * Returns the amount held by this quantity, as a string in standard format. - * - * @return {string} - */ - getAmount: function() { - return this._amount; - }, - /** * Returns the unit held by this quantity. Returns null in case of unit-less quantities. * @@ -98,24 +89,6 @@ var SELF return this._unit; }, - /** - * Returns the quantity's lower boundary. - * - * @return {dataValues.DecimalValue|null} - */ - getLowerBound: function() { - return this._lowerBound; - }, - - /** - * Returns the quantity's upper boundary. - * - * @return {dataValues.DecimalValue|null} - */ - getUpperBound: function() { - return this._upperBound; - }, - /** * @inheritdoc */ diff --git a/tests/lib/globeCoordinate/globeCoordinate.GlobeCoordinate.tests.js b/tests/lib/globeCoordinate/globeCoordinate.GlobeCoordinate.tests.js index 117436e..440dad3 100644 --- a/tests/lib/globeCoordinate/globeCoordinate.GlobeCoordinate.tests.js +++ b/tests/lib/globeCoordinate/globeCoordinate.GlobeCoordinate.tests.js @@ -9,7 +9,7 @@ QUnit.module( 'globeCoordinate.GlobeCoordinate.js' ); QUnit.test( 'Basic checks', function( assert ) { - assert.expect( 9 ); + assert.expect( 8 ); var c; assert.throws( @@ -59,16 +59,10 @@ 'http://www.wikidata.org/entity/Q2', 'Verified getGlobe()' ); - - assert.deepEqual( - c.getDecimal(), - { latitude: 1.5, longitude: 1.5, precision: 0.1 }, - 'Verified getDecimal()' - ); } ); QUnit.test( 'Precision defaults to null', function( assert ) { - assert.expect( 3 ); + assert.expect( 2 ); var c = new globeCoordinate.GlobeCoordinate( { latitude: 0, longitude: 0 } ); assert.ok( @@ -76,12 +70,6 @@ 'Verified getPrecision()' ); - assert.deepEqual( - c.getDecimal(), - { latitude: 0, longitude: 0, precision: null }, - 'Verified getDecimal()' - ); - assert.ok( c.equals( c ), 'Validated equality' @@ -89,7 +77,7 @@ } ); QUnit.test( 'Costum globe', function( assert ) { - assert.expect( 2 ); + assert.expect( 1 ); var c = new globeCoordinate.GlobeCoordinate( { latitude: 20, longitude: 25.5, @@ -101,11 +89,6 @@ 'http://www.wikidata.org/entity/Q313', 'Verified getGlobe()' ); - - assert.ok( - typeof c.getDecimal().globe === 'undefined', - 'Verified getDecimal()' - ); } ); QUnit.test( 'Strict (in)equality', function( assert ) { From 7976ba47e8cef01845084d0e1fc92d67ab185d47 Mon Sep 17 00:00:00 2001 From: Amir Sarabadani Date: Tue, 7 Jul 2020 18:04:33 +0200 Subject: [PATCH 2/2] Add release notes for the removed methods --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e84d217..54cc9b1 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,9 @@ mirrors most of the PHP implementations of DataValue classes as specified in the [![Build Status](https://secure.travis-ci.org/wmde/DataValuesJavaScript.png?branch=master)](http://travis-ci.org/wmde/DataValuesJavaScript) ## Release notes - +### 0.11.0 (dev) +* Removed `globeCoordinate.GlobeCoordinate.getDecimal` +* Removed `getLowerBound`, `getUpperBound`, `getAmount` from QuantityValue ### 0.10.0 (2017-10-06) * The library is now a pure JavaScript library. * Removed MediaWiki ResourceLoader module definitions.