This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * @description A class to check numbers | |
| * LICENSE: MIT | |
| new NumChecks(Number(prompt("give me a number"))).isEqual(Number(prompt("Now give me another number"))) ? alert("Equal") : alert("Not equal"); | |
| */ | |
| class NumChecks{ | |
| operations = { | |
| "+": (a, b) => a + b, | |
| "-": (a, b) => a - b, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * @description Check if debug is enabled then print the arguments | |
| * if you set the first parameter as log, error or warn, it use | |
| * the console.<type> | |
| * | |
| * @param {...any} args things to print on console | |
| * | |
| * @example log("test: ", 1) // test: 1 | |
| * @example log("error", new Error("Error")) // error Error: Error... | |
| * @example log("warn", "warning") // warn warning |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * USB HID Keyboard scan codes as per USB spec 1.11 | |
| * plus some additional codes | |
| * | |
| * Created by MightyPork, 2016 | |
| * Public domain | |
| * | |
| * Adapted from: | |
| * https://source.android.com/devices/input/keyboard-devices.html | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "0": 48, | |
| "1": 49, | |
| "2": 50, | |
| "3": 51, | |
| "4": 52, | |
| "5": 53, | |
| "6": 54, | |
| "7": 55, | |
| "8": 56, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * @description date builder, build a date string by passing the format | |
| * @param {String} format date format to create | |
| * @param {Number} timestamp date timestamp | |
| * @see https://jsbench.me/j6kiav1wop other versions and benchmark | |
| * @example buildDate('%mo%/%d% %h%:%min%') -> 'Dec/4 20:00' | |
| */ | |
| buildDate = (format = '*', timestamp = Date.now()) => { | |
| if(!format || format == "*" || format == " "){ | |
| return new Date(timestamp); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [{"id":"le216","name":"Amber","stars":4,"element":"6","avatar":"","talent":"3","drop":{"monster":"1","talentBoss":"2"},"worldLoot":"10"},{"id":"bxsk9","name":"Barbara","stars":"4","element":"5","avatar":"","talent":"3","drop":{"monster":"4","talentBoss":"3"},"worldLoot":"7"},{"id":"td785f","name":"Beidou","stars":"4","element":"3","avatar":"","talent":"0","drop":{"monster":"6","talentBoss":"2"},"worldLoot":"6"},{"id":"yv2q3","name":"Bennet","stars":"4","element":"6","avatar":"","talent":5,"drop":{"monster":"6","talentBoss":"1"},"worldLoot":"14"},{"id":"14kp3j","name":"Chongyun","stars":"4","element":"1","avatar":"","talent":"1","drop":{"monster":"2","talentBoss":"2"},"worldLoot":2},{"id":"hpyuu","name":"Diluc","stars":"5","element":"6","avatar":"","talent":"4","drop":{"monster":"0","talentBoss":"1"},"worldLoot":"10"},{"id":"kca5y","name":"Diona","stars":"-1","element":"1","avatar":"","talent":"3","drop":{"monster":"1","talentBoss":"-1"},"worldLoot":"0"},{"id":"sftna","name":"Fischl","stars":"4","element":"3", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * @description convert hms string to seconds | |
| * @see performance test with jsBench: https://jsbench.me/rckgfk8iv7 | |
| * @license MIT | |
| * | |
| * @param {String} str HH:MM:SS | |
| * @example str = '01:00:10' return 3610 | |
| * @returns {Number} time as seconds | |
| */ | |
| const hmsToSeconds = (str) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * @description get last item of an array or set the value of the last item | |
| * @author Matsukii | |
| * @license MIT | |
| * @returns last item of an array | |
| */ | |
| Array.prototype.lastItem = function(set=undefined){let i=this.length-1;if(set){if(typeof set==="object"){this[i]={...this.lastItem(),...set}}else{this[i]=set}}return this[i]} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * @description construct an RegExp with items from prvided array, | |
| * can be used to create an regex to test if have specific item | |
| * | |
| * @param {Array<*>} items array of items to add as regex option | |
| * @param {String} flags regex flags | |
| * @returns {RegExp} RegExp | |
| * @example construct(["foo", "bar"], "gi").test("foo") -> true | |
| */ | |
| function construct(items, flags = 'gi'){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * @author Matsukii | |
| * @Description get a random text pharse from array | |
| */ | |
| class loadingMessages { | |
| msgs = [ | |
| 'Loading', | |
| 'Opening inventory...', | |
| 'Looking for your history', | |
| 'Link start!', |
NewerOlder