diff --git a/dist/holidayapi.js b/dist/holidayapi.js index 571dafa..90fbcc9 100644 --- a/dist/holidayapi.js +++ b/dist/holidayapi.js @@ -56,15 +56,15 @@ var HolidayAPI = (function () { var getYours = 'get yours at HolidayAPI.com'; var uuidRegExp = /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/; if (!key) { - throw new Error("Missing API key, " + getYours); + throw new Error("Missing API key, ".concat(getYours)); } if (!uuidRegExp.test(key)) { - throw new Error("Invalid API key, " + getYours); + throw new Error("Invalid API key, ".concat(getYours)); } if (version !== 1) { throw new Error('Invalid version number, expected "1"'); } - this.baseUrl = "https://holidayapi.com/v" + version + "/"; + this.baseUrl = "https://holidayapi.com/v".concat(version, "/"); this.key = key; } HolidayAPI.prototype.createUrl = function (endpoint, request) { @@ -78,7 +78,7 @@ var HolidayAPI = (function () { var response, payload, err_1; return __generator(this, function (_a) { switch (_a.label) { - case 0: return [4, node_fetch_1.default(this.createUrl(endpoint, request))]; + case 0: return [4, (0, node_fetch_1.default)(this.createUrl(endpoint, request))]; case 1: response = _a.sent(); _a.label = 2; @@ -112,15 +112,6 @@ var HolidayAPI = (function () { if (request === void 0) { request = {}; } return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { - if (!request.country) { - throw new Error('Missing country'); - } - else if (!request.year) { - throw new Error('Missing year'); - } - else if (request.previous && request.upcoming) { - throw new Error('Previous and upcoming are mutually exclusive'); - } return [2, this.request('holidays', request)]; }); }); @@ -136,18 +127,6 @@ var HolidayAPI = (function () { if (request === void 0) { request = {}; } return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { - if (!request.country) { - throw new Error('Missing country'); - } - else if (!request.start) { - throw new Error('Missing start date'); - } - else if (!request.days) { - throw new Error('Missing days'); - } - else if (request.days < 1) { - throw new Error('Days must be 1 or more'); - } return [2, this.request('workday', request)]; }); }); @@ -156,15 +135,6 @@ var HolidayAPI = (function () { if (request === void 0) { request = {}; } return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { - if (!request.country) { - throw new Error('Missing country'); - } - else if (!request.start) { - throw new Error('Missing start date'); - } - else if (!request.end) { - throw new Error('Missing end date'); - } return [2, this.request('workdays', request)]; }); }); diff --git a/dist/index.js b/dist/index.js index 0e0334d..ef36cc6 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,7 +1,11 @@ "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; diff --git a/package.json b/package.json index 72beced..99d0ea5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "holidayapi", - "version": "6.0.0", + "version": "6.0.1", "description": "Official Node.js library for Holiday API", "main": "dist/index.js", "types": "dist/index.d.ts",