Skip to content

Commit

Permalink
2.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Vaporjawn committed Jan 13, 2024
1 parent 328c695 commit 78dda9b
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 52 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "snapple-facts",
"version": "2.1.3",
"version": "2.2.0",
"description": "Every Snapple Fact",
"main": "./src/index.js",
"scripts": {
Expand Down
96 changes: 47 additions & 49 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,55 +1,53 @@
'use strict';
var __importDefault =
(this && this.__importDefault) ||
function (mod) {
return mod && mod.__esModule ? mod : { default: mod };
};
Object.defineProperty(exports, '__esModule', { value: true });
const getFactByNumber_1 = __importDefault(require('./functions/getFactByNumber/getFactByNumber'));
const getFacts_1 = __importDefault(require('./functions/getFacts/getFacts'));
const listFacts_1 = __importDefault(require('./functions/listFacts/listFacts'));
const randomFact_1 = __importDefault(require('./functions/randomFact/randomFact'));
const snappleFacts_1 = __importDefault(require('./snappleFacts'));
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const getFactByNumber_1 = __importDefault(require("./functions/getFactByNumber/getFactByNumber"));
const getFacts_1 = __importDefault(require("./functions/getFacts/getFacts"));
const listFacts_1 = __importDefault(require("./functions/listFacts/listFacts"));
const randomFact_1 = __importDefault(require("./functions/randomFact/randomFact"));
const snappleFacts_1 = __importDefault(require("./snappleFacts"));
/**
* Represents a collection of Snapple facts.
*/
class SnappleFacts {
/**
* Creates a new instance of the class.
*/
constructor() {
this.snappleFacts = snappleFacts_1.default;
}
/**
* Retrieves an array of Snapple facts.
*
* @returns {SnappleFact[]} An array of Snapple facts.
*/
getFacts() {
return (0, getFacts_1.default)();
}
/**
* Retrieves a list of Snapple facts.
*
* @returns An array of strings representing the Snapple facts.
*/
listFacts() {
return (0, listFacts_1.default)(this.snappleFacts);
}
/**
* Retrieves a SnappleFact by its number.
* @param number - The number of the SnappleFact to retrieve.
* @returns The SnappleFact object if found, otherwise undefined.
*/
getFactByNumber(number) {
return (0, getFactByNumber_1.default)({ snappleFacts: this.snappleFacts, number });
}
/**
* Retrieves a random SnappleFact from the collection of Snapple facts.
* @returns {SnappleFact} A random SnappleFact.
*/
randomFact() {
return (0, randomFact_1.default)(this.snappleFacts);
}
/**
* Creates a new instance of the class.
*/
constructor() {
this.snappleFacts = snappleFacts_1.default;
}
/**
* Retrieves an array of Snapple facts.
*
* @returns {SnappleFact[]} An array of Snapple facts.
*/
getFacts() {
return (0, getFacts_1.default)();
}
/**
* Retrieves a list of Snapple facts.
*
* @returns An array of strings representing the Snapple facts.
*/
listFacts() {
return (0, listFacts_1.default)(this.snappleFacts);
}
/**
* Retrieves a SnappleFact by its number.
* @param number - The number of the SnappleFact to retrieve.
* @returns The SnappleFact object if found, otherwise undefined.
*/
getFactByNumber(number) {
return (0, getFactByNumber_1.default)({ snappleFacts: this.snappleFacts, number });
}
/**
* Retrieves a random SnappleFact from the collection of Snapple facts.
* @returns {SnappleFact} A random SnappleFact.
*/
randomFact() {
return (0, randomFact_1.default)(this.snappleFacts);
}
}
exports.default = SnappleFacts;

0 comments on commit 78dda9b

Please sign in to comment.