Add node_modules

This commit is contained in:
Clarence Chan committed 2023-09-13 16:03:14 -04:00
1 parent 1df571f777
commit c01615d999
530 files changed
+38186

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = foldLine;
function foldLine(line) {
var parts = [];
var length = 75;
while (line.length > length) {
parts.push(line.slice(0, length));
line = line.slice(length);
length = 74;
}
parts.push(line);
return parts.join('\r\n\t');
}
+49
View File
@@ -0,0 +1,49 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = formatDate;
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
var pad = function pad(n) {
return n < 10 ? "0".concat(n) : "".concat(n);
};
function formatDate() {
var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
var outputType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'utc';
var inputType = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'local';
if (Array.isArray(args) && args.length === 3) {
var _args = _slicedToArray(args, 3),
year = _args[0],
month = _args[1],
date = _args[2];
return "".concat(year).concat(pad(month)).concat(pad(date));
}
var outDate = new Date();
if (Array.isArray(args) && args.length > 0 && args[0]) {
var _args2 = _slicedToArray(args, 6),
_year = _args2[0],
_month = _args2[1],
_date = _args2[2],
_args2$ = _args2[3],
hours = _args2$ === void 0 ? 0 : _args2$,
_args2$2 = _args2[4],
minutes = _args2$2 === void 0 ? 0 : _args2$2,
_args2$3 = _args2[5],
seconds = _args2$3 === void 0 ? 0 : _args2$3;
if (inputType === 'local') {
outDate = new Date(_year, _month - 1, _date, hours, minutes, seconds);
} else {
outDate = new Date(Date.UTC(_year, _month - 1, _date, hours, minutes, seconds));
}
}
if (outputType === 'local') {
return [outDate.getFullYear(), pad(outDate.getMonth() + 1), pad(outDate.getDate()), 'T', pad(outDate.getHours()), pad(outDate.getMinutes()), pad(outDate.getSeconds())].join('');
}
return [outDate.getUTCFullYear(), pad(outDate.getUTCMonth() + 1), pad(outDate.getUTCDate()), 'T', pad(outDate.getUTCHours()), pad(outDate.getUTCMinutes()), pad(outDate.getUTCSeconds()), 'Z'].join('');
}
+22
View File
@@ -0,0 +1,22 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = formatDuration;
function formatDuration() {
var attributes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var weeks = attributes.weeks,
days = attributes.days,
hours = attributes.hours,
minutes = attributes.minutes,
seconds = attributes.seconds;
var formattedDuration = 'P';
formattedDuration += weeks ? "".concat(weeks, "W") : '';
formattedDuration += days ? "".concat(days, "D") : '';
formattedDuration += 'T';
formattedDuration += hours ? "".concat(hours, "H") : '';
formattedDuration += minutes ? "".concat(minutes, "M") : '';
formattedDuration += seconds ? "".concat(seconds, "S") : '';
return formattedDuration;
}
+9
View File
@@ -0,0 +1,9 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = formatText;
function formatText(text) {
return text.replace(/\\/gm, "\\\\").replace(/\r?\n/gm, "\\n").replace(/;/gm, "\\;").replace(/,/gm, "\\,");
}
+76
View File
@@ -0,0 +1,76 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "foldLine", {
enumerable: true,
get: function get() {
return _foldLine["default"];
}
});
Object.defineProperty(exports, "formatDate", {
enumerable: true,
get: function get() {
return _formatDate["default"];
}
});
Object.defineProperty(exports, "formatDuration", {
enumerable: true,
get: function get() {
return _formatDuration["default"];
}
});
Object.defineProperty(exports, "setAlarm", {
enumerable: true,
get: function get() {
return _setAlarm["default"];
}
});
Object.defineProperty(exports, "setContact", {
enumerable: true,
get: function get() {
return _setContact["default"];
}
});
Object.defineProperty(exports, "setDescription", {
enumerable: true,
get: function get() {
return _setDescription["default"];
}
});
Object.defineProperty(exports, "setGeolocation", {
enumerable: true,
get: function get() {
return _setGeolocation["default"];
}
});
Object.defineProperty(exports, "setLocation", {
enumerable: true,
get: function get() {
return _setLocation["default"];
}
});
Object.defineProperty(exports, "setOrganizer", {
enumerable: true,
get: function get() {
return _setOrganizer["default"];
}
});
Object.defineProperty(exports, "setSummary", {
enumerable: true,
get: function get() {
return _setSummary["default"];
}
});
var _formatDate = _interopRequireDefault(require("./format-date"));
var _setGeolocation = _interopRequireDefault(require("./set-geolocation"));
var _setContact = _interopRequireDefault(require("./set-contact"));
var _setOrganizer = _interopRequireDefault(require("./set-organizer"));
var _setAlarm = _interopRequireDefault(require("./set-alarm"));
var _setDescription = _interopRequireDefault(require("./set-description"));
var _setSummary = _interopRequireDefault(require("./set-summary"));
var _formatDuration = _interopRequireDefault(require("./format-duration"));
var _foldLine = _interopRequireDefault(require("./fold-line"));
var _setLocation = _interopRequireDefault(require("./set-location"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
+67
View File
@@ -0,0 +1,67 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = setAlarm;
var _formatDate = _interopRequireDefault(require("./format-date"));
var _foldLine = _interopRequireDefault(require("./fold-line"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function setDuration(_ref) {
var weeks = _ref.weeks,
days = _ref.days,
hours = _ref.hours,
minutes = _ref.minutes,
seconds = _ref.seconds;
var formattedString = 'P';
formattedString += weeks ? "".concat(weeks, "W") : '';
formattedString += days ? "".concat(days, "D") : '';
formattedString += 'T';
formattedString += hours ? "".concat(hours, "H") : '';
formattedString += minutes ? "".concat(minutes, "M") : '';
formattedString += seconds ? "".concat(seconds, "S") : '';
return formattedString;
}
function setTrigger(trigger) {
var formattedString = '';
if (Array.isArray(trigger)) {
formattedString = "TRIGGER;VALUE=DATE-TIME:".concat((0, _formatDate["default"])(trigger), "\r\n");
} else {
var alert = trigger.before ? '-' : '';
formattedString = "TRIGGER:".concat(alert + setDuration(trigger), "\r\n");
}
return formattedString;
}
function setAction(action) {
return action.toUpperCase();
}
function setAlarm() {
var attributes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var action = attributes.action,
repeat = attributes.repeat,
description = attributes.description,
duration = attributes.duration,
attach = attributes.attach,
attachType = attributes.attachType,
trigger = attributes.trigger,
summary = attributes.summary;
var formattedString = 'BEGIN:VALARM\r\n';
formattedString += (0, _foldLine["default"])("ACTION:".concat(setAction(action))) + '\r\n';
formattedString += repeat ? (0, _foldLine["default"])("REPEAT:".concat(repeat)) + '\r\n' : '';
formattedString += description ? (0, _foldLine["default"])("DESCRIPTION:".concat(description)) + '\r\n' : '';
formattedString += duration ? (0, _foldLine["default"])("DURATION:".concat(setDuration(duration))) + '\r\n' : '';
var attachInfo = attachType ? attachType : 'FMTTYPE=audio/basic';
formattedString += attach ? (0, _foldLine["default"])("ATTACH;".concat(attachInfo, ":").concat(attach)) + '\r\n' : '';
formattedString += trigger ? setTrigger(trigger) : '';
formattedString += summary ? (0, _foldLine["default"])("SUMMARY:".concat(summary)) + '\r\n' : '';
formattedString += 'END:VALARM\r\n';
return formattedString;
}
// Example: A duration of 15 days, 5 hours, and 20 seconds would be:
// P15DT5H0M20S
// A duration of 7 weeks would be:
// P7W
+38
View File
@@ -0,0 +1,38 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = setContact;
function setContact(_ref) {
var name = _ref.name,
email = _ref.email,
rsvp = _ref.rsvp,
dir = _ref.dir,
partstat = _ref.partstat,
role = _ref.role,
cutype = _ref.cutype,
xNumGuests = _ref.xNumGuests;
var formattedParts = [];
if (rsvp !== undefined) {
formattedParts.push(rsvp ? 'RSVP=TRUE' : 'RSVP=FALSE');
}
if (cutype) {
formattedParts.push("CUTYPE=".concat(cutype));
}
if (xNumGuests !== undefined) {
formattedParts.push("X-NUM-GUESTS=".concat(xNumGuests));
}
if (role) {
formattedParts.push("ROLE=".concat(role));
}
if (partstat) {
formattedParts.push("PARTSTAT=".concat(partstat));
}
if (dir) {
formattedParts.push("DIR=".concat(dir));
}
formattedParts.push('CN='.concat(name || 'Unnamed attendee'));
var formattedAttendee = formattedParts.join(';').concat(email ? ":mailto:".concat(email) : '');
return formattedAttendee;
}
+11
View File
@@ -0,0 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = setDescription;
var _formatText = _interopRequireDefault(require("./format-text"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function setDescription(description) {
return (0, _formatText["default"])(description);
}
+11
View File
@@ -0,0 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = setGeolocation;
function setGeolocation(_ref) {
var lat = _ref.lat,
lon = _ref.lon;
return "".concat(lat, ";").concat(lon);
}
+11
View File
@@ -0,0 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = setLocation;
var _formatText = _interopRequireDefault(require("./format-text"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function setLocation(location) {
return (0, _formatText["default"])(location);
}
+19
View File
@@ -0,0 +1,19 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = setOrganizer;
function setOrganizer(_ref) {
var name = _ref.name,
email = _ref.email,
dir = _ref.dir,
sentBy = _ref.sentBy;
var formattedOrganizer = '';
formattedOrganizer += dir ? "DIR=\"".concat(dir, "\";") : '';
formattedOrganizer += sentBy ? "SENT-BY=\"MAILTO:".concat(sentBy, "\";") : '';
formattedOrganizer += 'CN=';
formattedOrganizer += name || 'Organizer';
formattedOrganizer += email ? ":MAILTO:".concat(email) : '';
return formattedOrganizer;
}
+11
View File
@@ -0,0 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = setSummary;
var _formatText = _interopRequireDefault(require("./format-text"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function setSummary(summary) {
return (0, _formatText["default"])(summary);
}