Skip to content

Commit

Permalink
Remove default exports (#17)
Browse files Browse the repository at this point in the history
removing default exports

BREAKING CHANGE: removing default export
  • Loading branch information
doniseferi authored Apr 12, 2020
1 parent 0fd1068 commit 0dc453e
Show file tree
Hide file tree
Showing 8 changed files with 273 additions and 250 deletions.
197 changes: 100 additions & 97 deletions README.md

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions src/declination/getDeclinationOfTheSun.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,12 @@ const declinationOfTheSunFactory = (sine, cosine, arcsine, getDayOfTheYear) => {
return Object.freeze({
/**
* The angular distance of the sun north or south of the earth's equator.
* @example <caption>Example usage of getDeclinationOfTheSun.</caption>
* @example <caption>Example usage of getDeclinationOfTheSun</caption>
* // returns -23.078780854838076
* suntimes.getDeclinationOfTheSun(new Date(2019, 0, 1));
* getDeclinationOfTheSun(new Date(2019, 0, 1));
* @param {Date} date - A date instance
* @returns {number} The declination in degrees where north is a positive value and south is a negative value within a range of range of -23.45 and 23.45.
* @function
*/
getDeclinationOfTheSun: (date) => getDeclinationOfTheSun(date)
});
Expand Down
5 changes: 3 additions & 2 deletions src/equationOfTime/equationOfTime.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
/**
* The correction between standard clock time and the time based on the exact position of the sun in the sky represented as decimal time in minutes.
* @example <caption>Example usage of equationOfTime.</caption>
* @example <caption>Example usage of equationOfTime</caption>
* // returns -10.306964615344999
* suntimes.equationOfTime(new Date(2025, 0, 18));
* equationOfTime(new Date(2025, 0, 18));
* @param {Date} date - A date instance.
* @returns {number} A number whose value is the equation of time in minutes decimal time for the Date represented by date.
* @function
*/
const equationOfTime = date => {
if (!date) {
Expand Down
3 changes: 2 additions & 1 deletion src/hourAngle/getHourAngle.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,14 @@ const getHourAngleFactory = (
* Gets the hour angle difference between noon and the angle value.
* @example <caption>Example usage of getHourAngleSinceNoon</caption>
* // returns 5.54554469317797
* suntimes.getHourAngleSinceNoon(new Date(2025, 0, 18), 51.477730, -12);
* getHourAngleSinceNoon(new Date(2025, 0, 18), 51.477730, -12);
* @param {Date} date - A date instance.
* @param {number} latitude - A latitude value in the range of -90 to 90.
* @param {number} angle - An angle value.
* @throws {RangeError} The sun altitude never elevates above the angle specified.
* @throws {RangeError} The sun altitude never drops below the angle specified.
* @returns {number} A number whose value represents the hour angle since noon for the date, latitude and angle value.
* @function
*/
getHourAngleSinceNoon: (date, latitude, angle) => getHourAngleSinceNoon(date, latitude, angle)
});
Expand Down
3 changes: 2 additions & 1 deletion src/hourAngle/getNoonHourAngle.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@ const getNoonHourAngleFactory = equationOfTime => {
* Gets the noon hour angle for the date and longitude value.
* @example <caption>Example usage of getNoonHourAngle</caption>
* // returns 12.17245941025575
* suntimes.getNoonHourAngle(new Date(2025, 0, 18), -0.010150);
* getNoonHourAngle(new Date(2025, 0, 18), -0.010150);
* @param {Date} date - A date instance.
* @param {number} longitude - A longitude value in the range of -180 to 180.
* @returns {number} The noon hour angle expressed as a number between 0.00 and 23.9.
* @function
*/
getNoonHourAngle: (date, longitude) => getNoonHourAngle(date, longitude)
});
Expand Down
31 changes: 5 additions & 26 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,47 +22,26 @@ import {
getCivilDuskStartDateTimeUtc
} from './time/index';

const suntimes = Object.freeze({
getNoonDateTimeUtc,
getDateTimeUtcOfAngleBeforeNoon,
getDateTimeUtcOfAngleAfterNoon,
export {
getSunriseDateTimeUtc,
getSunsetDateTimeUtc,
getNoonDateTimeUtc,
getCivilDawnEndDateTimeUtc,
getCivilDawnStartDateTimeUtc,
getNauticalDawnEndDateTimeUtc,
getNauticalDawnStartDateTimeUtc,
getAstronomicalDawnEndDateTimeUtc,
getAstronomicalDawnStartDateTimeUtc,
getAstronomicalDuskStartDateTimeUtc,
getAstronomicalDuskEndDateTimeUtc,
getAstronomicalDuskStartDateTimeUtc,
getNauticalDuskEndDateTimeUtc,
getNauticalDuskStartDateTimeUtc,
getCivilDuskEndDateTimeUtc,
getCivilDuskStartDateTimeUtc
});

export default suntimes;
export {
getCivilDuskStartDateTimeUtc,
getDeclinationOfTheSun,
equationOfTime,
getHourAngleSinceNoon,
getNoonHourAngle,
getNoonDateTimeUtc,
getDateTimeUtcOfAngleBeforeNoon,
getDateTimeUtcOfAngleAfterNoon,
getSunriseDateTimeUtc,
getSunsetDateTimeUtc,
getCivilDawnEndDateTimeUtc,
getCivilDawnStartDateTimeUtc,
getNauticalDawnEndDateTimeUtc,
getNauticalDawnStartDateTimeUtc,
getAstronomicalDawnEndDateTimeUtc,
getAstronomicalDawnStartDateTimeUtc,
getAstronomicalDuskStartDateTimeUtc,
getAstronomicalDuskEndDateTimeUtc,
getNauticalDuskEndDateTimeUtc,
getNauticalDuskStartDateTimeUtc,
getCivilDuskEndDateTimeUtc,
getCivilDuskStartDateTimeUtc
getDateTimeUtcOfAngleAfterNoon
};
109 changes: 63 additions & 46 deletions src/time/index.js

Large diffs are not rendered by default.

Loading

0 comments on commit 0dc453e

Please sign in to comment.