fix: forgot to rebuild

This commit is contained in:
Josh Sherman 2022-04-06 08:46:22 -05:00
parent 046aadeea4
commit 5a62ac8b5f
3 changed files with 10 additions and 36 deletions

38
dist/holidayapi.js vendored
View file

@ -56,15 +56,15 @@ var HolidayAPI = (function () {
var getYours = 'get yours at HolidayAPI.com'; 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}/; var uuidRegExp = /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/;
if (!key) { if (!key) {
throw new Error("Missing API key, " + getYours); throw new Error("Missing API key, ".concat(getYours));
} }
if (!uuidRegExp.test(key)) { if (!uuidRegExp.test(key)) {
throw new Error("Invalid API key, " + getYours); throw new Error("Invalid API key, ".concat(getYours));
} }
if (version !== 1) { if (version !== 1) {
throw new Error('Invalid version number, expected "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; this.key = key;
} }
HolidayAPI.prototype.createUrl = function (endpoint, request) { HolidayAPI.prototype.createUrl = function (endpoint, request) {
@ -78,7 +78,7 @@ var HolidayAPI = (function () {
var response, payload, err_1; var response, payload, err_1;
return __generator(this, function (_a) { return __generator(this, function (_a) {
switch (_a.label) { 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: case 1:
response = _a.sent(); response = _a.sent();
_a.label = 2; _a.label = 2;
@ -112,15 +112,6 @@ var HolidayAPI = (function () {
if (request === void 0) { request = {}; } if (request === void 0) { request = {}; }
return __awaiter(this, void 0, void 0, function () { return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) { 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)]; return [2, this.request('holidays', request)];
}); });
}); });
@ -136,18 +127,6 @@ var HolidayAPI = (function () {
if (request === void 0) { request = {}; } if (request === void 0) { request = {}; }
return __awaiter(this, void 0, void 0, function () { return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) { 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)]; return [2, this.request('workday', request)];
}); });
}); });
@ -156,15 +135,6 @@ var HolidayAPI = (function () {
if (request === void 0) { request = {}; } if (request === void 0) { request = {}; }
return __awaiter(this, void 0, void 0, function () { return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) { 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)]; return [2, this.request('workdays', request)];
}); });
}); });

6
dist/index.js vendored
View file

@ -1,7 +1,11 @@
"use strict"; "use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k; 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) { }) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k; if (k2 === undefined) k2 = k;
o[k2] = m[k]; o[k2] = m[k];

View file

@ -1,6 +1,6 @@
{ {
"name": "holidayapi", "name": "holidayapi",
"version": "6.0.0", "version": "6.0.1",
"description": "Official Node.js library for Holiday API", "description": "Official Node.js library for Holiday API",
"main": "dist/index.js", "main": "dist/index.js",
"types": "dist/index.d.ts", "types": "dist/index.d.ts",