dark-sky-api
Advanced tools
Comparing version 0.5.0 to 0.5.1
@@ -63,3 +63,3 @@ 'use strict'; | ||
this.loadPositionAsync = DarkSkyApi.loadPositionAsync; | ||
this.loadPosition = DarkSkyApi.loadPosition; | ||
@@ -147,3 +147,3 @@ this.darkSkyApi = new _darkSkySkeleton2.default(apiKey, proxyUrl); | ||
if (!this.initialized) { | ||
return this.loadPositionAsync().then(function (position) { | ||
return this.loadPosition().then(function (position) { | ||
return _this2.initialize(position).loadCurrent(); | ||
@@ -170,4 +170,4 @@ }); | ||
if (!this.initialized) { | ||
return this.loadPositionAsync().then(function (position) { | ||
return _this3.initialize(position).loadCurrent(); | ||
return this.loadPosition().then(function (position) { | ||
return _this3.initialize(position).loadForecast(); | ||
}); | ||
@@ -177,10 +177,8 @@ } | ||
return val != 'daily'; | ||
}).join(',')).get().then(function (_ref3) { | ||
var daily = _ref3.daily; | ||
daily.data = daily.data.map(function (item) { | ||
}).join(',')).get().then(function (data) { | ||
data.daily.data = data.daily.data.map(function (item) { | ||
return _this3.processWeatherItem(item); | ||
}); | ||
daily.updatedDateTime = (0, _moment2.default)(); | ||
return daily; | ||
data.daily.updatedDateTime = (0, _moment2.default)(); | ||
return data; | ||
}); | ||
@@ -201,4 +199,4 @@ } | ||
if (!this.initialized) { | ||
return this.loadPositionAsync().then(function (position) { | ||
return _this4.initialize(position).loadCurrent(); | ||
return this.loadPosition().then(function (position) { | ||
return _this4.initialize(position).loadItAll(excludesBlock); | ||
}); | ||
@@ -363,3 +361,3 @@ } | ||
* Get today's weather - Promise | ||
* @param {object} [position] - if omitted will use loadPositionAsync | ||
* @param {object} [position] - if omitted will use loadPosition | ||
*/ | ||
@@ -380,3 +378,3 @@ | ||
* Get forecasted week of weather - Promise | ||
* @param {object} [position] - if omitted api will use loadPositionAsync | ||
* @param {object} [position] - if omitted api will use loadPosition | ||
*/ | ||
@@ -399,3 +397,3 @@ | ||
* @param {string} excludesBlock - pass comma separated excludes | ||
* @param {object} [position] - if omitted api will use loadPositionAsync | ||
* @param {object} [position] - if omitted api will use loadPosition | ||
*/ | ||
@@ -493,3 +491,3 @@ | ||
DarkSkyApi.loadPositionAsync = function () { | ||
DarkSkyApi.loadPosition = function () { | ||
return (0, _geoLocUtils.getNavigatorCoords)(); | ||
@@ -496,0 +494,0 @@ }; |
{ | ||
"name": "dark-sky-api", | ||
"version": "0.5.0", | ||
"version": "0.5.1", | ||
"description": "a simple and robust dark sky api service for client-side js", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -103,3 +103,3 @@ import darkSkySkeleton from 'dark-sky-skeleton'; | ||
if (!this.initialized) { | ||
return this.loadPositionAsync() | ||
return this.loadPosition() | ||
.then(position => this.initialize(position).loadCurrent()); | ||
@@ -120,4 +120,4 @@ } | ||
if (!this.initialized) { | ||
return this.loadPositionAsync() | ||
.then(position => this.initialize(position).loadCurrent()); | ||
return this.loadPosition() | ||
.then(position => this.initialize(position).loadForecast()); | ||
} | ||
@@ -129,6 +129,6 @@ return this.darkSkyApi | ||
.get() | ||
.then(({ daily }) => { | ||
daily.data = daily.data.map(item => this.processWeatherItem(item)); | ||
daily.updatedDateTime = moment(); | ||
return daily; | ||
.then((data) => { | ||
data.daily.data = data.daily.data.map(item => this.processWeatherItem(item)); | ||
data.daily.updatedDateTime = moment(); | ||
return data; | ||
}); | ||
@@ -144,4 +144,4 @@ } | ||
if (!this.initialized) { | ||
return this.loadPositionAsync() | ||
.then(position => this.initialize(position).loadCurrent()); | ||
return this.loadPosition() | ||
.then(position => this.initialize(position).loadItAll(excludesBlock)); | ||
} | ||
@@ -216,3 +216,3 @@ return this.darkSkyApi | ||
*/ | ||
loadPositionAsync = DarkSkyApi.loadPositionAsync; | ||
loadPosition = DarkSkyApi.loadPosition; | ||
@@ -231,3 +231,3 @@ static _api; | ||
*/ | ||
static loadPositionAsync = () => getNavigatorCoords(); | ||
static loadPosition = () => getNavigatorCoords(); | ||
@@ -294,3 +294,3 @@ /** | ||
* Get today's weather - Promise | ||
* @param {object} [position] - if omitted will use loadPositionAsync | ||
* @param {object} [position] - if omitted will use loadPosition | ||
*/ | ||
@@ -310,3 +310,3 @@ static loadCurrent(position) { | ||
* Get forecasted week of weather - Promise | ||
* @param {object} [position] - if omitted api will use loadPositionAsync | ||
* @param {object} [position] - if omitted api will use loadPosition | ||
*/ | ||
@@ -328,3 +328,3 @@ static loadForecast(position) { | ||
* @param {string} excludesBlock - pass comma separated excludes | ||
* @param {object} [position] - if omitted api will use loadPositionAsync | ||
* @param {object} [position] - if omitted api will use loadPosition | ||
*/ | ||
@@ -331,0 +331,0 @@ static loadItAll(excludesBlock, position) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
37930
909