@hebcal/rest-api
Advanced tools
Comparing version 3.16.0 to 3.17.0
@@ -1,2 +0,2 @@ | ||
/*! @hebcal/rest-api v3.16.0 */ | ||
/*! @hebcal/rest-api v3.17.0 */ | ||
'use strict'; | ||
@@ -284,5 +284,5 @@ | ||
if (options.isHebrewYear || events.length == 0) { | ||
if (options.year && (options.isHebrewYear || events.length == 0)) { | ||
title += ' ' + options.year; | ||
} else { | ||
} else if (events.length) { | ||
const start = events[0].getDate().greg(); | ||
@@ -550,2 +550,11 @@ const end = events[events.length - 1].getDate().greg(); | ||
/** | ||
* @private | ||
* @param {Event} ev | ||
* @return {string} | ||
*/ | ||
function eventIsoDate(ev) { | ||
return toISOString(ev.getDate().greg()); | ||
} | ||
/** | ||
* Formats a list events for the classic Hebcal.com JSON API response | ||
@@ -558,2 +567,3 @@ * @param {Event[]} events | ||
function eventsToClassicApi(events, options, leyning = true) { | ||
@@ -565,2 +575,10 @@ const result = { | ||
result.location = locationToPlainObj(options.location); | ||
if (events.length) { | ||
result.range = { | ||
start: eventIsoDate(events[0]), | ||
end: eventIsoDate(events[events.length - 1]) | ||
}; | ||
} | ||
result.items = events.map(ev => eventToClassicApiObject(ev, options, leyning)); | ||
@@ -567,0 +585,0 @@ return result; |
{ | ||
"name": "@hebcal/rest-api", | ||
"version": "3.16.0", | ||
"version": "3.17.0", | ||
"author": "Michael J. Radwin (https://github.com/mjradwin)", | ||
@@ -24,3 +24,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@hebcal/core": "^3.37.2", | ||
"@hebcal/core": "^3.38.0", | ||
"@hebcal/leyning": "^4.13.3" | ||
@@ -60,5 +60,5 @@ }, | ||
"jsdoc-to-markdown": "^7.1.1", | ||
"rollup": "^2.72.1", | ||
"rollup": "^2.73.0", | ||
"rollup-plugin-terser": "^7.0.2" | ||
} | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
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
341327
6493
Updated@hebcal/core@^3.38.0