From fd1d678bd5b489e88400a96240d8d72d896e285c Mon Sep 17 00:00:00 2001 From: chrisweb Date: Thu, 27 Aug 2020 18:09:53 +0200 Subject: [PATCH] choice function returns random item from an array --- README.md | 75 ++-- dist/@types/chrisweb-utilities/index.d.ts | 4 +- .../chrisweb-utilities/utilities/random.d.ts | 3 +- dist/index.esm.js | 6 +- dist/index.esm.js.map | 2 +- dist/index.js | 5 + dist/index.js.map | 2 +- package-lock.json | 346 +++++++++--------- package.json | 12 +- src/index.ts | 5 +- src/utilities/random.ts | 6 +- 11 files changed, 252 insertions(+), 214 deletions(-) diff --git a/README.md b/README.md index 897a555..c399e63 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ Javascript utilities belt for very specific tasks. main goal(s): + * console log wrapper for colored log messages * utilities belt: javascript collection of useful functions that are useful for specific situations, so a lot more specific than underscore * should work in the browser as well in nodejs @@ -35,7 +36,7 @@ update npm to latest version install the dependencies -`npm install` +`npm i` to lint the typescript files @@ -49,10 +50,6 @@ to build the distributions (es6 module (esm.js) and the UMD version) `npm run build` -or by using yarn - -`yarn build` - ## development in devlopment you can use watch to rebuild every time you edit a typescript file @@ -79,29 +76,23 @@ installed dependencies: command to create a basic jest.config.js file: -`npx ts-jest config:init yarn ts-jest config:init` +`npx ts-jest config:init yarn ts-jest config:init` If you use VSCode, consider using the [vscode jest extension](https://github.com/jest-community/vscode-jest) Besides reading the official documentation, you can check out this quick [introduction to jest](https://flaviocopes.com/jest/) blog post -## linting setup notes - - > we plan to deprecate TSLint and focus our efforts instead on improving ESLint’s TypeScript support - -Their [blog post](https://medium.com/palantir/tslint-in-2019-1a144c2317a9) announcing that [TSLint](https://github.com/palantir/tslint) will be deprecated in 2019 and you should switch to [ESLint](https://github.com/eslint/eslint) when TSLint is officially deprecated - -TSlint will be deprecated [github ticket](https://github.com/palantir/tslint/issues/4534) - ## features ### utilities.log + Colored console log messages for the browser and / or nodejs -``` + +```javascript utilities.log('foo', 'bar', 'fontColor:red', 'backgroundColor:blue'); ``` -**Suppported colors** +#### Suppported colors * red * green @@ -112,49 +103,89 @@ Colored console log messages for the browser and / or nodejs * white * black -**logging in floating html div (client)** +#### logging in floating html div (client) + If you are on mobile device and wan't to show the messages in a floating div over the page then set logSpecial to true -``` + +```javascript utilities.logSpecial = true ``` -**logging in a file (server)** +#### logging in a file (server) + If want every message to logged in file, then enable logSpecial (currently only winston is supported) -``` + +```javascript utilities.logSpecial = true ``` -**logging in a file (server) but not in the console** -``` +#### logging in a file (server) but not in the console + +```javascript utilities.logSpecial = true utilities.logVerbose = false ``` + ### removeElements + removes html elements from a sting (and their content) from strings set second parameter "removeTextBetweenTags" to false to keep the text between the opening and closing html tag + ### generateUUID + returns a universally unique identifier + ### filterAlphaNumericPlus + filters a string removes everything that is a not an alpha or numeric character and also optionally the characters that got specified as second argument + ### decodeUri + decode uri + ### encodeUri + encode uri + ### arrayRemove + remove an something at an unknown index from an array + ### capitaliseFirstLetter + capitalise first letter of a string + ### getUrlParameters + get url parameters + ### stringContains + does a string contain another string + ### getSubstringIndex + get the index of a substring in a string with optional nth time it occurs + ### isServer + does the script run on the server + ### isClient + does the script run in a client + ### replace placholder(s) + first parameter is a string and second parameter an object where the keys are the placeholder that need to get replaced and the value is the replacement (replacement can be a string or number) + ### remove the content between two "markers" + +### randomInteger + +Input are two numbers, output is a random number that is between or equal the two input numbers + +### choice + +Input is a sequence (an array) of items and the output one random item of the input diff --git a/dist/@types/chrisweb-utilities/index.d.ts b/dist/@types/chrisweb-utilities/index.d.ts index 598a914..4c33c6b 100644 --- a/dist/@types/chrisweb-utilities/index.d.ts +++ b/dist/@types/chrisweb-utilities/index.d.ts @@ -8,6 +8,6 @@ import { generateUUID } from './utilities/uuid'; import { removeElements } from './utilities/html'; import { log } from './utilities/log'; import { sleep } from './utilities/helper'; -import { randomInteger } from './utilities/random'; +import { randomInteger, choice } from './utilities/random'; declare const version = "1.0.0"; -export { version, getTimestamp, isServer, isClient, getUrlParameters, getUrlParameterByName, replaceUrlParameter, decodeUri, encodeUri, removeString, isArray, includes, find, flat, filterAlphaNumericPlus, capitaliseFirstLetter, stringContains, getSubstringIndex, replacePlaceholders, generateUUID, removeElements, log, sleep, randomInteger }; +export { version, getTimestamp, isServer, isClient, getUrlParameters, getUrlParameterByName, replaceUrlParameter, decodeUri, encodeUri, removeString, isArray, includes, find, flat, filterAlphaNumericPlus, capitaliseFirstLetter, stringContains, getSubstringIndex, replacePlaceholders, generateUUID, removeElements, log, sleep, randomInteger, choice }; diff --git a/dist/@types/chrisweb-utilities/utilities/random.d.ts b/dist/@types/chrisweb-utilities/utilities/random.d.ts index 8dfe983..f411cc9 100644 --- a/dist/@types/chrisweb-utilities/utilities/random.d.ts +++ b/dist/@types/chrisweb-utilities/utilities/random.d.ts @@ -4,4 +4,5 @@ * @param max */ declare const randomInteger: (min?: number, max?: number) => number; -export { randomInteger }; +declare const choice: (sequence?: unknown[]) => unknown; +export { randomInteger, choice }; diff --git a/dist/index.esm.js b/dist/index.esm.js index 9fe0902..dc64bfa 100644 --- a/dist/index.esm.js +++ b/dist/index.esm.js @@ -702,8 +702,12 @@ var randomInteger = function (min, max) { if (max === void 0) { max = Infinity; } return Math.floor(Math.random() * (max - min + 1) + min); }; +var choice = function (sequence) { + if (sequence === void 0) { sequence = []; } + return sequence[Math.floor(Math.random() * sequence.length)]; +}; var version = '1.0.0'; -export { capitaliseFirstLetter, decodeUri, encodeUri, filterAlphaNumericPlus, find, flat, generateUUID, getSubstringIndex, getTimestamp, getUrlParameterByName, getUrlParameters, includes, isArray, isClient, isServer, log, randomInteger, removeElements, removeString, replacePlaceholders, replaceUrlParameter, sleep, stringContains, version }; +export { capitaliseFirstLetter, choice, decodeUri, encodeUri, filterAlphaNumericPlus, find, flat, generateUUID, getSubstringIndex, getTimestamp, getUrlParameterByName, getUrlParameters, includes, isArray, isClient, isServer, log, randomInteger, removeElements, removeString, replacePlaceholders, replaceUrlParameter, sleep, stringContains, version }; //# sourceMappingURL=index.esm.js.map diff --git a/dist/index.esm.js.map b/dist/index.esm.js.map index c492fd6..f3dc25b 100644 --- a/dist/index.esm.js.map +++ b/dist/index.esm.js.map @@ -1 +1 @@ -{"version":3,"file":"index.esm.js","sources":["../src/utilities/datetime.ts","../src/utilities/platform.ts","../src/utilities/uri.ts","../src/utilities/url.ts","../src/utilities/array.ts","../src/utilities/string.ts","../src/utilities/uuid.ts","../src/utilities/html.ts","../src/utilities/log/adapters/html.ts","../src/utilities/log/adapters/file.ts","../src/utilities/log.ts","../src/utilities/helper.ts","../src/utilities/random.ts","../src/index.ts"],"sourcesContent":["/**\r\n * returns the timestamp for any date or for now(), also works with browsers that dont support es5 Date.now\r\n * @param dateString \r\n */\r\nconst getTimestamp = (dateString: string | number = ''): number => {\r\n\r\n let timestamp: number;\r\n\r\n if (dateString === '') {\r\n timestamp = new Date().getTime();\r\n } else {\r\n const date = new Date(dateString);\r\n timestamp = date.getTime();\r\n }\r\n\r\n return timestamp;\r\n\r\n};\r\n\r\nexport { getTimestamp };\r\n","/**\r\n * does the script run on the server\r\n */\r\nconst isServer = (): boolean => {\r\n\r\n if (typeof (global) === 'object') {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n\r\n};\r\n\r\n/**\r\n * does the script run in a client\r\n */\r\nconst isClient = (): boolean => {\r\n\r\n return !isServer();\r\n\r\n};\r\n\r\nexport { isServer, isClient };\r\n","type TReplaceList = {\r\n [key: string]: string\r\n}\r\n\r\n/**\r\n * decode uri\r\n * @param inputString \r\n */\r\nconst decodeUri = (inputString: string): string => {\r\n\r\n const plusRegularExpression = /\\+/g;\r\n\r\n // replace addition symbol with a space\r\n return decodeURIComponent(inputString.replace(plusRegularExpression, ' '));\r\n\r\n};\r\n\r\n/**\r\n * encode uri\r\n * @param inputString \r\n */\r\nconst encodeUri = (inputString: string): string => {\r\n\r\n const findRegularExpression = /[!'()~]|%20|%00/g;\r\n const replaceList: TReplaceList = {\r\n '!': '%21',\r\n // tslint:disable-next-line\r\n \"'\": '%27',\r\n '(': '%28',\r\n ')': '%29',\r\n '~': '%7E',\r\n '%20': '+',\r\n '%00': '+'\r\n };\r\n\r\n return encodeURIComponent(inputString).replace(findRegularExpression, (match) => { return replaceList[match]; });\r\n\r\n};\r\n\r\nexport { decodeUri, encodeUri };\r\n","import { decodeUri } from './uri';\r\n\r\n/**\r\n * get url parameters\r\n * @param query \r\n */\r\nconst getUrlParameters = (query = ''): { [s: string]: string; } => {\r\n\r\n const urlParameters: { [s: string]: string; } = {};\r\n\r\n if (query !== '' && typeof query === 'string') {\r\n\r\n const questionmarkIndex = query.indexOf('?');\r\n\r\n // if -1 there is no questionmark, skip, all is fine\r\n // else just keep what comes after the questionmark\r\n if (questionmarkIndex !== -1) {\r\n query = query.slice(questionmarkIndex + 1);\r\n }\r\n\r\n const pairs: string[] = query.split('&');\r\n let i;\r\n\r\n for (i = 0; i < pairs.length; i++) {\r\n\r\n const pair: string = pairs[i];\r\n const equalIndex: number = pair.indexOf('=');\r\n let parameterKey = '';\r\n let parameterValue = '';\r\n\r\n if (equalIndex > -1) {\r\n parameterKey = pair.slice(0, equalIndex);\r\n parameterValue = pair.slice(equalIndex + 1);\r\n } else {\r\n parameterKey = pair;\r\n }\r\n\r\n urlParameters[decodeUri(parameterKey)] = decodeUri(parameterValue);\r\n }\r\n\r\n }\r\n\r\n return urlParameters;\r\n\r\n};\r\n\r\n/**\r\n * URL utility to get a parameter by name from an URL\r\n * @param name \r\n * @param url \r\n */\r\nconst getUrlParameterByName = (name: string, url: string): string => {\r\n\r\n if (!url) {\r\n url = window.location.href;\r\n }\r\n\r\n name = name.replace(/[[]]/g, '\\\\$&');\r\n\r\n const regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)');\r\n const results = regex.exec(url);\r\n\r\n if (!results) {\r\n return null;\r\n }\r\n\r\n if (!results[2]) {\r\n return '';\r\n }\r\n\r\n return decodeUri(results[2]);\r\n\r\n};\r\n\r\n/**\r\n * URL utility to replace a given parameter\r\n * @param url \r\n * @param paramName \r\n * @param paramValue \r\n */\r\nconst replaceUrlParameter = (url: string, paramName: string, paramValue: string|number): string => {\r\n\r\n const pattern = new RegExp('\\\\b(' + paramName + '=).*?(&|$)');\r\n\r\n if (url.search(pattern) >= 0) {\r\n return url.replace(pattern, '$1' + paramValue + '$2');\r\n }\r\n\r\n return url + (url.indexOf('?') > 0 ? '&' : '?') + paramName + '=' + paramValue;\r\n\r\n};\r\n\r\nexport { getUrlParameters, getUrlParameterByName, replaceUrlParameter };\r\n","/**\r\n * finds \"removeMe\" and removes it from the array\r\n * @param array \r\n * @param removeMe \r\n */\r\nconst removeString = (myArray: string[], removeMe: string): string[] => {\r\n\r\n const index = myArray.indexOf(removeMe);\r\n\r\n if (index > -1) {\r\n myArray.splice(index, 1);\r\n }\r\n\r\n return myArray;\r\n\r\n};\r\n\r\n/**\r\n * is array with polyfill for older browsers\r\n * @param input \r\n */\r\nconst isArray = (input: unknown): boolean => {\r\n\r\n // MDN is array documentation: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray\r\n\r\n if (!Array.isArray) {\r\n return Object.prototype.toString.call(input) === '[object Array]';\r\n } else {\r\n return Array.isArray(input);\r\n }\r\n\r\n};\r\n\r\ndeclare global {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n interface Array {\r\n includes(valueToFind: string, fromIndex?: number): boolean;\r\n }\r\n}\r\n\r\n/**\r\n * finds \"toFind\" in an array, starting at an optional index\r\n * @param inputArray \r\n * @param toFind \r\n * @param fromIndex \r\n */\r\nconst includes = (inputArray: [], toFind: string, fromIndex?: number): boolean => {\r\n\r\n // MDN includes documentation: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes\r\n\r\n if (!Array.prototype.includes) {\r\n\r\n // https://tc39.github.io/ecma262/#sec-array.prototype.includes\r\n\r\n if (this == null) {\r\n throw new TypeError('\"this\" is null or not defined');\r\n }\r\n\r\n // 1. Let O be ? ToObject(this value)\r\n const o = Object(this);\r\n\r\n // 2. Let len be ? ToLength(? Get(O, \"length\"))\r\n const len = o.length >>> 0;\r\n\r\n // 3. If len is 0, return false\r\n if (len === 0) {\r\n return false;\r\n }\r\n\r\n // 4. Let n be ? ToInteger(fromIndex)\r\n // (If fromIndex is undefined, this step produces the value 0.)\r\n const n = fromIndex | 0;\r\n\r\n // 5. If n ≥ 0, then\r\n // a. Let k be n.\r\n // 6. Else n < 0,\r\n // a. Let k be len + n.\r\n // b. If k < 0, let k be 0.\r\n let k = Math.max(n >= 0 ? n : len - Math.abs(n), 0);\r\n\r\n // 7. Repeat, while k < len\r\n while (k < len) {\r\n // a. Let elementK be the result of ? Get(O, ! ToString(k))\r\n // b. If SameValueZero(valueToFind, elementK) is true, return true\r\n if (sameValueZero(o[k], toFind)) {\r\n return true;\r\n }\r\n // c. Increase k by 1\r\n k++;\r\n }\r\n\r\n // 8. Return false\r\n return false;\r\n } else {\r\n const n = fromIndex | 0;\r\n return inputArray.includes(toFind, n);\r\n }\r\n};\r\n\r\nconst sameValueZero = (x: unknown, y: unknown): boolean => {\r\n return x === y || (typeof x === 'number' && typeof y === 'number' && isNaN(x) && isNaN(y));\r\n};\r\n\r\n/**\r\n * \r\n * @param inputArray \r\n * @param predicate \r\n * @param args \r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\r\nconst find = (inputArray: [], predicate: (this: void, value: never, index: number, obj: never[]) => value is never, args?: any): never | undefined => {\r\n\r\n // MDN find documentation: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find\r\n\r\n if (!Array.prototype.find) {\r\n\r\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find\r\n\r\n // 1. Let O be ? ToObject(this value)\r\n if (this == null) {\r\n throw new TypeError('\"this\" is null or not defined');\r\n }\r\n\r\n const o = Object(this);\r\n\r\n // 2. Let len be ? ToLength(? Get(O, \"length\"))\r\n const len = o.length >>> 0;\r\n\r\n // 3. If IsCallable(predicate) is false, throw a TypeError exception\r\n if (typeof predicate !== 'function') {\r\n throw new TypeError('predicate must be a function');\r\n }\r\n\r\n // 4. If thisArg was supplied, let T be thisArg; else let T be undefined\r\n const thisArg = args[1];\r\n\r\n // 5. Let k be 0.\r\n let k = 0;\r\n\r\n // 6. Repeat, while k < len\r\n while (k < len) {\r\n // a. Let Pk be ! ToString(k)\r\n // b. Let kValue be ? Get(O, Pk)\r\n // c. Let testResult be ToBoolean(? Call(predicate, T, « kValue, k, O »))\r\n // d. If testResult is true, return kValue\r\n const kValue = o[k];\r\n if (predicate.call(thisArg, kValue, k, o)) {\r\n return kValue;\r\n }\r\n // e. Increase k by 1\r\n k++;\r\n }\r\n\r\n // 7. Return undefined\r\n return undefined;\r\n\r\n } else {\r\n // eslint-disable-next-line\r\n return inputArray.find(predicate, args);\r\n }\r\n};\r\n\r\ndeclare global {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n interface Array {\r\n flat(depth: number): [];\r\n }\r\n}\r\n\r\n/**\r\n * array flat polyfill, if depth is unknow set it to \"Infinity\"\r\n * @param inputArray \r\n * @param depth \r\n */\r\nconst flat = (inputArray: [], depth = Infinity): [] => {\r\n\r\n // MDN flat documentation: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flat\r\n\r\n if (!Array.prototype.flat) {\r\n return flatten(inputArray, Math.floor(depth) || 1);\r\n } else {\r\n return inputArray.flat(depth);\r\n }\r\n\r\n};\r\n\r\n/**\r\n * flattens a multidimensional array\r\n * @param inputArray \r\n * @param depth \r\n */\r\nconst flatten = (inputArray: [], depth = Infinity): [] => {\r\n\r\n const flattend: [] = [];\r\n\r\n for (const el of inputArray) {\r\n if (isArray(el) && depth > 0) {\r\n flatten(el, depth - 1);\r\n } else {\r\n flattend.push(el);\r\n }\r\n }\r\n\r\n return flattend;\r\n\r\n};\r\n\r\nexport { removeString, isArray, includes, find, flat };\r\n","/**\r\n * filters a string\r\n * removes everything that is a not an alpha or numeric character, plus\r\n * the characters if any got specified as second argument\r\n * @param inputString \r\n * @param specialCharacters \r\n */\r\nconst filterAlphaNumericPlus = (inputString: string, specialCharacters: string): string|boolean => {\r\n\r\n if (typeof (inputString) === 'string' && inputString.length > 0) {\r\n\r\n let outputString;\r\n\r\n if (specialCharacters !== undefined) {\r\n\r\n const regex = RegExp('[^a-z0-9' + specialCharacters + ']', 'gi');\r\n\r\n outputString = inputString.replace(regex, '');\r\n\r\n } else {\r\n outputString = inputString.replace(/[^a-z0-9]/gi, '');\r\n }\r\n\r\n return outputString;\r\n\r\n }\r\n\r\n return false;\r\n\r\n};\r\n\r\n/**\r\n * capitalise first letter of a string\r\n * @param inputString \r\n */\r\nconst capitaliseFirstLetter = (inputString: string): string => {\r\n\r\n return inputString.charAt(0).toUpperCase() + inputString.slice(1);\r\n\r\n};\r\n\r\n/**\r\n * does a string contain another string\r\n * @param inputString \r\n * @param contains \r\n */\r\nconst stringContains = (inputString: string, contains: string): boolean => {\r\n\r\n if (typeof inputString !== 'string') {\r\n throw 'input is not a string';\r\n }\r\n\r\n if (inputString.indexOf(contains) > -1) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n\r\n};\r\n\r\n/**\r\n * get the index of a substring in a string with optional nth time it occurs\r\n * @param inputString \r\n * @param substring \r\n * @param nthTime \r\n */\r\nconst getSubstringIndex = (inputString: string, substring: string, nthTime: number): number => {\r\n\r\n let times = 0;\r\n let index = null;\r\n\r\n if (nthTime === 0) {\r\n nthTime = 1;\r\n }\r\n\r\n while (times < nthTime && index !== -1) {\r\n\r\n index = inputString.indexOf(substring, index + 1);\r\n times++;\r\n\r\n }\r\n\r\n return index;\r\n\r\n};\r\n\r\n/**\r\n * replace the placeholder(s) with some value\r\n * @param input \r\n * @param replacements \r\n */\r\nconst replacePlaceholders = (input: string, replacements: string): string => {\r\n\r\n let output = input;\r\n\r\n if (typeof input === 'string' && typeof replacements === 'object') {\r\n\r\n output = input.replace(/\\b\\w+?\\b/g, function replacePlaceHolder(placeholder) {\r\n return Object.prototype.hasOwnProperty.call(replacements, placeholder) ? replacements[placeholder] : placeholder;\r\n });\r\n\r\n }\r\n\r\n return output;\r\n\r\n};\r\n\r\nexport { filterAlphaNumericPlus, capitaliseFirstLetter, stringContains, getSubstringIndex, replacePlaceholders };\r\n","/**\r\n * returns a universally unique identifier\r\n */\r\nconst generateUUID = (): string => {\r\n\r\n // http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript\r\n\r\n // http://www.ietf.org/rfc/rfc4122.txt\r\n \r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const s: any[] = [];\r\n const hexDigits = '0123456789abcdef';\r\n let i;\r\n\r\n for (i = 0; i < 36; i++) {\r\n s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);\r\n }\r\n\r\n s[14] = 4; // bits 12-15 of the time_hi_and_version field to 0010\r\n s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1); // bits 6-7 of the clock_seq_hi_and_reserved to 01\r\n s[8] = s[13] = s[18] = s[23] = '-';\r\n\r\n const uuid = s.join('');\r\n\r\n return uuid;\r\n\r\n};\r\n\r\nexport { generateUUID };\r\n","/**\r\n * extracts html elements (and their content) from strings\r\n * @param text \r\n * @param removeTextBetweenTags \r\n */\r\nconst removeElements = (text: string, removeTextBetweenTags: boolean): string => {\r\n\r\n if (removeTextBetweenTags === false) {\r\n\r\n // replace single tags\r\n text = text.replace(/<[^>]*>?/g, '');\r\n\r\n } else {\r\n\r\n // replace all tags and whats inside\r\n text = text.replace(/<[^>]*>[^>]*<\\/[^>]*>?/g, '');\r\n\r\n // replace single tags\r\n text = text.replace(/<[^>]*>?/g, '');\r\n\r\n }\r\n\r\n return text;\r\n\r\n};\r\n\r\nexport { removeElements };\r\n","import { removeElements } from './../../html';\r\n\r\n/**\r\n * html log\r\n * create a div an insert the messages in div\r\n * can be usefull on mobile if no other console is available\r\n * @param logObjects \r\n * @param logObjectsLength \r\n * @param logFontColor \r\n * @param logBackgroundColor \r\n */\r\nconst htmlLog = (logObjects: string[], logObjectsLength: number, logFontColor: string, logBackgroundColor: string): void => {\r\n\r\n // TODO: fix: seems that if logging starts before \"domload\" some\r\n // messages get lost\r\n\r\n if (document.getElementById('log') === null) {\r\n\r\n const logDiv = document.createElement('div');\r\n\r\n logDiv.id = 'log';\r\n\r\n logDiv.style.cssText = 'position: absolute; overflow: scroll; left: 0; bottom: 0; padding: 0; margin: 0; border: 0; z-index: 999999; width: 100%; height: 20%; background-color: #fff;';\r\n\r\n document.body.appendChild(logDiv);\r\n\r\n }\r\n\r\n let i;\r\n\r\n for (i = 0; i < logObjectsLength; i++) {\r\n\r\n const logSpan = document.createElement('span');\r\n\r\n logSpan.style.cssText = 'color: #' + logFontColor + '; background-color: #' + logBackgroundColor + ';';\r\n\r\n const logObject = logObjects[i];\r\n\r\n const spanContent = document.createTextNode(logObject);\r\n\r\n logSpan.appendChild(spanContent);\r\n\r\n document.getElementById('log').appendChild(logSpan);\r\n\r\n const brElement = document.createElement('br');\r\n\r\n document.getElementById('log').appendChild(brElement);\r\n\r\n }\r\n\r\n};\r\n\r\n/**\r\n * extracts html elements (and their content) from strings\r\n * @param rawText \r\n * @param extendedEscape \r\n * @param myEscapeList \r\n */\r\nconst safeUnescape = (rawText: string, extendedEscape = false, myEscapeList: string[]): string => {\r\n\r\n interface IEscapeList {\r\n [key: string]: string;\r\n }\r\n\r\n const unEscapeList: IEscapeList = {\r\n // usually you would just escape (unescape) characters that get\r\n // used in (x)html\r\n '&': '&',\r\n '<': '<',\r\n '>': '>',\r\n '"': '\"',\r\n ''': '\\'',\r\n '`': '`'\r\n };\r\n\r\n // by default also use extended list\r\n if (extendedEscape === true) {\r\n\r\n const unEscapeExtendedList: IEscapeList = {\r\n // but in the case where everything has been encoded lets decode these too\r\n '‘': '‘',\r\n '’': '’',\r\n '‚': '‚',\r\n '“': '“',\r\n '”': '”',\r\n '„': '„',\r\n '†': '†',\r\n '‡': '‡',\r\n '‰': '‰',\r\n '‹': '‹',\r\n '›': '›',\r\n '–': '-',\r\n '—': '—',\r\n ' ': ' ',\r\n '¡': '¡',\r\n '¢': '¢',\r\n '£': '£',\r\n '¤': '¤',\r\n '¥': '¥',\r\n '¦': '¦',\r\n '&brkbar;': '¦',\r\n '§': '§',\r\n '¨': '¨',\r\n '¨': '¨',\r\n '©': '©',\r\n 'ª': 'ª',\r\n '«': '«',\r\n '¬': '¬',\r\n '­': ' ',\r\n '®': '®',\r\n '¯': '¯',\r\n '&hibar;': '¯',\r\n '°': '°',\r\n '±': '±',\r\n '²': '²',\r\n '³': '³',\r\n '´': '´',\r\n 'µ': 'µ',\r\n '¶': '¶',\r\n '·': '·',\r\n '¸': '¸',\r\n '¹': '¹',\r\n 'º': 'º',\r\n '»': '»',\r\n '¼': '¼',\r\n '½': '½',\r\n '¾': '¾',\r\n '¿': '¿'\r\n };\r\n\r\n for (const key in unEscapeExtendedList) {\r\n unEscapeList[key] = unEscapeExtendedList[key];\r\n }\r\n\r\n }\r\n\r\n if (myEscapeList !== undefined) {\r\n\r\n for (const key in myEscapeList) {\r\n unEscapeList[key] = myEscapeList[key];\r\n }\r\n\r\n }\r\n\r\n const escaper = function (match: string) {\r\n return unEscapeList[match];\r\n };\r\n\r\n // regexes for identifying a key that needs to be escaped\r\n const unEscapeKeys = Object.keys(unEscapeList);\r\n const source = '(?:' + unEscapeKeys.join('|') + ')';\r\n const testRegexp = RegExp(source);\r\n const replaceRegexp = RegExp(source, 'g');\r\n\r\n rawText = rawText == null ? '' : '' + rawText;\r\n\r\n const unescapedText = testRegexp.test(rawText) ? rawText.replace(replaceRegexp, escaper) : rawText;\r\n\r\n const text = removeElements(unescapedText, false);\r\n\r\n return text;\r\n\r\n};\r\n\r\nexport { htmlLog, safeUnescape };\r\n","/**\r\n * nodejs logging to file\r\n * @param logObjects \r\n * @param logObjectsLength \r\n * @param logFontColor \r\n */\r\nconst fileLog = (logObjects: unknown, logObjectsLength: number, logFontColor: string): void => {\r\n\r\n console.log(logObjects);\r\n console.log(logObjectsLength);\r\n console.log(logFontColor);\r\n\r\n throw new Error('sorry this feature is broken');\r\n\r\n try {\r\n\r\n /*var winston = require('winston');\r\n\r\n for (var i = 0; i < logObjectsLength; i++) {\r\n\r\n switch (logFontColor) {\r\n case 'red':\r\n winston.error(logObjects[i]);\r\n break;\r\n case 'yellow':\r\n winston.warn(logObjects[i]);\r\n break;\r\n default:\r\n winston.info(logObjects[i]);\r\n }\r\n\r\n }*/\r\n\r\n } catch (e) {\r\n\r\n // winston is not installed\r\n\r\n }\r\n\r\n};\r\n\r\nexport { fileLog };\r\n","import { htmlLog } from './log/adapters/html';\r\nimport { fileLog } from './log/adapters/file';\r\n\r\nconst defaultLogFontColor = 'default';\r\nconst defaultLogBackgroundColor = 'default';\r\n//const logSpecial = false;\r\nconst logVerbose = true;\r\n\r\n/**\r\n * log messages\r\n * @param args \r\n */\r\nconst log = (...args: unknown[]): void => {\r\n\r\n // is console defined, some older IEs don't have a console\r\n if (typeof (console) === 'undefined') {\r\n\r\n throw new Error('This browser does not support console');\r\n\r\n }\r\n\r\n // extract options and get objects to log\r\n // read: https://github.com/Microsoft/TypeScript/issues/1609\r\n const logArguments = handleLogArguments(args);\r\n\r\n const logObjects = logArguments.objects;\r\n const logFontColor = logArguments.fontColor;\r\n const logBackgroundColor = logArguments.backgroundColor;\r\n\r\n const logObjectsLength = logObjects.length;\r\n\r\n // nodejs or browser mode\r\n if (typeof (window) === 'undefined') {\r\n\r\n if (typeof (logVerbose) !== 'undefined'\r\n && logVerbose === true) {\r\n\r\n // get background and fontColor codes\r\n const color = getServerColors(logFontColor, logBackgroundColor);\r\n\r\n // log each object\r\n for (let i = 0; i < logObjectsLength; i++) {\r\n\r\n if (typeof (logObjects[i]) === 'string') {\r\n console.log(color.background + color.font + logObjects[i] + color.reset);\r\n } else {\r\n console.log(logObjects[i]);\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n // log to file if logSpecial is enabled or if the fontColor is red\r\n // if (logSpecial === true || logFontColor === 'red') {\r\n if (logFontColor === 'red') {\r\n\r\n fileLog(logObjects, logObjectsLength, logFontColor);\r\n\r\n }\r\n\r\n } else {\r\n\r\n // get background and fontColor codes\r\n const color = getClientColors(logFontColor, logBackgroundColor);\r\n\r\n if (typeof (logVerbose) !== 'undefined'\r\n && logVerbose === true) {\r\n\r\n // log each object\r\n for (let i = 0; i < logObjectsLength; i++) {\r\n\r\n if (typeof (logObjects[i]) === 'string') {\r\n console.log('%c' + logObjects[i], 'background: #' + color.background + '; color: #' + color.font);\r\n } else {\r\n console.log(logObjects[i]);\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n // log to html if logSpecial is enabled\r\n //if (logSpecial === true) {\r\n\r\n const stringLogObjects: string[] = [];\r\n\r\n logObjects.forEach((logObject) => {\r\n stringLogObjects.push(logObject.toString())\r\n });\r\n\r\n htmlLog(stringLogObjects, logObjectsLength, color.font, color.background);\r\n\r\n //}\r\n\r\n }\r\n\r\n};\r\n\r\ninterface IColors {\r\n red: string;\r\n green: string;\r\n yellow: string;\r\n blue: string;\r\n magenta: string;\r\n cyan: string;\r\n white: string;\r\n black: string;\r\n [key: string]: string;\r\n}\r\n\r\n/**\r\n * get the client side (browser) colors\r\n * @param logFontColor \r\n * @param logBackgroundColor \r\n */\r\nconst getClientColors = (logFontColor: string, logBackgroundColor: string) => {\r\n\r\n const colors: IColors = {\r\n red: 'FF0000',\r\n green: '00FF00',\r\n yellow: 'FFFF00',\r\n blue: '0000FF',\r\n magenta: 'FF00FF',\r\n cyan: '00FFFF',\r\n white: 'FFFFFF',\r\n black: '000000'\r\n };\r\n\r\n let fontColor;\r\n let backgroundColor;\r\n\r\n // font color\r\n if (typeof (logFontColor) === 'undefined'\r\n || logFontColor === 'default') {\r\n\r\n fontColor = colors['black'];\r\n\r\n } else {\r\n\r\n if (typeof (colors[logFontColor]) !== 'undefined') {\r\n fontColor = colors[logFontColor];\r\n } else {\r\n throw 'unknown fontColor in utilities console log';\r\n }\r\n\r\n }\r\n\r\n // background color\r\n if (typeof (logBackgroundColor) === 'undefined'\r\n || logBackgroundColor === 'default') {\r\n\r\n backgroundColor = colors['white'];\r\n\r\n } else {\r\n\r\n if (typeof (colors[logBackgroundColor]) !== 'undefined') {\r\n backgroundColor = colors[logBackgroundColor];\r\n } else {\r\n throw 'unknown fontColor in utilities console log';\r\n }\r\n\r\n }\r\n\r\n return { font: fontColor, background: backgroundColor };\r\n\r\n};\r\n\r\n/**\r\n * get the colors for the backend (server) console\r\n * @param logFontColor \r\n * @param logBackgroundColor \r\n */\r\nconst getServerColors = (logFontColor: string, logBackgroundColor: string) => {\r\n\r\n const backgroundColors: IColors = {\r\n black: '\\u001b[40m',\r\n red: '\\u001b[41m',\r\n green: '\\u001b[42m',\r\n yellow: '\\u001b[43m',\r\n blue: '\\u001b[44m',\r\n magenta: '\\u001b[45m',\r\n cyan: '\\u001b[46m',\r\n white: '\\u001b[47m'\r\n };\r\n\r\n\r\n\r\n const foregroundColors: IColors = {\r\n black: '\\u001b[30m',\r\n red: '\\u001b[31m',\r\n green: '\\u001b[32m',\r\n yellow: '\\u001b[33m',\r\n blue: '\\u001b[34m',\r\n magenta: '\\u001b[35m',\r\n cyan: '\\u001b[36m',\r\n white: '\\u001b[37m'\r\n };\r\n\r\n let fontColor;\r\n let backgroundColor;\r\n\r\n // font color\r\n if (typeof (logFontColor) === 'undefined'\r\n || logFontColor === 'default') {\r\n\r\n fontColor = foregroundColors['white'];\r\n\r\n } else {\r\n\r\n if (typeof (foregroundColors[logFontColor]) !== 'undefined') {\r\n fontColor = foregroundColors[logFontColor];\r\n } else {\r\n throw 'unknown font color in utilities console log';\r\n }\r\n\r\n }\r\n\r\n // background color\r\n if (typeof (logBackgroundColor) === 'undefined'\r\n || logBackgroundColor === 'default') {\r\n\r\n backgroundColor = backgroundColors['black'];\r\n\r\n } else {\r\n\r\n if (typeof (backgroundColors[logBackgroundColor]) !== 'undefined') {\r\n backgroundColor = backgroundColors[logBackgroundColor];\r\n } else {\r\n throw 'unknown background color in utilities console log';\r\n }\r\n\r\n }\r\n\r\n return { font: fontColor, background: backgroundColor, reset: '\\u001b[0m' };\r\n\r\n};\r\n\r\n/**\r\n * handle log arguments\r\n * extract the color infos from the arguments to log\r\n * @param logArguments \r\n */\r\nconst handleLogArguments = (logArguments?: unknown[]) => {\r\n\r\n const logObjects = [];\r\n\r\n let logFontColor = defaultLogFontColor;\r\n let logBackgroundColor = defaultLogBackgroundColor;\r\n\r\n const argumentsLength = logArguments.length;\r\n\r\n let i;\r\n\r\n for (i = 0; i < argumentsLength; i++) {\r\n\r\n const argument = logArguments[i];\r\n\r\n if (typeof argument === 'string') {\r\n\r\n if (argument.substr(0, 10) === 'fontColor:') {\r\n logFontColor = argument.substr(10, argument.length).trim();\r\n } else if (argument.substr(0, 16) === 'backgroundColor:') {\r\n logBackgroundColor = argument.substr(16, argument.length).trim();\r\n } else {\r\n logObjects.push(argument);\r\n }\r\n\r\n } else {\r\n logObjects.push(argument);\r\n }\r\n\r\n }\r\n\r\n return { objects: logObjects, fontColor: logFontColor, backgroundColor: logBackgroundColor };\r\n\r\n};\r\n\r\nexport { log };\r\n","/**\r\n * pauses your script for a given time, returns a promise that you can use to do so\r\n * @param ms \r\n */\r\nconst sleep = (ms: number): Promise => {\r\n return new Promise(resolve => setTimeout(resolve, ms));\r\n}\r\n\r\nexport { sleep };","/**\r\n * returns a random integer that lies between min (included) and max (included)\r\n * @param min \r\n * @param max \r\n */\r\nconst randomInteger = (min = 0, max = Infinity): number => {\r\n return Math.floor(Math.random() * (max - min + 1) + min);\r\n}\r\n\r\nexport { randomInteger }","import { getTimestamp } from './utilities/datetime';\r\nimport { isServer, isClient } from './utilities/platform';\r\nimport { getUrlParameters, getUrlParameterByName, replaceUrlParameter } from './utilities/url';\r\nimport { decodeUri, encodeUri } from './utilities/uri';\r\nimport { removeString, isArray, includes, find, flat } from './utilities/array';\r\nimport { filterAlphaNumericPlus, capitaliseFirstLetter, stringContains, getSubstringIndex, replacePlaceholders } from './utilities/string';\r\nimport { generateUUID } from './utilities/uuid';\r\nimport { removeElements } from './utilities/html';\r\nimport { log } from './utilities/log';\r\nimport { sleep } from './utilities/helper';\r\nimport { randomInteger } from './utilities/random';\r\n\r\nconst version = '1.0.0';\r\n\r\nexport {\r\n version,\r\n getTimestamp,\r\n isServer,\r\n isClient,\r\n getUrlParameters,\r\n getUrlParameterByName,\r\n replaceUrlParameter,\r\n decodeUri,\r\n encodeUri,\r\n removeString,\r\n isArray,\r\n includes,\r\n find,\r\n flat,\r\n filterAlphaNumericPlus,\r\n capitaliseFirstLetter,\r\n stringContains,\r\n getSubstringIndex,\r\n replacePlaceholders,\r\n generateUUID,\r\n removeElements,\r\n log,\r\n sleep,\r\n randomInteger\r\n};\r\n"],"names":[],"mappings":"AAAA;;;;IAIM,YAAY,GAAG,UAAC,UAAgC;IAAhC,2BAAA,EAAA,eAAgC;IAElD,IAAI,SAAiB,CAAC;IAEtB,IAAI,UAAU,KAAK,EAAE,EAAE;QACnB,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;KACpC;SAAM;QACH,IAAM,IAAI,GAAG,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC;QAClC,SAAS,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;KAC9B;IAED,OAAO,SAAS,CAAC;AAErB;;ACjBA;;;IAGM,QAAQ,GAAG;IAEb,IAAI,QAAQ,MAAM,CAAC,KAAK,QAAQ,EAAE;QAC9B,OAAO,IAAI,CAAC;KACf;SAAM;QACH,OAAO,KAAK,CAAC;KAChB;AAEL,EAAE;AAEF;;;IAGM,QAAQ,GAAG;IAEb,OAAO,CAAC,QAAQ,EAAE,CAAC;AAEvB;;AChBA;;;;IAIM,SAAS,GAAG,UAAC,WAAmB;IAElC,IAAM,qBAAqB,GAAG,KAAK,CAAC;;IAGpC,OAAO,kBAAkB,CAAC,WAAW,CAAC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GAAG,UAAC,EAAU;IACrB,OAAO,IAAI,OAAO,CAAC,UAAA,OAAO,IAAI,OAAA,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,GAAA,CAAC,CAAC;AAC3D;;ACNA;;;;;IAKM,aAAa,GAAG,UAAC,GAAO,EAAE,GAAc;IAAvB,oBAAA,EAAA,OAAO;IAAE,oBAAA,EAAA,cAAc;IAC1C,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC;AAC7D;;ICKM,OAAO,GAAG;;;;"} \ No newline at end of file +{"version":3,"file":"index.esm.js","sources":["../src/utilities/datetime.ts","../src/utilities/platform.ts","../src/utilities/uri.ts","../src/utilities/url.ts","../src/utilities/array.ts","../src/utilities/string.ts","../src/utilities/uuid.ts","../src/utilities/html.ts","../src/utilities/log/adapters/html.ts","../src/utilities/log/adapters/file.ts","../src/utilities/log.ts","../src/utilities/helper.ts","../src/utilities/random.ts","../src/index.ts"],"sourcesContent":["/**\r\n * returns the timestamp for any date or for now(), also works with browsers that dont support es5 Date.now\r\n * @param dateString \r\n */\r\nconst getTimestamp = (dateString: string | number = ''): number => {\r\n\r\n let timestamp: number;\r\n\r\n if (dateString === '') {\r\n timestamp = new Date().getTime();\r\n } else {\r\n const date = new Date(dateString);\r\n timestamp = date.getTime();\r\n }\r\n\r\n return timestamp;\r\n\r\n};\r\n\r\nexport { getTimestamp };\r\n","/**\r\n * does the script run on the server\r\n */\r\nconst isServer = (): boolean => {\r\n\r\n if (typeof (global) === 'object') {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n\r\n};\r\n\r\n/**\r\n * does the script run in a client\r\n */\r\nconst isClient = (): boolean => {\r\n\r\n return !isServer();\r\n\r\n};\r\n\r\nexport { isServer, isClient };\r\n","type TReplaceList = {\r\n [key: string]: string\r\n}\r\n\r\n/**\r\n * decode uri\r\n * @param inputString \r\n */\r\nconst decodeUri = (inputString: string): string => {\r\n\r\n const plusRegularExpression = /\\+/g;\r\n\r\n // replace addition symbol with a space\r\n return decodeURIComponent(inputString.replace(plusRegularExpression, ' '));\r\n\r\n};\r\n\r\n/**\r\n * encode uri\r\n * @param inputString \r\n */\r\nconst encodeUri = (inputString: string): string => {\r\n\r\n const findRegularExpression = /[!'()~]|%20|%00/g;\r\n const replaceList: TReplaceList = {\r\n '!': '%21',\r\n // tslint:disable-next-line\r\n \"'\": '%27',\r\n '(': '%28',\r\n ')': '%29',\r\n '~': '%7E',\r\n '%20': '+',\r\n '%00': '+'\r\n };\r\n\r\n return encodeURIComponent(inputString).replace(findRegularExpression, (match) => { return replaceList[match]; });\r\n\r\n};\r\n\r\nexport { decodeUri, encodeUri };\r\n","import { decodeUri } from './uri';\r\n\r\n/**\r\n * get url parameters\r\n * @param query \r\n */\r\nconst getUrlParameters = (query = ''): { [s: string]: string; } => {\r\n\r\n const urlParameters: { [s: string]: string; } = {};\r\n\r\n if (query !== '' && typeof query === 'string') {\r\n\r\n const questionmarkIndex = query.indexOf('?');\r\n\r\n // if -1 there is no questionmark, skip, all is fine\r\n // else just keep what comes after the questionmark\r\n if (questionmarkIndex !== -1) {\r\n query = query.slice(questionmarkIndex + 1);\r\n }\r\n\r\n const pairs: string[] = query.split('&');\r\n let i;\r\n\r\n for (i = 0; i < pairs.length; i++) {\r\n\r\n const pair: string = pairs[i];\r\n const equalIndex: number = pair.indexOf('=');\r\n let parameterKey = '';\r\n let parameterValue = '';\r\n\r\n if (equalIndex > -1) {\r\n parameterKey = pair.slice(0, equalIndex);\r\n parameterValue = pair.slice(equalIndex + 1);\r\n } else {\r\n parameterKey = pair;\r\n }\r\n\r\n urlParameters[decodeUri(parameterKey)] = decodeUri(parameterValue);\r\n }\r\n\r\n }\r\n\r\n return urlParameters;\r\n\r\n};\r\n\r\n/**\r\n * URL utility to get a parameter by name from an URL\r\n * @param name \r\n * @param url \r\n */\r\nconst getUrlParameterByName = (name: string, url: string): string => {\r\n\r\n if (!url) {\r\n url = window.location.href;\r\n }\r\n\r\n name = name.replace(/[[]]/g, '\\\\$&');\r\n\r\n const regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)');\r\n const results = regex.exec(url);\r\n\r\n if (!results) {\r\n return null;\r\n }\r\n\r\n if (!results[2]) {\r\n return '';\r\n }\r\n\r\n return decodeUri(results[2]);\r\n\r\n};\r\n\r\n/**\r\n * URL utility to replace a given parameter\r\n * @param url \r\n * @param paramName \r\n * @param paramValue \r\n */\r\nconst replaceUrlParameter = (url: string, paramName: string, paramValue: string|number): string => {\r\n\r\n const pattern = new RegExp('\\\\b(' + paramName + '=).*?(&|$)');\r\n\r\n if (url.search(pattern) >= 0) {\r\n return url.replace(pattern, '$1' + paramValue + '$2');\r\n }\r\n\r\n return url + (url.indexOf('?') > 0 ? '&' : '?') + paramName + '=' + paramValue;\r\n\r\n};\r\n\r\nexport { getUrlParameters, getUrlParameterByName, replaceUrlParameter };\r\n","/**\r\n * finds \"removeMe\" and removes it from the array\r\n * @param array \r\n * @param removeMe \r\n */\r\nconst removeString = (myArray: string[], removeMe: string): string[] => {\r\n\r\n const index = myArray.indexOf(removeMe);\r\n\r\n if (index > -1) {\r\n myArray.splice(index, 1);\r\n }\r\n\r\n return myArray;\r\n\r\n};\r\n\r\n/**\r\n * is array with polyfill for older browsers\r\n * @param input \r\n */\r\nconst isArray = (input: unknown): boolean => {\r\n\r\n // MDN is array documentation: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray\r\n\r\n if (!Array.isArray) {\r\n return Object.prototype.toString.call(input) === '[object Array]';\r\n } else {\r\n return Array.isArray(input);\r\n }\r\n\r\n};\r\n\r\ndeclare global {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n interface Array {\r\n includes(valueToFind: string, fromIndex?: number): boolean;\r\n }\r\n}\r\n\r\n/**\r\n * finds \"toFind\" in an array, starting at an optional index\r\n * @param inputArray \r\n * @param toFind \r\n * @param fromIndex \r\n */\r\nconst includes = (inputArray: [], toFind: string, fromIndex?: number): boolean => {\r\n\r\n // MDN includes documentation: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes\r\n\r\n if (!Array.prototype.includes) {\r\n\r\n // https://tc39.github.io/ecma262/#sec-array.prototype.includes\r\n\r\n if (this == null) {\r\n throw new TypeError('\"this\" is null or not defined');\r\n }\r\n\r\n // 1. Let O be ? ToObject(this value)\r\n const o = Object(this);\r\n\r\n // 2. Let len be ? ToLength(? Get(O, \"length\"))\r\n const len = o.length >>> 0;\r\n\r\n // 3. If len is 0, return false\r\n if (len === 0) {\r\n return false;\r\n }\r\n\r\n // 4. Let n be ? ToInteger(fromIndex)\r\n // (If fromIndex is undefined, this step produces the value 0.)\r\n const n = fromIndex | 0;\r\n\r\n // 5. If n ≥ 0, then\r\n // a. Let k be n.\r\n // 6. Else n < 0,\r\n // a. Let k be len + n.\r\n // b. If k < 0, let k be 0.\r\n let k = Math.max(n >= 0 ? n : len - Math.abs(n), 0);\r\n\r\n // 7. Repeat, while k < len\r\n while (k < len) {\r\n // a. Let elementK be the result of ? Get(O, ! ToString(k))\r\n // b. If SameValueZero(valueToFind, elementK) is true, return true\r\n if (sameValueZero(o[k], toFind)) {\r\n return true;\r\n }\r\n // c. Increase k by 1\r\n k++;\r\n }\r\n\r\n // 8. Return false\r\n return false;\r\n } else {\r\n const n = fromIndex | 0;\r\n return inputArray.includes(toFind, n);\r\n }\r\n};\r\n\r\nconst sameValueZero = (x: unknown, y: unknown): boolean => {\r\n return x === y || (typeof x === 'number' && typeof y === 'number' && isNaN(x) && isNaN(y));\r\n};\r\n\r\n/**\r\n * \r\n * @param inputArray \r\n * @param predicate \r\n * @param args \r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\r\nconst find = (inputArray: [], predicate: (this: void, value: never, index: number, obj: never[]) => value is never, args?: any): never | undefined => {\r\n\r\n // MDN find documentation: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find\r\n\r\n if (!Array.prototype.find) {\r\n\r\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find\r\n\r\n // 1. Let O be ? ToObject(this value)\r\n if (this == null) {\r\n throw new TypeError('\"this\" is null or not defined');\r\n }\r\n\r\n const o = Object(this);\r\n\r\n // 2. Let len be ? ToLength(? Get(O, \"length\"))\r\n const len = o.length >>> 0;\r\n\r\n // 3. If IsCallable(predicate) is false, throw a TypeError exception\r\n if (typeof predicate !== 'function') {\r\n throw new TypeError('predicate must be a function');\r\n }\r\n\r\n // 4. If thisArg was supplied, let T be thisArg; else let T be undefined\r\n const thisArg = args[1];\r\n\r\n // 5. Let k be 0.\r\n let k = 0;\r\n\r\n // 6. Repeat, while k < len\r\n while (k < len) {\r\n // a. Let Pk be ! ToString(k)\r\n // b. Let kValue be ? Get(O, Pk)\r\n // c. Let testResult be ToBoolean(? Call(predicate, T, « kValue, k, O »))\r\n // d. If testResult is true, return kValue\r\n const kValue = o[k];\r\n if (predicate.call(thisArg, kValue, k, o)) {\r\n return kValue;\r\n }\r\n // e. Increase k by 1\r\n k++;\r\n }\r\n\r\n // 7. Return undefined\r\n return undefined;\r\n\r\n } else {\r\n // eslint-disable-next-line\r\n return inputArray.find(predicate, args);\r\n }\r\n};\r\n\r\ndeclare global {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n interface Array {\r\n flat(depth: number): [];\r\n }\r\n}\r\n\r\n/**\r\n * array flat polyfill, if depth is unknow set it to \"Infinity\"\r\n * @param inputArray \r\n * @param depth \r\n */\r\nconst flat = (inputArray: [], depth = Infinity): [] => {\r\n\r\n // MDN flat documentation: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flat\r\n\r\n if (!Array.prototype.flat) {\r\n return flatten(inputArray, Math.floor(depth) || 1);\r\n } else {\r\n return inputArray.flat(depth);\r\n }\r\n\r\n};\r\n\r\n/**\r\n * flattens a multidimensional array\r\n * @param inputArray \r\n * @param depth \r\n */\r\nconst flatten = (inputArray: [], depth = Infinity): [] => {\r\n\r\n const flattend: [] = [];\r\n\r\n for (const el of inputArray) {\r\n if (isArray(el) && depth > 0) {\r\n flatten(el, depth - 1);\r\n } else {\r\n flattend.push(el);\r\n }\r\n }\r\n\r\n return flattend;\r\n\r\n};\r\n\r\nexport { removeString, isArray, includes, find, flat };\r\n","/**\r\n * filters a string\r\n * removes everything that is a not an alpha or numeric character, plus\r\n * the characters if any got specified as second argument\r\n * @param inputString \r\n * @param specialCharacters \r\n */\r\nconst filterAlphaNumericPlus = (inputString: string, specialCharacters: string): string|boolean => {\r\n\r\n if (typeof (inputString) === 'string' && inputString.length > 0) {\r\n\r\n let outputString;\r\n\r\n if (specialCharacters !== undefined) {\r\n\r\n const regex = RegExp('[^a-z0-9' + specialCharacters + ']', 'gi');\r\n\r\n outputString = inputString.replace(regex, '');\r\n\r\n } else {\r\n outputString = inputString.replace(/[^a-z0-9]/gi, '');\r\n }\r\n\r\n return outputString;\r\n\r\n }\r\n\r\n return false;\r\n\r\n};\r\n\r\n/**\r\n * capitalise first letter of a string\r\n * @param inputString \r\n */\r\nconst capitaliseFirstLetter = (inputString: string): string => {\r\n\r\n return inputString.charAt(0).toUpperCase() + inputString.slice(1);\r\n\r\n};\r\n\r\n/**\r\n * does a string contain another string\r\n * @param inputString \r\n * @param contains \r\n */\r\nconst stringContains = (inputString: string, contains: string): boolean => {\r\n\r\n if (typeof inputString !== 'string') {\r\n throw 'input is not a string';\r\n }\r\n\r\n if (inputString.indexOf(contains) > -1) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n\r\n};\r\n\r\n/**\r\n * get the index of a substring in a string with optional nth time it occurs\r\n * @param inputString \r\n * @param substring \r\n * @param nthTime \r\n */\r\nconst getSubstringIndex = (inputString: string, substring: string, nthTime: number): number => {\r\n\r\n let times = 0;\r\n let index = null;\r\n\r\n if (nthTime === 0) {\r\n nthTime = 1;\r\n }\r\n\r\n while (times < nthTime && index !== -1) {\r\n\r\n index = inputString.indexOf(substring, index + 1);\r\n times++;\r\n\r\n }\r\n\r\n return index;\r\n\r\n};\r\n\r\n/**\r\n * replace the placeholder(s) with some value\r\n * @param input \r\n * @param replacements \r\n */\r\nconst replacePlaceholders = (input: string, replacements: string): string => {\r\n\r\n let output = input;\r\n\r\n if (typeof input === 'string' && typeof replacements === 'object') {\r\n\r\n output = input.replace(/\\b\\w+?\\b/g, function replacePlaceHolder(placeholder) {\r\n return Object.prototype.hasOwnProperty.call(replacements, placeholder) ? replacements[placeholder] : placeholder;\r\n });\r\n\r\n }\r\n\r\n return output;\r\n\r\n};\r\n\r\nexport { filterAlphaNumericPlus, capitaliseFirstLetter, stringContains, getSubstringIndex, replacePlaceholders };\r\n","/**\r\n * returns a universally unique identifier\r\n */\r\nconst generateUUID = (): string => {\r\n\r\n // http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript\r\n\r\n // http://www.ietf.org/rfc/rfc4122.txt\r\n \r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const s: any[] = [];\r\n const hexDigits = '0123456789abcdef';\r\n let i;\r\n\r\n for (i = 0; i < 36; i++) {\r\n s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);\r\n }\r\n\r\n s[14] = 4; // bits 12-15 of the time_hi_and_version field to 0010\r\n s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1); // bits 6-7 of the clock_seq_hi_and_reserved to 01\r\n s[8] = s[13] = s[18] = s[23] = '-';\r\n\r\n const uuid = s.join('');\r\n\r\n return uuid;\r\n\r\n};\r\n\r\nexport { generateUUID };\r\n","/**\r\n * extracts html elements (and their content) from strings\r\n * @param text \r\n * @param removeTextBetweenTags \r\n */\r\nconst removeElements = (text: string, removeTextBetweenTags: boolean): string => {\r\n\r\n if (removeTextBetweenTags === false) {\r\n\r\n // replace single tags\r\n text = text.replace(/<[^>]*>?/g, '');\r\n\r\n } else {\r\n\r\n // replace all tags and whats inside\r\n text = text.replace(/<[^>]*>[^>]*<\\/[^>]*>?/g, '');\r\n\r\n // replace single tags\r\n text = text.replace(/<[^>]*>?/g, '');\r\n\r\n }\r\n\r\n return text;\r\n\r\n};\r\n\r\nexport { removeElements };\r\n","import { removeElements } from './../../html';\r\n\r\n/**\r\n * html log\r\n * create a div an insert the messages in div\r\n * can be usefull on mobile if no other console is available\r\n * @param logObjects \r\n * @param logObjectsLength \r\n * @param logFontColor \r\n * @param logBackgroundColor \r\n */\r\nconst htmlLog = (logObjects: string[], logObjectsLength: number, logFontColor: string, logBackgroundColor: string): void => {\r\n\r\n // TODO: fix: seems that if logging starts before \"domload\" some\r\n // messages get lost\r\n\r\n if (document.getElementById('log') === null) {\r\n\r\n const logDiv = document.createElement('div');\r\n\r\n logDiv.id = 'log';\r\n\r\n logDiv.style.cssText = 'position: absolute; overflow: scroll; left: 0; bottom: 0; padding: 0; margin: 0; border: 0; z-index: 999999; width: 100%; height: 20%; background-color: #fff;';\r\n\r\n document.body.appendChild(logDiv);\r\n\r\n }\r\n\r\n let i;\r\n\r\n for (i = 0; i < logObjectsLength; i++) {\r\n\r\n const logSpan = document.createElement('span');\r\n\r\n logSpan.style.cssText = 'color: #' + logFontColor + '; background-color: #' + logBackgroundColor + ';';\r\n\r\n const logObject = logObjects[i];\r\n\r\n const spanContent = document.createTextNode(logObject);\r\n\r\n logSpan.appendChild(spanContent);\r\n\r\n document.getElementById('log').appendChild(logSpan);\r\n\r\n const brElement = document.createElement('br');\r\n\r\n document.getElementById('log').appendChild(brElement);\r\n\r\n }\r\n\r\n};\r\n\r\n/**\r\n * extracts html elements (and their content) from strings\r\n * @param rawText \r\n * @param extendedEscape \r\n * @param myEscapeList \r\n */\r\nconst safeUnescape = (rawText: string, extendedEscape = false, myEscapeList: string[]): string => {\r\n\r\n interface IEscapeList {\r\n [key: string]: string;\r\n }\r\n\r\n const unEscapeList: IEscapeList = {\r\n // usually you would just escape (unescape) characters that get\r\n // used in (x)html\r\n '&': '&',\r\n '<': '<',\r\n '>': '>',\r\n '"': '\"',\r\n ''': '\\'',\r\n '`': '`'\r\n };\r\n\r\n // by default also use extended list\r\n if (extendedEscape === true) {\r\n\r\n const unEscapeExtendedList: IEscapeList = {\r\n // but in the case where everything has been encoded lets decode these too\r\n '‘': '‘',\r\n '’': '’',\r\n '‚': '‚',\r\n '“': '“',\r\n '”': '”',\r\n '„': '„',\r\n '†': '†',\r\n '‡': '‡',\r\n '‰': '‰',\r\n '‹': '‹',\r\n '›': '›',\r\n '–': '-',\r\n '—': '—',\r\n ' ': ' ',\r\n '¡': '¡',\r\n '¢': '¢',\r\n '£': '£',\r\n '¤': '¤',\r\n '¥': '¥',\r\n '¦': '¦',\r\n '&brkbar;': '¦',\r\n '§': '§',\r\n '¨': '¨',\r\n '¨': '¨',\r\n '©': '©',\r\n 'ª': 'ª',\r\n '«': '«',\r\n '¬': '¬',\r\n '­': ' ',\r\n '®': '®',\r\n '¯': '¯',\r\n '&hibar;': '¯',\r\n '°': '°',\r\n '±': '±',\r\n '²': '²',\r\n '³': '³',\r\n '´': '´',\r\n 'µ': 'µ',\r\n '¶': '¶',\r\n '·': '·',\r\n '¸': '¸',\r\n '¹': '¹',\r\n 'º': 'º',\r\n '»': '»',\r\n '¼': '¼',\r\n '½': '½',\r\n '¾': '¾',\r\n '¿': '¿'\r\n };\r\n\r\n for (const key in unEscapeExtendedList) {\r\n unEscapeList[key] = unEscapeExtendedList[key];\r\n }\r\n\r\n }\r\n\r\n if (myEscapeList !== undefined) {\r\n\r\n for (const key in myEscapeList) {\r\n unEscapeList[key] = myEscapeList[key];\r\n }\r\n\r\n }\r\n\r\n const escaper = function (match: string) {\r\n return unEscapeList[match];\r\n };\r\n\r\n // regexes for identifying a key that needs to be escaped\r\n const unEscapeKeys = Object.keys(unEscapeList);\r\n const source = '(?:' + unEscapeKeys.join('|') + ')';\r\n const testRegexp = RegExp(source);\r\n const replaceRegexp = RegExp(source, 'g');\r\n\r\n rawText = rawText == null ? '' : '' + rawText;\r\n\r\n const unescapedText = testRegexp.test(rawText) ? rawText.replace(replaceRegexp, escaper) : rawText;\r\n\r\n const text = removeElements(unescapedText, false);\r\n\r\n return text;\r\n\r\n};\r\n\r\nexport { htmlLog, safeUnescape };\r\n","/**\r\n * nodejs logging to file\r\n * @param logObjects \r\n * @param logObjectsLength \r\n * @param logFontColor \r\n */\r\nconst fileLog = (logObjects: unknown, logObjectsLength: number, logFontColor: string): void => {\r\n\r\n console.log(logObjects);\r\n console.log(logObjectsLength);\r\n console.log(logFontColor);\r\n\r\n throw new Error('sorry this feature is broken');\r\n\r\n try {\r\n\r\n /*var winston = require('winston');\r\n\r\n for (var i = 0; i < logObjectsLength; i++) {\r\n\r\n switch (logFontColor) {\r\n case 'red':\r\n winston.error(logObjects[i]);\r\n break;\r\n case 'yellow':\r\n winston.warn(logObjects[i]);\r\n break;\r\n default:\r\n winston.info(logObjects[i]);\r\n }\r\n\r\n }*/\r\n\r\n } catch (e) {\r\n\r\n // winston is not installed\r\n\r\n }\r\n\r\n};\r\n\r\nexport { fileLog };\r\n","import { htmlLog } from './log/adapters/html';\r\nimport { fileLog } from './log/adapters/file';\r\n\r\nconst defaultLogFontColor = 'default';\r\nconst defaultLogBackgroundColor = 'default';\r\n//const logSpecial = false;\r\nconst logVerbose = true;\r\n\r\n/**\r\n * log messages\r\n * @param args \r\n */\r\nconst log = (...args: unknown[]): void => {\r\n\r\n // is console defined, some older IEs don't have a console\r\n if (typeof (console) === 'undefined') {\r\n\r\n throw new Error('This browser does not support console');\r\n\r\n }\r\n\r\n // extract options and get objects to log\r\n // read: https://github.com/Microsoft/TypeScript/issues/1609\r\n const logArguments = handleLogArguments(args);\r\n\r\n const logObjects = logArguments.objects;\r\n const logFontColor = logArguments.fontColor;\r\n const logBackgroundColor = logArguments.backgroundColor;\r\n\r\n const logObjectsLength = logObjects.length;\r\n\r\n // nodejs or browser mode\r\n if (typeof (window) === 'undefined') {\r\n\r\n if (typeof (logVerbose) !== 'undefined'\r\n && logVerbose === true) {\r\n\r\n // get background and fontColor codes\r\n const color = getServerColors(logFontColor, logBackgroundColor);\r\n\r\n // log each object\r\n for (let i = 0; i < logObjectsLength; i++) {\r\n\r\n if (typeof (logObjects[i]) === 'string') {\r\n console.log(color.background + color.font + logObjects[i] + color.reset);\r\n } else {\r\n console.log(logObjects[i]);\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n // log to file if logSpecial is enabled or if the fontColor is red\r\n // if (logSpecial === true || logFontColor === 'red') {\r\n if (logFontColor === 'red') {\r\n\r\n fileLog(logObjects, logObjectsLength, logFontColor);\r\n\r\n }\r\n\r\n } else {\r\n\r\n // get background and fontColor codes\r\n const color = getClientColors(logFontColor, logBackgroundColor);\r\n\r\n if (typeof (logVerbose) !== 'undefined'\r\n && logVerbose === true) {\r\n\r\n // log each object\r\n for (let i = 0; i < logObjectsLength; i++) {\r\n\r\n if (typeof (logObjects[i]) === 'string') {\r\n console.log('%c' + logObjects[i], 'background: #' + color.background + '; color: #' + color.font);\r\n } else {\r\n console.log(logObjects[i]);\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n // log to html if logSpecial is enabled\r\n //if (logSpecial === true) {\r\n\r\n const stringLogObjects: string[] = [];\r\n\r\n logObjects.forEach((logObject) => {\r\n stringLogObjects.push(logObject.toString())\r\n });\r\n\r\n htmlLog(stringLogObjects, logObjectsLength, color.font, color.background);\r\n\r\n //}\r\n\r\n }\r\n\r\n};\r\n\r\ninterface IColors {\r\n red: string;\r\n green: string;\r\n yellow: string;\r\n blue: string;\r\n magenta: string;\r\n cyan: string;\r\n white: string;\r\n black: string;\r\n [key: string]: string;\r\n}\r\n\r\n/**\r\n * get the client side (browser) colors\r\n * @param logFontColor \r\n * @param logBackgroundColor \r\n */\r\nconst getClientColors = (logFontColor: string, logBackgroundColor: string) => {\r\n\r\n const colors: IColors = {\r\n red: 'FF0000',\r\n green: '00FF00',\r\n yellow: 'FFFF00',\r\n blue: '0000FF',\r\n magenta: 'FF00FF',\r\n cyan: '00FFFF',\r\n white: 'FFFFFF',\r\n black: '000000'\r\n };\r\n\r\n let fontColor;\r\n let backgroundColor;\r\n\r\n // font color\r\n if (typeof (logFontColor) === 'undefined'\r\n || logFontColor === 'default') {\r\n\r\n fontColor = colors['black'];\r\n\r\n } else {\r\n\r\n if (typeof (colors[logFontColor]) !== 'undefined') {\r\n fontColor = colors[logFontColor];\r\n } else {\r\n throw 'unknown fontColor in utilities console log';\r\n }\r\n\r\n }\r\n\r\n // background color\r\n if (typeof (logBackgroundColor) === 'undefined'\r\n || logBackgroundColor === 'default') {\r\n\r\n backgroundColor = colors['white'];\r\n\r\n } else {\r\n\r\n if (typeof (colors[logBackgroundColor]) !== 'undefined') {\r\n backgroundColor = colors[logBackgroundColor];\r\n } else {\r\n throw 'unknown fontColor in utilities console log';\r\n }\r\n\r\n }\r\n\r\n return { font: fontColor, background: backgroundColor };\r\n\r\n};\r\n\r\n/**\r\n * get the colors for the backend (server) console\r\n * @param logFontColor \r\n * @param logBackgroundColor \r\n */\r\nconst getServerColors = (logFontColor: string, logBackgroundColor: string) => {\r\n\r\n const backgroundColors: IColors = {\r\n black: '\\u001b[40m',\r\n red: '\\u001b[41m',\r\n green: '\\u001b[42m',\r\n yellow: '\\u001b[43m',\r\n blue: '\\u001b[44m',\r\n magenta: '\\u001b[45m',\r\n cyan: '\\u001b[46m',\r\n white: '\\u001b[47m'\r\n };\r\n\r\n\r\n\r\n const foregroundColors: IColors = {\r\n black: '\\u001b[30m',\r\n red: '\\u001b[31m',\r\n green: '\\u001b[32m',\r\n yellow: '\\u001b[33m',\r\n blue: '\\u001b[34m',\r\n magenta: '\\u001b[35m',\r\n cyan: '\\u001b[36m',\r\n white: '\\u001b[37m'\r\n };\r\n\r\n let fontColor;\r\n let backgroundColor;\r\n\r\n // font color\r\n if (typeof (logFontColor) === 'undefined'\r\n || logFontColor === 'default') {\r\n\r\n fontColor = foregroundColors['white'];\r\n\r\n } else {\r\n\r\n if (typeof (foregroundColors[logFontColor]) !== 'undefined') {\r\n fontColor = foregroundColors[logFontColor];\r\n } else {\r\n throw 'unknown font color in utilities console log';\r\n }\r\n\r\n }\r\n\r\n // background color\r\n if (typeof (logBackgroundColor) === 'undefined'\r\n || logBackgroundColor === 'default') {\r\n\r\n backgroundColor = backgroundColors['black'];\r\n\r\n } else {\r\n\r\n if (typeof (backgroundColors[logBackgroundColor]) !== 'undefined') {\r\n backgroundColor = backgroundColors[logBackgroundColor];\r\n } else {\r\n throw 'unknown background color in utilities console log';\r\n }\r\n\r\n }\r\n\r\n return { font: fontColor, background: backgroundColor, reset: '\\u001b[0m' };\r\n\r\n};\r\n\r\n/**\r\n * handle log arguments\r\n * extract the color infos from the arguments to log\r\n * @param logArguments \r\n */\r\nconst handleLogArguments = (logArguments?: unknown[]) => {\r\n\r\n const logObjects = [];\r\n\r\n let logFontColor = defaultLogFontColor;\r\n let logBackgroundColor = defaultLogBackgroundColor;\r\n\r\n const argumentsLength = logArguments.length;\r\n\r\n let i;\r\n\r\n for (i = 0; i < argumentsLength; i++) {\r\n\r\n const argument = logArguments[i];\r\n\r\n if (typeof argument === 'string') {\r\n\r\n if (argument.substr(0, 10) === 'fontColor:') {\r\n logFontColor = argument.substr(10, argument.length).trim();\r\n } else if (argument.substr(0, 16) === 'backgroundColor:') {\r\n logBackgroundColor = argument.substr(16, argument.length).trim();\r\n } else {\r\n logObjects.push(argument);\r\n }\r\n\r\n } else {\r\n logObjects.push(argument);\r\n }\r\n\r\n }\r\n\r\n return { objects: logObjects, fontColor: logFontColor, backgroundColor: logBackgroundColor };\r\n\r\n};\r\n\r\nexport { log };\r\n","/**\r\n * pauses your script for a given time, returns a promise that you can use to do so\r\n * @param ms \r\n */\r\nconst sleep = (ms: number): Promise => {\r\n return new Promise(resolve => setTimeout(resolve, ms));\r\n}\r\n\r\nexport { sleep };","/**\r\n * returns a random integer that lies between min (included) and max (included)\r\n * @param min \r\n * @param max \r\n */\r\nconst randomInteger = (min = 0, max = Infinity): number => {\r\n return Math.floor(Math.random() * (max - min + 1) + min);\r\n}\r\n\r\nconst choice = (sequence: unknown[] = []): unknown => {\r\n return sequence[Math.floor(Math.random() * sequence.length)];\r\n}\r\n\r\nexport { randomInteger, choice }","import { getTimestamp } from './utilities/datetime';\r\nimport { isServer, isClient } from './utilities/platform';\r\nimport { getUrlParameters, getUrlParameterByName, replaceUrlParameter } from './utilities/url';\r\nimport { decodeUri, encodeUri } from './utilities/uri';\r\nimport { removeString, isArray, includes, find, flat } from './utilities/array';\r\nimport { filterAlphaNumericPlus, capitaliseFirstLetter, stringContains, getSubstringIndex, replacePlaceholders } from './utilities/string';\r\nimport { generateUUID } from './utilities/uuid';\r\nimport { removeElements } from './utilities/html';\r\nimport { log } from './utilities/log';\r\nimport { sleep } from './utilities/helper';\r\nimport { randomInteger, choice } from './utilities/random';\r\n\r\nconst version = '1.0.0';\r\n\r\nexport {\r\n version,\r\n getTimestamp,\r\n isServer,\r\n isClient,\r\n getUrlParameters,\r\n getUrlParameterByName,\r\n replaceUrlParameter,\r\n decodeUri,\r\n encodeUri,\r\n removeString,\r\n isArray,\r\n includes,\r\n find,\r\n flat,\r\n filterAlphaNumericPlus,\r\n capitaliseFirstLetter,\r\n stringContains,\r\n getSubstringIndex,\r\n replacePlaceholders,\r\n generateUUID,\r\n removeElements,\r\n log,\r\n sleep,\r\n randomInteger,\r\n choice\r\n};\r\n"],"names":[],"mappings":"AAAA;;;;IAIM,YAAY,GAAG,UAAC,UAAgC;IAAhC,2BAAA,EAAA,eAAgC;IAElD,IAAI,SAAiB,CAAC;IAEtB,IAAI,UAAU,KAAK,EAAE,EAAE;QACnB,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;KACpC;SAAM;QACH,IAAM,IAAI,GAAG,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC;QAClC,SAAS,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;KAC9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kBAAkB,GAAG,QAAQ,CAAC,MAAM,CAAC,EAAE,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;aACpE;iBAAM;gBACH,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;aAC7B;SAEJ;aAAM;YACH,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;SAC7B;KAEJ;IAED,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,eAAe,EAAE,kBAAkB,EAAE,CAAC;AAEjG,CAAC;;ACpRD;;;;IAIM,KAAK,GAAG,UAAC,EAAU;IACrB,OAAO,IAAI,OAAO,CAAC,UAAA,OAAO,IAAI,OAAA,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,GAAA,CAAC,CAAC;AAC3D;;ACNA;;;;;IAKM,aAAa,GAAG,UAAC,GAAO,EAAE,GAAc;IAAvB,oBAAA,EAAA,OAAO;IAAE,oBAAA,EAAA,cAAc;IAC1C,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC;AAC7D,EAAC;IAEK,MAAM,GAAG,UAAC,QAAwB;IAAxB,yBAAA,EAAA,aAAwB;IACpC,OAAO,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;AACjE;;ICCM,OAAO,GAAG;;;;"} \ No newline at end of file diff --git a/dist/index.js b/dist/index.js index 365bf5e..3eca11e 100644 --- a/dist/index.js +++ b/dist/index.js @@ -708,10 +708,15 @@ if (max === void 0) { max = Infinity; } return Math.floor(Math.random() * (max - min + 1) + min); }; + var choice = function (sequence) { + if (sequence === void 0) { sequence = []; } + return sequence[Math.floor(Math.random() * sequence.length)]; + }; var version = '1.0.0'; exports.capitaliseFirstLetter = capitaliseFirstLetter; + exports.choice = choice; exports.decodeUri = decodeUri; exports.encodeUri = encodeUri; exports.filterAlphaNumericPlus = filterAlphaNumericPlus; diff --git a/dist/index.js.map b/dist/index.js.map index 0666f88..a2a3f5c 100644 --- a/dist/index.js.map +++ b/dist/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sources":["../src/utilities/datetime.ts","../src/utilities/platform.ts","../src/utilities/uri.ts","../src/utilities/url.ts","../src/utilities/array.ts","../src/utilities/string.ts","../src/utilities/uuid.ts","../src/utilities/html.ts","../src/utilities/log/adapters/html.ts","../src/utilities/log/adapters/file.ts","../src/utilities/log.ts","../src/utilities/helper.ts","../src/utilities/random.ts","../src/index.ts"],"sourcesContent":["/**\r\n * returns the timestamp for any date or for now(), also works with browsers that dont support es5 Date.now\r\n * @param dateString \r\n */\r\nconst getTimestamp = (dateString: string | number = ''): number => {\r\n\r\n let timestamp: number;\r\n\r\n if (dateString === '') {\r\n timestamp = new Date().getTime();\r\n } else {\r\n const date = new Date(dateString);\r\n timestamp = date.getTime();\r\n }\r\n\r\n return timestamp;\r\n\r\n};\r\n\r\nexport { getTimestamp };\r\n","/**\r\n * does the script run on the server\r\n */\r\nconst isServer = (): boolean => {\r\n\r\n if (typeof (global) === 'object') {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n\r\n};\r\n\r\n/**\r\n * does the script run in a client\r\n */\r\nconst isClient = (): boolean => {\r\n\r\n return !isServer();\r\n\r\n};\r\n\r\nexport { isServer, isClient };\r\n","type TReplaceList = {\r\n [key: string]: string\r\n}\r\n\r\n/**\r\n * decode uri\r\n * @param inputString \r\n */\r\nconst decodeUri = (inputString: string): string => {\r\n\r\n const plusRegularExpression = /\\+/g;\r\n\r\n // replace addition symbol with a space\r\n return decodeURIComponent(inputString.replace(plusRegularExpression, ' '));\r\n\r\n};\r\n\r\n/**\r\n * encode uri\r\n * @param inputString \r\n */\r\nconst encodeUri = (inputString: string): string => {\r\n\r\n const findRegularExpression = /[!'()~]|%20|%00/g;\r\n const replaceList: TReplaceList = {\r\n '!': '%21',\r\n // tslint:disable-next-line\r\n \"'\": '%27',\r\n '(': '%28',\r\n ')': '%29',\r\n '~': '%7E',\r\n '%20': '+',\r\n '%00': '+'\r\n };\r\n\r\n return encodeURIComponent(inputString).replace(findRegularExpression, (match) => { return replaceList[match]; });\r\n\r\n};\r\n\r\nexport { decodeUri, encodeUri };\r\n","import { decodeUri } from './uri';\r\n\r\n/**\r\n * get url parameters\r\n * @param query \r\n */\r\nconst getUrlParameters = (query = ''): { [s: string]: string; } => {\r\n\r\n const urlParameters: { [s: string]: string; } = {};\r\n\r\n if (query !== '' && typeof query === 'string') {\r\n\r\n const questionmarkIndex = query.indexOf('?');\r\n\r\n // if -1 there is no questionmark, skip, all is fine\r\n // else just keep what comes after the questionmark\r\n if (questionmarkIndex !== -1) {\r\n query = query.slice(questionmarkIndex + 1);\r\n }\r\n\r\n const pairs: string[] = query.split('&');\r\n let i;\r\n\r\n for (i = 0; i < pairs.length; i++) {\r\n\r\n const pair: string = pairs[i];\r\n const equalIndex: number = pair.indexOf('=');\r\n let parameterKey = '';\r\n let parameterValue = '';\r\n\r\n if (equalIndex > -1) {\r\n parameterKey = pair.slice(0, equalIndex);\r\n parameterValue = pair.slice(equalIndex + 1);\r\n } else {\r\n parameterKey = pair;\r\n }\r\n\r\n urlParameters[decodeUri(parameterKey)] = decodeUri(parameterValue);\r\n }\r\n\r\n }\r\n\r\n return urlParameters;\r\n\r\n};\r\n\r\n/**\r\n * URL utility to get a parameter by name from an URL\r\n * @param name \r\n * @param url \r\n */\r\nconst getUrlParameterByName = (name: string, url: string): string => {\r\n\r\n if (!url) {\r\n url = window.location.href;\r\n }\r\n\r\n name = name.replace(/[[]]/g, '\\\\$&');\r\n\r\n const regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)');\r\n const results = regex.exec(url);\r\n\r\n if (!results) {\r\n return null;\r\n }\r\n\r\n if (!results[2]) {\r\n return '';\r\n }\r\n\r\n return decodeUri(results[2]);\r\n\r\n};\r\n\r\n/**\r\n * URL utility to replace a given parameter\r\n * @param url \r\n * @param paramName \r\n * @param paramValue \r\n */\r\nconst replaceUrlParameter = (url: string, paramName: string, paramValue: string|number): string => {\r\n\r\n const pattern = new RegExp('\\\\b(' + paramName + '=).*?(&|$)');\r\n\r\n if (url.search(pattern) >= 0) {\r\n return url.replace(pattern, '$1' + paramValue + '$2');\r\n }\r\n\r\n return url + (url.indexOf('?') > 0 ? '&' : '?') + paramName + '=' + paramValue;\r\n\r\n};\r\n\r\nexport { getUrlParameters, getUrlParameterByName, replaceUrlParameter };\r\n","/**\r\n * finds \"removeMe\" and removes it from the array\r\n * @param array \r\n * @param removeMe \r\n */\r\nconst removeString = (myArray: string[], removeMe: string): string[] => {\r\n\r\n const index = myArray.indexOf(removeMe);\r\n\r\n if (index > -1) {\r\n myArray.splice(index, 1);\r\n }\r\n\r\n return myArray;\r\n\r\n};\r\n\r\n/**\r\n * is array with polyfill for older browsers\r\n * @param input \r\n */\r\nconst isArray = (input: unknown): boolean => {\r\n\r\n // MDN is array documentation: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray\r\n\r\n if (!Array.isArray) {\r\n return Object.prototype.toString.call(input) === '[object Array]';\r\n } else {\r\n return Array.isArray(input);\r\n }\r\n\r\n};\r\n\r\ndeclare global {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n interface Array {\r\n includes(valueToFind: string, fromIndex?: number): boolean;\r\n }\r\n}\r\n\r\n/**\r\n * finds \"toFind\" in an array, starting at an optional index\r\n * @param inputArray \r\n * @param toFind \r\n * @param fromIndex \r\n */\r\nconst includes = (inputArray: [], toFind: string, fromIndex?: number): boolean => {\r\n\r\n // MDN includes documentation: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes\r\n\r\n if (!Array.prototype.includes) {\r\n\r\n // https://tc39.github.io/ecma262/#sec-array.prototype.includes\r\n\r\n if (this == null) {\r\n throw new TypeError('\"this\" is null or not defined');\r\n }\r\n\r\n // 1. Let O be ? ToObject(this value)\r\n const o = Object(this);\r\n\r\n // 2. Let len be ? ToLength(? Get(O, \"length\"))\r\n const len = o.length >>> 0;\r\n\r\n // 3. If len is 0, return false\r\n if (len === 0) {\r\n return false;\r\n }\r\n\r\n // 4. Let n be ? ToInteger(fromIndex)\r\n // (If fromIndex is undefined, this step produces the value 0.)\r\n const n = fromIndex | 0;\r\n\r\n // 5. If n ≥ 0, then\r\n // a. Let k be n.\r\n // 6. Else n < 0,\r\n // a. Let k be len + n.\r\n // b. If k < 0, let k be 0.\r\n let k = Math.max(n >= 0 ? n : len - Math.abs(n), 0);\r\n\r\n // 7. Repeat, while k < len\r\n while (k < len) {\r\n // a. Let elementK be the result of ? Get(O, ! ToString(k))\r\n // b. If SameValueZero(valueToFind, elementK) is true, return true\r\n if (sameValueZero(o[k], toFind)) {\r\n return true;\r\n }\r\n // c. Increase k by 1\r\n k++;\r\n }\r\n\r\n // 8. Return false\r\n return false;\r\n } else {\r\n const n = fromIndex | 0;\r\n return inputArray.includes(toFind, n);\r\n }\r\n};\r\n\r\nconst sameValueZero = (x: unknown, y: unknown): boolean => {\r\n return x === y || (typeof x === 'number' && typeof y === 'number' && isNaN(x) && isNaN(y));\r\n};\r\n\r\n/**\r\n * \r\n * @param inputArray \r\n * @param predicate \r\n * @param args \r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\r\nconst find = (inputArray: [], predicate: (this: void, value: never, index: number, obj: never[]) => value is never, args?: any): never | undefined => {\r\n\r\n // MDN find documentation: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find\r\n\r\n if (!Array.prototype.find) {\r\n\r\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find\r\n\r\n // 1. Let O be ? ToObject(this value)\r\n if (this == null) {\r\n throw new TypeError('\"this\" is null or not defined');\r\n }\r\n\r\n const o = Object(this);\r\n\r\n // 2. Let len be ? ToLength(? Get(O, \"length\"))\r\n const len = o.length >>> 0;\r\n\r\n // 3. If IsCallable(predicate) is false, throw a TypeError exception\r\n if (typeof predicate !== 'function') {\r\n throw new TypeError('predicate must be a function');\r\n }\r\n\r\n // 4. If thisArg was supplied, let T be thisArg; else let T be undefined\r\n const thisArg = args[1];\r\n\r\n // 5. Let k be 0.\r\n let k = 0;\r\n\r\n // 6. Repeat, while k < len\r\n while (k < len) {\r\n // a. Let Pk be ! ToString(k)\r\n // b. Let kValue be ? Get(O, Pk)\r\n // c. Let testResult be ToBoolean(? Call(predicate, T, « kValue, k, O »))\r\n // d. If testResult is true, return kValue\r\n const kValue = o[k];\r\n if (predicate.call(thisArg, kValue, k, o)) {\r\n return kValue;\r\n }\r\n // e. Increase k by 1\r\n k++;\r\n }\r\n\r\n // 7. Return undefined\r\n return undefined;\r\n\r\n } else {\r\n // eslint-disable-next-line\r\n return inputArray.find(predicate, args);\r\n }\r\n};\r\n\r\ndeclare global {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n interface Array {\r\n flat(depth: number): [];\r\n }\r\n}\r\n\r\n/**\r\n * array flat polyfill, if depth is unknow set it to \"Infinity\"\r\n * @param inputArray \r\n * @param depth \r\n */\r\nconst flat = (inputArray: [], depth = Infinity): [] => {\r\n\r\n // MDN flat documentation: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flat\r\n\r\n if (!Array.prototype.flat) {\r\n return flatten(inputArray, Math.floor(depth) || 1);\r\n } else {\r\n return inputArray.flat(depth);\r\n }\r\n\r\n};\r\n\r\n/**\r\n * flattens a multidimensional array\r\n * @param inputArray \r\n * @param depth \r\n */\r\nconst flatten = (inputArray: [], depth = Infinity): [] => {\r\n\r\n const flattend: [] = [];\r\n\r\n for (const el of inputArray) {\r\n if (isArray(el) && depth > 0) {\r\n flatten(el, depth - 1);\r\n } else {\r\n flattend.push(el);\r\n }\r\n }\r\n\r\n return flattend;\r\n\r\n};\r\n\r\nexport { removeString, isArray, includes, find, flat };\r\n","/**\r\n * filters a string\r\n * removes everything that is a not an alpha or numeric character, plus\r\n * the characters if any got specified as second argument\r\n * @param inputString \r\n * @param specialCharacters \r\n */\r\nconst filterAlphaNumericPlus = (inputString: string, specialCharacters: string): string|boolean => {\r\n\r\n if (typeof (inputString) === 'string' && inputString.length > 0) {\r\n\r\n let outputString;\r\n\r\n if (specialCharacters !== undefined) {\r\n\r\n const regex = RegExp('[^a-z0-9' + specialCharacters + ']', 'gi');\r\n\r\n outputString = inputString.replace(regex, '');\r\n\r\n } else {\r\n outputString = inputString.replace(/[^a-z0-9]/gi, '');\r\n }\r\n\r\n return outputString;\r\n\r\n }\r\n\r\n return false;\r\n\r\n};\r\n\r\n/**\r\n * capitalise first letter of a string\r\n * @param inputString \r\n */\r\nconst capitaliseFirstLetter = (inputString: string): string => {\r\n\r\n return inputString.charAt(0).toUpperCase() + inputString.slice(1);\r\n\r\n};\r\n\r\n/**\r\n * does a string contain another string\r\n * @param inputString \r\n * @param contains \r\n */\r\nconst stringContains = (inputString: string, contains: string): boolean => {\r\n\r\n if (typeof inputString !== 'string') {\r\n throw 'input is not a string';\r\n }\r\n\r\n if (inputString.indexOf(contains) > -1) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n\r\n};\r\n\r\n/**\r\n * get the index of a substring in a string with optional nth time it occurs\r\n * @param inputString \r\n * @param substring \r\n * @param nthTime \r\n */\r\nconst getSubstringIndex = (inputString: string, substring: string, nthTime: number): number => {\r\n\r\n let times = 0;\r\n let index = null;\r\n\r\n if (nthTime === 0) {\r\n nthTime = 1;\r\n }\r\n\r\n while (times < nthTime && index !== -1) {\r\n\r\n index = inputString.indexOf(substring, index + 1);\r\n times++;\r\n\r\n }\r\n\r\n return index;\r\n\r\n};\r\n\r\n/**\r\n * replace the placeholder(s) with some value\r\n * @param input \r\n * @param replacements \r\n */\r\nconst replacePlaceholders = (input: string, replacements: string): string => {\r\n\r\n let output = input;\r\n\r\n if (typeof input === 'string' && typeof replacements === 'object') {\r\n\r\n output = input.replace(/\\b\\w+?\\b/g, function replacePlaceHolder(placeholder) {\r\n return Object.prototype.hasOwnProperty.call(replacements, placeholder) ? replacements[placeholder] : placeholder;\r\n });\r\n\r\n }\r\n\r\n return output;\r\n\r\n};\r\n\r\nexport { filterAlphaNumericPlus, capitaliseFirstLetter, stringContains, getSubstringIndex, replacePlaceholders };\r\n","/**\r\n * returns a universally unique identifier\r\n */\r\nconst generateUUID = (): string => {\r\n\r\n // http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript\r\n\r\n // http://www.ietf.org/rfc/rfc4122.txt\r\n \r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const s: any[] = [];\r\n const hexDigits = '0123456789abcdef';\r\n let i;\r\n\r\n for (i = 0; i < 36; i++) {\r\n s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);\r\n }\r\n\r\n s[14] = 4; // bits 12-15 of the time_hi_and_version field to 0010\r\n s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1); // bits 6-7 of the clock_seq_hi_and_reserved to 01\r\n s[8] = s[13] = s[18] = s[23] = '-';\r\n\r\n const uuid = s.join('');\r\n\r\n return uuid;\r\n\r\n};\r\n\r\nexport { generateUUID };\r\n","/**\r\n * extracts html elements (and their content) from strings\r\n * @param text \r\n * @param removeTextBetweenTags \r\n */\r\nconst removeElements = (text: string, removeTextBetweenTags: boolean): string => {\r\n\r\n if (removeTextBetweenTags === false) {\r\n\r\n // replace single tags\r\n text = text.replace(/<[^>]*>?/g, '');\r\n\r\n } else {\r\n\r\n // replace all tags and whats inside\r\n text = text.replace(/<[^>]*>[^>]*<\\/[^>]*>?/g, '');\r\n\r\n // replace single tags\r\n text = text.replace(/<[^>]*>?/g, '');\r\n\r\n }\r\n\r\n return text;\r\n\r\n};\r\n\r\nexport { removeElements };\r\n","import { removeElements } from './../../html';\r\n\r\n/**\r\n * html log\r\n * create a div an insert the messages in div\r\n * can be usefull on mobile if no other console is available\r\n * @param logObjects \r\n * @param logObjectsLength \r\n * @param logFontColor \r\n * @param logBackgroundColor \r\n */\r\nconst htmlLog = (logObjects: string[], logObjectsLength: number, logFontColor: string, logBackgroundColor: string): void => {\r\n\r\n // TODO: fix: seems that if logging starts before \"domload\" some\r\n // messages get lost\r\n\r\n if (document.getElementById('log') === null) {\r\n\r\n const logDiv = document.createElement('div');\r\n\r\n logDiv.id = 'log';\r\n\r\n logDiv.style.cssText = 'position: absolute; overflow: scroll; left: 0; bottom: 0; padding: 0; margin: 0; border: 0; z-index: 999999; width: 100%; height: 20%; background-color: #fff;';\r\n\r\n document.body.appendChild(logDiv);\r\n\r\n }\r\n\r\n let i;\r\n\r\n for (i = 0; i < logObjectsLength; i++) {\r\n\r\n const logSpan = document.createElement('span');\r\n\r\n logSpan.style.cssText = 'color: #' + logFontColor + '; background-color: #' + logBackgroundColor + ';';\r\n\r\n const logObject = logObjects[i];\r\n\r\n const spanContent = document.createTextNode(logObject);\r\n\r\n logSpan.appendChild(spanContent);\r\n\r\n document.getElementById('log').appendChild(logSpan);\r\n\r\n const brElement = document.createElement('br');\r\n\r\n document.getElementById('log').appendChild(brElement);\r\n\r\n }\r\n\r\n};\r\n\r\n/**\r\n * extracts html elements (and their content) from strings\r\n * @param rawText \r\n * @param extendedEscape \r\n * @param myEscapeList \r\n */\r\nconst safeUnescape = (rawText: string, extendedEscape = false, myEscapeList: string[]): string => {\r\n\r\n interface IEscapeList {\r\n [key: string]: string;\r\n }\r\n\r\n const unEscapeList: IEscapeList = {\r\n // usually you would just escape (unescape) characters that get\r\n // used in (x)html\r\n '&': '&',\r\n '<': '<',\r\n '>': '>',\r\n '"': '\"',\r\n ''': '\\'',\r\n '`': '`'\r\n };\r\n\r\n // by default also use extended list\r\n if (extendedEscape === true) {\r\n\r\n const unEscapeExtendedList: IEscapeList = {\r\n // but in the case where everything has been encoded lets decode these too\r\n '‘': '‘',\r\n '’': '’',\r\n '‚': '‚',\r\n '“': '“',\r\n '”': '”',\r\n '„': '„',\r\n '†': '†',\r\n '‡': '‡',\r\n '‰': '‰',\r\n '‹': '‹',\r\n '›': '›',\r\n '–': '-',\r\n '—': '—',\r\n ' ': ' ',\r\n '¡': '¡',\r\n '¢': '¢',\r\n '£': '£',\r\n '¤': '¤',\r\n '¥': '¥',\r\n '¦': '¦',\r\n '&brkbar;': '¦',\r\n '§': '§',\r\n '¨': '¨',\r\n '¨': '¨',\r\n '©': '©',\r\n 'ª': 'ª',\r\n '«': '«',\r\n '¬': '¬',\r\n '­': ' ',\r\n '®': '®',\r\n '¯': '¯',\r\n '&hibar;': '¯',\r\n '°': '°',\r\n '±': '±',\r\n '²': '²',\r\n '³': '³',\r\n '´': '´',\r\n 'µ': 'µ',\r\n '¶': '¶',\r\n '·': '·',\r\n '¸': '¸',\r\n '¹': '¹',\r\n 'º': 'º',\r\n '»': '»',\r\n '¼': '¼',\r\n '½': '½',\r\n '¾': '¾',\r\n '¿': '¿'\r\n };\r\n\r\n for (const key in unEscapeExtendedList) {\r\n unEscapeList[key] = unEscapeExtendedList[key];\r\n }\r\n\r\n }\r\n\r\n if (myEscapeList !== undefined) {\r\n\r\n for (const key in myEscapeList) {\r\n unEscapeList[key] = myEscapeList[key];\r\n }\r\n\r\n }\r\n\r\n const escaper = function (match: string) {\r\n return unEscapeList[match];\r\n };\r\n\r\n // regexes for identifying a key that needs to be escaped\r\n const unEscapeKeys = Object.keys(unEscapeList);\r\n const source = '(?:' + unEscapeKeys.join('|') + ')';\r\n const testRegexp = RegExp(source);\r\n const replaceRegexp = RegExp(source, 'g');\r\n\r\n rawText = rawText == null ? '' : '' + rawText;\r\n\r\n const unescapedText = testRegexp.test(rawText) ? rawText.replace(replaceRegexp, escaper) : rawText;\r\n\r\n const text = removeElements(unescapedText, false);\r\n\r\n return text;\r\n\r\n};\r\n\r\nexport { htmlLog, safeUnescape };\r\n","/**\r\n * nodejs logging to file\r\n * @param logObjects \r\n * @param logObjectsLength \r\n * @param logFontColor \r\n */\r\nconst fileLog = (logObjects: unknown, logObjectsLength: number, logFontColor: string): void => {\r\n\r\n console.log(logObjects);\r\n console.log(logObjectsLength);\r\n console.log(logFontColor);\r\n\r\n throw new Error('sorry this feature is broken');\r\n\r\n try {\r\n\r\n /*var winston = require('winston');\r\n\r\n for (var i = 0; i < logObjectsLength; i++) {\r\n\r\n switch (logFontColor) {\r\n case 'red':\r\n winston.error(logObjects[i]);\r\n break;\r\n case 'yellow':\r\n winston.warn(logObjects[i]);\r\n break;\r\n default:\r\n winston.info(logObjects[i]);\r\n }\r\n\r\n }*/\r\n\r\n } catch (e) {\r\n\r\n // winston is not installed\r\n\r\n }\r\n\r\n};\r\n\r\nexport { fileLog };\r\n","import { htmlLog } from './log/adapters/html';\r\nimport { fileLog } from './log/adapters/file';\r\n\r\nconst defaultLogFontColor = 'default';\r\nconst defaultLogBackgroundColor = 'default';\r\n//const logSpecial = false;\r\nconst logVerbose = true;\r\n\r\n/**\r\n * log messages\r\n * @param args \r\n */\r\nconst log = (...args: unknown[]): void => {\r\n\r\n // is console defined, some older IEs don't have a console\r\n if (typeof (console) === 'undefined') {\r\n\r\n throw new Error('This browser does not support console');\r\n\r\n }\r\n\r\n // extract options and get objects to log\r\n // read: https://github.com/Microsoft/TypeScript/issues/1609\r\n const logArguments = handleLogArguments(args);\r\n\r\n const logObjects = logArguments.objects;\r\n const logFontColor = logArguments.fontColor;\r\n const logBackgroundColor = logArguments.backgroundColor;\r\n\r\n const logObjectsLength = logObjects.length;\r\n\r\n // nodejs or browser mode\r\n if (typeof (window) === 'undefined') {\r\n\r\n if (typeof (logVerbose) !== 'undefined'\r\n && logVerbose === true) {\r\n\r\n // get background and fontColor codes\r\n const color = getServerColors(logFontColor, logBackgroundColor);\r\n\r\n // log each object\r\n for (let i = 0; i < logObjectsLength; i++) {\r\n\r\n if (typeof (logObjects[i]) === 'string') {\r\n console.log(color.background + color.font + logObjects[i] + color.reset);\r\n } else {\r\n console.log(logObjects[i]);\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n // log to file if logSpecial is enabled or if the fontColor is red\r\n // if (logSpecial === true || logFontColor === 'red') {\r\n if (logFontColor === 'red') {\r\n\r\n fileLog(logObjects, logObjectsLength, logFontColor);\r\n\r\n }\r\n\r\n } else {\r\n\r\n // get background and fontColor codes\r\n const color = getClientColors(logFontColor, logBackgroundColor);\r\n\r\n if (typeof (logVerbose) !== 'undefined'\r\n && logVerbose === true) {\r\n\r\n // log each object\r\n for (let i = 0; i < logObjectsLength; i++) {\r\n\r\n if (typeof (logObjects[i]) === 'string') {\r\n console.log('%c' + logObjects[i], 'background: #' + color.background + '; color: #' + color.font);\r\n } else {\r\n console.log(logObjects[i]);\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n // log to html if logSpecial is enabled\r\n //if (logSpecial === true) {\r\n\r\n const stringLogObjects: string[] = [];\r\n\r\n logObjects.forEach((logObject) => {\r\n stringLogObjects.push(logObject.toString())\r\n });\r\n\r\n htmlLog(stringLogObjects, logObjectsLength, color.font, color.background);\r\n\r\n //}\r\n\r\n }\r\n\r\n};\r\n\r\ninterface IColors {\r\n red: string;\r\n green: string;\r\n yellow: string;\r\n blue: string;\r\n magenta: string;\r\n cyan: string;\r\n white: string;\r\n black: string;\r\n [key: string]: string;\r\n}\r\n\r\n/**\r\n * get the client side (browser) colors\r\n * @param logFontColor \r\n * @param logBackgroundColor \r\n */\r\nconst getClientColors = (logFontColor: string, logBackgroundColor: string) => {\r\n\r\n const colors: IColors = {\r\n red: 'FF0000',\r\n green: '00FF00',\r\n yellow: 'FFFF00',\r\n blue: '0000FF',\r\n magenta: 'FF00FF',\r\n cyan: '00FFFF',\r\n white: 'FFFFFF',\r\n black: '000000'\r\n };\r\n\r\n let fontColor;\r\n let backgroundColor;\r\n\r\n // font color\r\n if (typeof (logFontColor) === 'undefined'\r\n || logFontColor === 'default') {\r\n\r\n fontColor = colors['black'];\r\n\r\n } else {\r\n\r\n if (typeof (colors[logFontColor]) !== 'undefined') {\r\n fontColor = colors[logFontColor];\r\n } else {\r\n throw 'unknown fontColor in utilities console log';\r\n }\r\n\r\n }\r\n\r\n // background color\r\n if (typeof (logBackgroundColor) === 'undefined'\r\n || logBackgroundColor === 'default') {\r\n\r\n backgroundColor = colors['white'];\r\n\r\n } else {\r\n\r\n if (typeof (colors[logBackgroundColor]) !== 'undefined') {\r\n backgroundColor = colors[logBackgroundColor];\r\n } else {\r\n throw 'unknown fontColor in utilities console log';\r\n }\r\n\r\n }\r\n\r\n return { font: fontColor, background: backgroundColor };\r\n\r\n};\r\n\r\n/**\r\n * get the colors for the backend (server) console\r\n * @param logFontColor \r\n * @param logBackgroundColor \r\n */\r\nconst getServerColors = (logFontColor: string, logBackgroundColor: string) => {\r\n\r\n const backgroundColors: IColors = {\r\n black: '\\u001b[40m',\r\n red: '\\u001b[41m',\r\n green: '\\u001b[42m',\r\n yellow: '\\u001b[43m',\r\n blue: '\\u001b[44m',\r\n magenta: '\\u001b[45m',\r\n cyan: '\\u001b[46m',\r\n white: '\\u001b[47m'\r\n };\r\n\r\n\r\n\r\n const foregroundColors: IColors = {\r\n black: '\\u001b[30m',\r\n red: '\\u001b[31m',\r\n green: '\\u001b[32m',\r\n yellow: '\\u001b[33m',\r\n blue: '\\u001b[34m',\r\n magenta: '\\u001b[35m',\r\n cyan: '\\u001b[36m',\r\n white: '\\u001b[37m'\r\n };\r\n\r\n let fontColor;\r\n let backgroundColor;\r\n\r\n // font color\r\n if (typeof (logFontColor) === 'undefined'\r\n || logFontColor === 'default') {\r\n\r\n fontColor = foregroundColors['white'];\r\n\r\n } else {\r\n\r\n if (typeof (foregroundColors[logFontColor]) !== 'undefined') {\r\n fontColor = foregroundColors[logFontColor];\r\n } else {\r\n throw 'unknown font color in utilities console log';\r\n }\r\n\r\n }\r\n\r\n // background color\r\n if (typeof (logBackgroundColor) === 'undefined'\r\n || logBackgroundColor === 'default') {\r\n\r\n backgroundColor = backgroundColors['black'];\r\n\r\n } else {\r\n\r\n if (typeof (backgroundColors[logBackgroundColor]) !== 'undefined') {\r\n backgroundColor = backgroundColors[logBackgroundColor];\r\n } else {\r\n throw 'unknown background color in utilities console log';\r\n }\r\n\r\n }\r\n\r\n return { font: fontColor, background: backgroundColor, reset: '\\u001b[0m' };\r\n\r\n};\r\n\r\n/**\r\n * handle log arguments\r\n * extract the color infos from the arguments to log\r\n * @param logArguments \r\n */\r\nconst handleLogArguments = (logArguments?: unknown[]) => {\r\n\r\n const logObjects = [];\r\n\r\n let logFontColor = defaultLogFontColor;\r\n let logBackgroundColor = defaultLogBackgroundColor;\r\n\r\n const argumentsLength = logArguments.length;\r\n\r\n let i;\r\n\r\n for (i = 0; i < argumentsLength; i++) {\r\n\r\n const argument = logArguments[i];\r\n\r\n if (typeof argument === 'string') {\r\n\r\n if (argument.substr(0, 10) === 'fontColor:') {\r\n logFontColor = argument.substr(10, argument.length).trim();\r\n } else if (argument.substr(0, 16) === 'backgroundColor:') {\r\n logBackgroundColor = argument.substr(16, argument.length).trim();\r\n } else {\r\n logObjects.push(argument);\r\n }\r\n\r\n } else {\r\n logObjects.push(argument);\r\n }\r\n\r\n }\r\n\r\n return { objects: logObjects, fontColor: logFontColor, backgroundColor: logBackgroundColor };\r\n\r\n};\r\n\r\nexport { log };\r\n","/**\r\n * pauses your script for a given time, returns a promise that you can use to do so\r\n * @param ms \r\n */\r\nconst sleep = (ms: number): Promise => {\r\n return new Promise(resolve => setTimeout(resolve, ms));\r\n}\r\n\r\nexport { sleep };","/**\r\n * returns a random integer that lies between min (included) and max (included)\r\n * @param min \r\n * @param max \r\n */\r\nconst randomInteger = (min = 0, max = Infinity): number => {\r\n return Math.floor(Math.random() * (max - min + 1) + min);\r\n}\r\n\r\nexport { randomInteger }","import { getTimestamp } from './utilities/datetime';\r\nimport { isServer, isClient } from './utilities/platform';\r\nimport { getUrlParameters, getUrlParameterByName, replaceUrlParameter } from './utilities/url';\r\nimport { decodeUri, encodeUri } from './utilities/uri';\r\nimport { removeString, isArray, includes, find, flat } from './utilities/array';\r\nimport { filterAlphaNumericPlus, capitaliseFirstLetter, stringContains, getSubstringIndex, replacePlaceholders } from './utilities/string';\r\nimport { generateUUID } from './utilities/uuid';\r\nimport { removeElements } from './utilities/html';\r\nimport { log } from './utilities/log';\r\nimport { sleep } from './utilities/helper';\r\nimport { randomInteger } from './utilities/random';\r\n\r\nconst version = '1.0.0';\r\n\r\nexport {\r\n version,\r\n getTimestamp,\r\n isServer,\r\n isClient,\r\n getUrlParameters,\r\n getUrlParameterByName,\r\n replaceUrlParameter,\r\n decodeUri,\r\n encodeUri,\r\n removeString,\r\n isArray,\r\n includes,\r\n find,\r\n flat,\r\n filterAlphaNumericPlus,\r\n capitaliseFirstLetter,\r\n stringContains,\r\n getSubstringIndex,\r\n replacePlaceholders,\r\n generateUUID,\r\n removeElements,\r\n log,\r\n sleep,\r\n randomInteger\r\n};\r\n"],"names":[],"mappings":";;;;;;IAAA;;;;QAIM,YAAY,GAAG,UAAC,UAAgC;QAAhC,2BAAA,EAAA,eAAgC;QAElD,IAAI,SAAiB,CAAC;QAEtB,IAAI,UAAU,KAAK,EAAE,EAAE;YACnB,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;SACpC;aAAM;YACH,IAAM,IAAI,GAAG,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC;YAClC,SAAS,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;SAC9B;QAED,OAAO,SAAS,CAAC;IAErB;;ICjBA;;;QAGM,QAAQ,GAAG;QAEb,IAAI,QAAQ,MAAM,CAAC,KAAK,QAAQ,EAAE;YAC9B,OAAO,IAAI,CAAC;SACf;aAAM;YACH,OAAO,KAAK,CAAC;SAChB;IAEL,EAAE;IAEF;;;QAGM,QAAQ,GAAG;QAEb,OAAO,CAAC,QAAQ,EAAE,CAAC;IAEvB;;IChBA;;;;QAIM,SAAS,GAAG,UAAC,WAAmB;QAElC,IAAM,q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OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,eAAe,EAAE,kBAAkB,EAAE,CAAC;IAEjG,CAAC;;ICpRD;;;;QAIM,KAAK,GAAG,UAAC,EAAU;QACrB,OAAO,IAAI,OAAO,CAAC,UAAA,OAAO,IAAI,OAAA,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,GAAA,CAAC,CAAC;IAC3D;;ICNA;;;;;QAKM,aAAa,GAAG,UAAC,GAAO,EAAE,GAAc;QAAvB,oBAAA,EAAA,OAAO;QAAE,oBAAA,EAAA,cAAc;QAC1C,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC;IAC7D;;QCKM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"index.js","sources":["../src/utilities/datetime.ts","../src/utilities/platform.ts","../src/utilities/uri.ts","../src/utilities/url.ts","../src/utilities/array.ts","../src/utilities/string.ts","../src/utilities/uuid.ts","../src/utilities/html.ts","../src/utilities/log/adapters/html.ts","../src/utilities/log/adapters/file.ts","../src/utilities/log.ts","../src/utilities/helper.ts","../src/utilities/random.ts","../src/index.ts"],"sourcesContent":["/**\r\n * returns the timestamp for any date or for now(), also works with browsers that dont support es5 Date.now\r\n * @param dateString \r\n */\r\nconst getTimestamp = (dateString: string | number = ''): number => {\r\n\r\n let timestamp: number;\r\n\r\n if (dateString === '') {\r\n timestamp = new Date().getTime();\r\n } else {\r\n const date = new Date(dateString);\r\n timestamp = date.getTime();\r\n }\r\n\r\n return timestamp;\r\n\r\n};\r\n\r\nexport { getTimestamp };\r\n","/**\r\n * does the script run on the server\r\n */\r\nconst isServer = (): boolean => {\r\n\r\n if (typeof (global) === 'object') {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n\r\n};\r\n\r\n/**\r\n * does the script run in a client\r\n */\r\nconst isClient = (): boolean => {\r\n\r\n return !isServer();\r\n\r\n};\r\n\r\nexport { isServer, isClient };\r\n","type TReplaceList = {\r\n [key: string]: string\r\n}\r\n\r\n/**\r\n * decode uri\r\n * @param inputString \r\n */\r\nconst decodeUri = (inputString: string): string => {\r\n\r\n const plusRegularExpression = /\\+/g;\r\n\r\n // replace addition symbol with a space\r\n return decodeURIComponent(inputString.replace(plusRegularExpression, ' '));\r\n\r\n};\r\n\r\n/**\r\n * encode uri\r\n * @param inputString \r\n */\r\nconst encodeUri = (inputString: string): string => {\r\n\r\n const findRegularExpression = /[!'()~]|%20|%00/g;\r\n const replaceList: TReplaceList = {\r\n '!': '%21',\r\n // tslint:disable-next-line\r\n \"'\": '%27',\r\n '(': '%28',\r\n ')': '%29',\r\n '~': '%7E',\r\n '%20': '+',\r\n '%00': '+'\r\n };\r\n\r\n return encodeURIComponent(inputString).replace(findRegularExpression, (match) => { return replaceList[match]; });\r\n\r\n};\r\n\r\nexport { decodeUri, encodeUri };\r\n","import { decodeUri } from './uri';\r\n\r\n/**\r\n * get url parameters\r\n * @param query \r\n */\r\nconst getUrlParameters = (query = ''): { [s: string]: string; } => {\r\n\r\n const urlParameters: { [s: string]: string; } = {};\r\n\r\n if (query !== '' && typeof query === 'string') {\r\n\r\n const questionmarkIndex = query.indexOf('?');\r\n\r\n // if -1 there is no questionmark, skip, all is fine\r\n // else just keep what comes after the questionmark\r\n if (questionmarkIndex !== -1) {\r\n query = query.slice(questionmarkIndex + 1);\r\n }\r\n\r\n const pairs: string[] = query.split('&');\r\n let i;\r\n\r\n for (i = 0; i < pairs.length; i++) {\r\n\r\n const pair: string = pairs[i];\r\n const equalIndex: number = pair.indexOf('=');\r\n let parameterKey = '';\r\n let parameterValue = '';\r\n\r\n if (equalIndex > -1) {\r\n parameterKey = pair.slice(0, equalIndex);\r\n parameterValue = pair.slice(equalIndex + 1);\r\n } else {\r\n parameterKey = pair;\r\n }\r\n\r\n urlParameters[decodeUri(parameterKey)] = decodeUri(parameterValue);\r\n }\r\n\r\n }\r\n\r\n return urlParameters;\r\n\r\n};\r\n\r\n/**\r\n * URL utility to get a parameter by name from an URL\r\n * @param name \r\n * @param url \r\n */\r\nconst getUrlParameterByName = (name: string, url: string): string => {\r\n\r\n if (!url) {\r\n url = window.location.href;\r\n }\r\n\r\n name = name.replace(/[[]]/g, '\\\\$&');\r\n\r\n const regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)');\r\n const results = regex.exec(url);\r\n\r\n if (!results) {\r\n return null;\r\n }\r\n\r\n if (!results[2]) {\r\n return '';\r\n }\r\n\r\n return decodeUri(results[2]);\r\n\r\n};\r\n\r\n/**\r\n * URL utility to replace a given parameter\r\n * @param url \r\n * @param paramName \r\n * @param paramValue \r\n */\r\nconst replaceUrlParameter = (url: string, paramName: string, paramValue: string|number): string => {\r\n\r\n const pattern = new RegExp('\\\\b(' + paramName + '=).*?(&|$)');\r\n\r\n if (url.search(pattern) >= 0) {\r\n return url.replace(pattern, '$1' + paramValue + '$2');\r\n }\r\n\r\n return url + (url.indexOf('?') > 0 ? '&' : '?') + paramName + '=' + paramValue;\r\n\r\n};\r\n\r\nexport { getUrlParameters, getUrlParameterByName, replaceUrlParameter };\r\n","/**\r\n * finds \"removeMe\" and removes it from the array\r\n * @param array \r\n * @param removeMe \r\n */\r\nconst removeString = (myArray: string[], removeMe: string): string[] => {\r\n\r\n const index = myArray.indexOf(removeMe);\r\n\r\n if (index > -1) {\r\n myArray.splice(index, 1);\r\n }\r\n\r\n return myArray;\r\n\r\n};\r\n\r\n/**\r\n * is array with polyfill for older browsers\r\n * @param input \r\n */\r\nconst isArray = (input: unknown): boolean => {\r\n\r\n // MDN is array documentation: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray\r\n\r\n if (!Array.isArray) {\r\n return Object.prototype.toString.call(input) === '[object Array]';\r\n } else {\r\n return Array.isArray(input);\r\n }\r\n\r\n};\r\n\r\ndeclare global {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n interface Array {\r\n includes(valueToFind: string, fromIndex?: number): boolean;\r\n }\r\n}\r\n\r\n/**\r\n * finds \"toFind\" in an array, starting at an optional index\r\n * @param inputArray \r\n * @param toFind \r\n * @param fromIndex \r\n */\r\nconst includes = (inputArray: [], toFind: string, fromIndex?: number): boolean => {\r\n\r\n // MDN includes documentation: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes\r\n\r\n if (!Array.prototype.includes) {\r\n\r\n // https://tc39.github.io/ecma262/#sec-array.prototype.includes\r\n\r\n if (this == null) {\r\n throw new TypeError('\"this\" is null or not defined');\r\n }\r\n\r\n // 1. Let O be ? ToObject(this value)\r\n const o = Object(this);\r\n\r\n // 2. Let len be ? ToLength(? Get(O, \"length\"))\r\n const len = o.length >>> 0;\r\n\r\n // 3. If len is 0, return false\r\n if (len === 0) {\r\n return false;\r\n }\r\n\r\n // 4. Let n be ? ToInteger(fromIndex)\r\n // (If fromIndex is undefined, this step produces the value 0.)\r\n const n = fromIndex | 0;\r\n\r\n // 5. If n ≥ 0, then\r\n // a. Let k be n.\r\n // 6. Else n < 0,\r\n // a. Let k be len + n.\r\n // b. If k < 0, let k be 0.\r\n let k = Math.max(n >= 0 ? n : len - Math.abs(n), 0);\r\n\r\n // 7. Repeat, while k < len\r\n while (k < len) {\r\n // a. Let elementK be the result of ? Get(O, ! ToString(k))\r\n // b. If SameValueZero(valueToFind, elementK) is true, return true\r\n if (sameValueZero(o[k], toFind)) {\r\n return true;\r\n }\r\n // c. Increase k by 1\r\n k++;\r\n }\r\n\r\n // 8. Return false\r\n return false;\r\n } else {\r\n const n = fromIndex | 0;\r\n return inputArray.includes(toFind, n);\r\n }\r\n};\r\n\r\nconst sameValueZero = (x: unknown, y: unknown): boolean => {\r\n return x === y || (typeof x === 'number' && typeof y === 'number' && isNaN(x) && isNaN(y));\r\n};\r\n\r\n/**\r\n * \r\n * @param inputArray \r\n * @param predicate \r\n * @param args \r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\r\nconst find = (inputArray: [], predicate: (this: void, value: never, index: number, obj: never[]) => value is never, args?: any): never | undefined => {\r\n\r\n // MDN find documentation: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find\r\n\r\n if (!Array.prototype.find) {\r\n\r\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find\r\n\r\n // 1. Let O be ? ToObject(this value)\r\n if (this == null) {\r\n throw new TypeError('\"this\" is null or not defined');\r\n }\r\n\r\n const o = Object(this);\r\n\r\n // 2. Let len be ? ToLength(? Get(O, \"length\"))\r\n const len = o.length >>> 0;\r\n\r\n // 3. If IsCallable(predicate) is false, throw a TypeError exception\r\n if (typeof predicate !== 'function') {\r\n throw new TypeError('predicate must be a function');\r\n }\r\n\r\n // 4. If thisArg was supplied, let T be thisArg; else let T be undefined\r\n const thisArg = args[1];\r\n\r\n // 5. Let k be 0.\r\n let k = 0;\r\n\r\n // 6. Repeat, while k < len\r\n while (k < len) {\r\n // a. Let Pk be ! ToString(k)\r\n // b. Let kValue be ? Get(O, Pk)\r\n // c. Let testResult be ToBoolean(? Call(predicate, T, « kValue, k, O »))\r\n // d. If testResult is true, return kValue\r\n const kValue = o[k];\r\n if (predicate.call(thisArg, kValue, k, o)) {\r\n return kValue;\r\n }\r\n // e. Increase k by 1\r\n k++;\r\n }\r\n\r\n // 7. Return undefined\r\n return undefined;\r\n\r\n } else {\r\n // eslint-disable-next-line\r\n return inputArray.find(predicate, args);\r\n }\r\n};\r\n\r\ndeclare global {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n interface Array {\r\n flat(depth: number): [];\r\n }\r\n}\r\n\r\n/**\r\n * array flat polyfill, if depth is unknow set it to \"Infinity\"\r\n * @param inputArray \r\n * @param depth \r\n */\r\nconst flat = (inputArray: [], depth = Infinity): [] => {\r\n\r\n // MDN flat documentation: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flat\r\n\r\n if (!Array.prototype.flat) {\r\n return flatten(inputArray, Math.floor(depth) || 1);\r\n } else {\r\n return inputArray.flat(depth);\r\n }\r\n\r\n};\r\n\r\n/**\r\n * flattens a multidimensional array\r\n * @param inputArray \r\n * @param depth \r\n */\r\nconst flatten = (inputArray: [], depth = Infinity): [] => {\r\n\r\n const flattend: [] = [];\r\n\r\n for (const el of inputArray) {\r\n if (isArray(el) && depth > 0) {\r\n flatten(el, depth - 1);\r\n } else {\r\n flattend.push(el);\r\n }\r\n }\r\n\r\n return flattend;\r\n\r\n};\r\n\r\nexport { removeString, isArray, includes, find, flat };\r\n","/**\r\n * filters a string\r\n * removes everything that is a not an alpha or numeric character, plus\r\n * the characters if any got specified as second argument\r\n * @param inputString \r\n * @param specialCharacters \r\n */\r\nconst filterAlphaNumericPlus = (inputString: string, specialCharacters: string): string|boolean => {\r\n\r\n if (typeof (inputString) === 'string' && inputString.length > 0) {\r\n\r\n let outputString;\r\n\r\n if (specialCharacters !== undefined) {\r\n\r\n const regex = RegExp('[^a-z0-9' + specialCharacters + ']', 'gi');\r\n\r\n outputString = inputString.replace(regex, '');\r\n\r\n } else {\r\n outputString = inputString.replace(/[^a-z0-9]/gi, '');\r\n }\r\n\r\n return outputString;\r\n\r\n }\r\n\r\n return false;\r\n\r\n};\r\n\r\n/**\r\n * capitalise first letter of a string\r\n * @param inputString \r\n */\r\nconst capitaliseFirstLetter = (inputString: string): string => {\r\n\r\n return inputString.charAt(0).toUpperCase() + inputString.slice(1);\r\n\r\n};\r\n\r\n/**\r\n * does a string contain another string\r\n * @param inputString \r\n * @param contains \r\n */\r\nconst stringContains = (inputString: string, contains: string): boolean => {\r\n\r\n if (typeof inputString !== 'string') {\r\n throw 'input is not a string';\r\n }\r\n\r\n if (inputString.indexOf(contains) > -1) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n\r\n};\r\n\r\n/**\r\n * get the index of a substring in a string with optional nth time it occurs\r\n * @param inputString \r\n * @param substring \r\n * @param nthTime \r\n */\r\nconst getSubstringIndex = (inputString: string, substring: string, nthTime: number): number => {\r\n\r\n let times = 0;\r\n let index = null;\r\n\r\n if (nthTime === 0) {\r\n nthTime = 1;\r\n }\r\n\r\n while (times < nthTime && index !== -1) {\r\n\r\n index = inputString.indexOf(substring, index + 1);\r\n times++;\r\n\r\n }\r\n\r\n return index;\r\n\r\n};\r\n\r\n/**\r\n * replace the placeholder(s) with some value\r\n * @param input \r\n * @param replacements \r\n */\r\nconst replacePlaceholders = (input: string, replacements: string): string => {\r\n\r\n let output = input;\r\n\r\n if (typeof input === 'string' && typeof replacements === 'object') {\r\n\r\n output = input.replace(/\\b\\w+?\\b/g, function replacePlaceHolder(placeholder) {\r\n return Object.prototype.hasOwnProperty.call(replacements, placeholder) ? replacements[placeholder] : placeholder;\r\n });\r\n\r\n }\r\n\r\n return output;\r\n\r\n};\r\n\r\nexport { filterAlphaNumericPlus, capitaliseFirstLetter, stringContains, getSubstringIndex, replacePlaceholders };\r\n","/**\r\n * returns a universally unique identifier\r\n */\r\nconst generateUUID = (): string => {\r\n\r\n // http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript\r\n\r\n // http://www.ietf.org/rfc/rfc4122.txt\r\n \r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const s: any[] = [];\r\n const hexDigits = '0123456789abcdef';\r\n let i;\r\n\r\n for (i = 0; i < 36; i++) {\r\n s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);\r\n }\r\n\r\n s[14] = 4; // bits 12-15 of the time_hi_and_version field to 0010\r\n s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1); // bits 6-7 of the clock_seq_hi_and_reserved to 01\r\n s[8] = s[13] = s[18] = s[23] = '-';\r\n\r\n const uuid = s.join('');\r\n\r\n return uuid;\r\n\r\n};\r\n\r\nexport { generateUUID };\r\n","/**\r\n * extracts html elements (and their content) from strings\r\n * @param text \r\n * @param removeTextBetweenTags \r\n */\r\nconst removeElements = (text: string, removeTextBetweenTags: boolean): string => {\r\n\r\n if (removeTextBetweenTags === false) {\r\n\r\n // replace single tags\r\n text = text.replace(/<[^>]*>?/g, '');\r\n\r\n } else {\r\n\r\n // replace all tags and whats inside\r\n text = text.replace(/<[^>]*>[^>]*<\\/[^>]*>?/g, '');\r\n\r\n // replace single tags\r\n text = text.replace(/<[^>]*>?/g, '');\r\n\r\n }\r\n\r\n return text;\r\n\r\n};\r\n\r\nexport { removeElements };\r\n","import { removeElements } from './../../html';\r\n\r\n/**\r\n * html log\r\n * create a div an insert the messages in div\r\n * can be usefull on mobile if no other console is available\r\n * @param logObjects \r\n * @param logObjectsLength \r\n * @param logFontColor \r\n * @param logBackgroundColor \r\n */\r\nconst htmlLog = (logObjects: string[], logObjectsLength: number, logFontColor: string, logBackgroundColor: string): void => {\r\n\r\n // TODO: fix: seems that if logging starts before \"domload\" some\r\n // messages get lost\r\n\r\n if (document.getElementById('log') === null) {\r\n\r\n const logDiv = document.createElement('div');\r\n\r\n logDiv.id = 'log';\r\n\r\n logDiv.style.cssText = 'position: absolute; overflow: scroll; left: 0; bottom: 0; padding: 0; margin: 0; border: 0; z-index: 999999; width: 100%; height: 20%; background-color: #fff;';\r\n\r\n document.body.appendChild(logDiv);\r\n\r\n }\r\n\r\n let i;\r\n\r\n for (i = 0; i < logObjectsLength; i++) {\r\n\r\n const logSpan = document.createElement('span');\r\n\r\n logSpan.style.cssText = 'color: #' + logFontColor + '; background-color: #' + logBackgroundColor + ';';\r\n\r\n const logObject = logObjects[i];\r\n\r\n const spanContent = document.createTextNode(logObject);\r\n\r\n logSpan.appendChild(spanContent);\r\n\r\n document.getElementById('log').appendChild(logSpan);\r\n\r\n const brElement = document.createElement('br');\r\n\r\n document.getElementById('log').appendChild(brElement);\r\n\r\n }\r\n\r\n};\r\n\r\n/**\r\n * extracts html elements (and their content) from strings\r\n * @param rawText \r\n * @param extendedEscape \r\n * @param myEscapeList \r\n */\r\nconst safeUnescape = (rawText: string, extendedEscape = false, myEscapeList: string[]): string => {\r\n\r\n interface IEscapeList {\r\n [key: string]: string;\r\n }\r\n\r\n const unEscapeList: IEscapeList = {\r\n // usually you would just escape (unescape) characters that get\r\n // used in (x)html\r\n '&': '&',\r\n '<': '<',\r\n '>': '>',\r\n '"': '\"',\r\n ''': '\\'',\r\n '`': '`'\r\n };\r\n\r\n // by default also use extended list\r\n if (extendedEscape === true) {\r\n\r\n const unEscapeExtendedList: IEscapeList = {\r\n // but in the case where everything has been encoded lets decode these too\r\n '‘': '‘',\r\n '’': '’',\r\n '‚': '‚',\r\n '“': '“',\r\n '”': '”',\r\n '„': '„',\r\n '†': '†',\r\n '‡': '‡',\r\n '‰': '‰',\r\n '‹': '‹',\r\n '›': '›',\r\n '–': '-',\r\n '—': '—',\r\n ' ': ' ',\r\n '¡': '¡',\r\n '¢': '¢',\r\n '£': '£',\r\n '¤': '¤',\r\n '¥': '¥',\r\n '¦': '¦',\r\n '&brkbar;': '¦',\r\n '§': '§',\r\n '¨': '¨',\r\n '¨': '¨',\r\n '©': '©',\r\n 'ª': 'ª',\r\n '«': '«',\r\n '¬': '¬',\r\n '­': ' ',\r\n '®': '®',\r\n '¯': '¯',\r\n '&hibar;': '¯',\r\n '°': '°',\r\n '±': '±',\r\n '²': '²',\r\n '³': '³',\r\n '´': '´',\r\n 'µ': 'µ',\r\n '¶': '¶',\r\n '·': '·',\r\n '¸': '¸',\r\n '¹': '¹',\r\n 'º': 'º',\r\n '»': '»',\r\n '¼': '¼',\r\n '½': '½',\r\n '¾': '¾',\r\n '¿': '¿'\r\n };\r\n\r\n for (const key in unEscapeExtendedList) {\r\n unEscapeList[key] = unEscapeExtendedList[key];\r\n }\r\n\r\n }\r\n\r\n if (myEscapeList !== undefined) {\r\n\r\n for (const key in myEscapeList) {\r\n unEscapeList[key] = myEscapeList[key];\r\n }\r\n\r\n }\r\n\r\n const escaper = function (match: string) {\r\n return unEscapeList[match];\r\n };\r\n\r\n // regexes for identifying a key that needs to be escaped\r\n const unEscapeKeys = Object.keys(unEscapeList);\r\n const source = '(?:' + unEscapeKeys.join('|') + ')';\r\n const testRegexp = RegExp(source);\r\n const replaceRegexp = RegExp(source, 'g');\r\n\r\n rawText = rawText == null ? '' : '' + rawText;\r\n\r\n const unescapedText = testRegexp.test(rawText) ? rawText.replace(replaceRegexp, escaper) : rawText;\r\n\r\n const text = removeElements(unescapedText, false);\r\n\r\n return text;\r\n\r\n};\r\n\r\nexport { htmlLog, safeUnescape };\r\n","/**\r\n * nodejs logging to file\r\n * @param logObjects \r\n * @param logObjectsLength \r\n * @param logFontColor \r\n */\r\nconst fileLog = (logObjects: unknown, logObjectsLength: number, logFontColor: string): void => {\r\n\r\n console.log(logObjects);\r\n console.log(logObjectsLength);\r\n console.log(logFontColor);\r\n\r\n throw new Error('sorry this feature is broken');\r\n\r\n try {\r\n\r\n /*var winston = require('winston');\r\n\r\n for (var i = 0; i < logObjectsLength; i++) {\r\n\r\n switch (logFontColor) {\r\n case 'red':\r\n winston.error(logObjects[i]);\r\n break;\r\n case 'yellow':\r\n winston.warn(logObjects[i]);\r\n break;\r\n default:\r\n winston.info(logObjects[i]);\r\n }\r\n\r\n }*/\r\n\r\n } catch (e) {\r\n\r\n // winston is not installed\r\n\r\n }\r\n\r\n};\r\n\r\nexport { fileLog };\r\n","import { htmlLog } from './log/adapters/html';\r\nimport { fileLog } from './log/adapters/file';\r\n\r\nconst defaultLogFontColor = 'default';\r\nconst defaultLogBackgroundColor = 'default';\r\n//const logSpecial = false;\r\nconst logVerbose = true;\r\n\r\n/**\r\n * log messages\r\n * @param args \r\n */\r\nconst log = (...args: unknown[]): void => {\r\n\r\n // is console defined, some older IEs don't have a console\r\n if (typeof (console) === 'undefined') {\r\n\r\n throw new Error('This browser does not support console');\r\n\r\n }\r\n\r\n // extract options and get objects to log\r\n // read: https://github.com/Microsoft/TypeScript/issues/1609\r\n const logArguments = handleLogArguments(args);\r\n\r\n const logObjects = logArguments.objects;\r\n const logFontColor = logArguments.fontColor;\r\n const logBackgroundColor = logArguments.backgroundColor;\r\n\r\n const logObjectsLength = logObjects.length;\r\n\r\n // nodejs or browser mode\r\n if (typeof (window) === 'undefined') {\r\n\r\n if (typeof (logVerbose) !== 'undefined'\r\n && logVerbose === true) {\r\n\r\n // get background and fontColor codes\r\n const color = getServerColors(logFontColor, logBackgroundColor);\r\n\r\n // log each object\r\n for (let i = 0; i < logObjectsLength; i++) {\r\n\r\n if (typeof (logObjects[i]) === 'string') {\r\n console.log(color.background + color.font + logObjects[i] + color.reset);\r\n } else {\r\n console.log(logObjects[i]);\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n // log to file if logSpecial is enabled or if the fontColor is red\r\n // if (logSpecial === true || logFontColor === 'red') {\r\n if (logFontColor === 'red') {\r\n\r\n fileLog(logObjects, logObjectsLength, logFontColor);\r\n\r\n }\r\n\r\n } else {\r\n\r\n // get background and fontColor codes\r\n const color = getClientColors(logFontColor, logBackgroundColor);\r\n\r\n if (typeof (logVerbose) !== 'undefined'\r\n && logVerbose === true) {\r\n\r\n // log each object\r\n for (let i = 0; i < logObjectsLength; i++) {\r\n\r\n if (typeof (logObjects[i]) === 'string') {\r\n console.log('%c' + logObjects[i], 'background: #' + color.background + '; color: #' + color.font);\r\n } else {\r\n console.log(logObjects[i]);\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n // log to html if logSpecial is enabled\r\n //if (logSpecial === true) {\r\n\r\n const stringLogObjects: string[] = [];\r\n\r\n logObjects.forEach((logObject) => {\r\n stringLogObjects.push(logObject.toString())\r\n });\r\n\r\n htmlLog(stringLogObjects, logObjectsLength, color.font, color.background);\r\n\r\n //}\r\n\r\n }\r\n\r\n};\r\n\r\ninterface IColors {\r\n red: string;\r\n green: string;\r\n yellow: string;\r\n blue: string;\r\n magenta: string;\r\n cyan: string;\r\n white: string;\r\n black: string;\r\n [key: string]: string;\r\n}\r\n\r\n/**\r\n * get the client side (browser) colors\r\n * @param logFontColor \r\n * @param logBackgroundColor \r\n */\r\nconst getClientColors = (logFontColor: string, logBackgroundColor: string) => {\r\n\r\n const colors: IColors = {\r\n red: 'FF0000',\r\n green: '00FF00',\r\n yellow: 'FFFF00',\r\n blue: '0000FF',\r\n magenta: 'FF00FF',\r\n cyan: '00FFFF',\r\n white: 'FFFFFF',\r\n black: '000000'\r\n };\r\n\r\n let fontColor;\r\n let backgroundColor;\r\n\r\n // font color\r\n if (typeof (logFontColor) === 'undefined'\r\n || logFontColor === 'default') {\r\n\r\n fontColor = colors['black'];\r\n\r\n } else {\r\n\r\n if (typeof (colors[logFontColor]) !== 'undefined') {\r\n fontColor = colors[logFontColor];\r\n } else {\r\n throw 'unknown fontColor in utilities console log';\r\n }\r\n\r\n }\r\n\r\n // background color\r\n if (typeof (logBackgroundColor) === 'undefined'\r\n || logBackgroundColor === 'default') {\r\n\r\n backgroundColor = colors['white'];\r\n\r\n } else {\r\n\r\n if (typeof (colors[logBackgroundColor]) !== 'undefined') {\r\n backgroundColor = colors[logBackgroundColor];\r\n } else {\r\n throw 'unknown fontColor in utilities console log';\r\n }\r\n\r\n }\r\n\r\n return { font: fontColor, background: backgroundColor };\r\n\r\n};\r\n\r\n/**\r\n * get the colors for the backend (server) console\r\n * @param logFontColor \r\n * @param logBackgroundColor \r\n */\r\nconst getServerColors = (logFontColor: string, logBackgroundColor: string) => {\r\n\r\n const backgroundColors: IColors = {\r\n black: '\\u001b[40m',\r\n red: '\\u001b[41m',\r\n green: '\\u001b[42m',\r\n yellow: '\\u001b[43m',\r\n blue: '\\u001b[44m',\r\n magenta: '\\u001b[45m',\r\n cyan: '\\u001b[46m',\r\n white: '\\u001b[47m'\r\n };\r\n\r\n\r\n\r\n const foregroundColors: IColors = {\r\n black: '\\u001b[30m',\r\n red: '\\u001b[31m',\r\n green: '\\u001b[32m',\r\n yellow: '\\u001b[33m',\r\n blue: '\\u001b[34m',\r\n magenta: '\\u001b[35m',\r\n cyan: '\\u001b[36m',\r\n white: '\\u001b[37m'\r\n };\r\n\r\n let fontColor;\r\n let backgroundColor;\r\n\r\n // font color\r\n if (typeof (logFontColor) === 'undefined'\r\n || logFontColor === 'default') {\r\n\r\n fontColor = foregroundColors['white'];\r\n\r\n } else {\r\n\r\n if (typeof (foregroundColors[logFontColor]) !== 'undefined') {\r\n fontColor = foregroundColors[logFontColor];\r\n } else {\r\n throw 'unknown font color in utilities console log';\r\n }\r\n\r\n }\r\n\r\n // background color\r\n if (typeof (logBackgroundColor) === 'undefined'\r\n || logBackgroundColor === 'default') {\r\n\r\n backgroundColor = backgroundColors['black'];\r\n\r\n } else {\r\n\r\n if (typeof (backgroundColors[logBackgroundColor]) !== 'undefined') {\r\n backgroundColor = backgroundColors[logBackgroundColor];\r\n } else {\r\n throw 'unknown background color in utilities console log';\r\n }\r\n\r\n }\r\n\r\n return { font: fontColor, background: backgroundColor, reset: '\\u001b[0m' };\r\n\r\n};\r\n\r\n/**\r\n * handle log arguments\r\n * extract the color infos from the arguments to log\r\n * @param logArguments \r\n */\r\nconst handleLogArguments = (logArguments?: unknown[]) => {\r\n\r\n const logObjects = [];\r\n\r\n let logFontColor = defaultLogFontColor;\r\n let logBackgroundColor = defaultLogBackgroundColor;\r\n\r\n const argumentsLength = logArguments.length;\r\n\r\n let i;\r\n\r\n for (i = 0; i < argumentsLength; i++) {\r\n\r\n const argument = logArguments[i];\r\n\r\n if (typeof argument === 'string') {\r\n\r\n if (argument.substr(0, 10) === 'fontColor:') {\r\n logFontColor = argument.substr(10, argument.length).trim();\r\n } else if (argument.substr(0, 16) === 'backgroundColor:') {\r\n logBackgroundColor = argument.substr(16, argument.length).trim();\r\n } else {\r\n logObjects.push(argument);\r\n }\r\n\r\n } else {\r\n logObjects.push(argument);\r\n }\r\n\r\n }\r\n\r\n return { objects: logObjects, fontColor: logFontColor, backgroundColor: logBackgroundColor };\r\n\r\n};\r\n\r\nexport { log };\r\n","/**\r\n * pauses your script for a given time, returns a promise that you can use to do so\r\n * @param ms \r\n */\r\nconst sleep = (ms: number): Promise => {\r\n return new Promise(resolve => setTimeout(resolve, ms));\r\n}\r\n\r\nexport { sleep };","/**\r\n * returns a random integer that lies between min (included) and max (included)\r\n * @param min \r\n * @param max \r\n */\r\nconst randomInteger = (min = 0, max = Infinity): number => {\r\n return Math.floor(Math.random() * (max - min + 1) + min);\r\n}\r\n\r\nconst choice = (sequence: unknown[] = []): unknown => {\r\n return sequence[Math.floor(Math.random() * sequence.length)];\r\n}\r\n\r\nexport { randomInteger, choice }","import { getTimestamp } from './utilities/datetime';\r\nimport { isServer, isClient } from './utilities/platform';\r\nimport { getUrlParameters, getUrlParameterByName, replaceUrlParameter } from './utilities/url';\r\nimport { decodeUri, encodeUri } from './utilities/uri';\r\nimport { removeString, isArray, includes, find, flat } from './utilities/array';\r\nimport { filterAlphaNumericPlus, capitaliseFirstLetter, stringContains, getSubstringIndex, replacePlaceholders } from './utilities/string';\r\nimport { generateUUID } from './utilities/uuid';\r\nimport { removeElements } from './utilities/html';\r\nimport { log } from './utilities/log';\r\nimport { sleep } from './utilities/helper';\r\nimport { randomInteger, choice } from './utilities/random';\r\n\r\nconst version = '1.0.0';\r\n\r\nexport {\r\n version,\r\n getTimestamp,\r\n isServer,\r\n isClient,\r\n getUrlParameters,\r\n getUrlParameterByName,\r\n replaceUrlParameter,\r\n decodeUri,\r\n encodeUri,\r\n removeString,\r\n isArray,\r\n includes,\r\n find,\r\n flat,\r\n filterAlphaNumericPlus,\r\n capitaliseFirstLetter,\r\n stringContains,\r\n getSubstringIndex,\r\n replacePlaceholders,\r\n generateUUID,\r\n removeElements,\r\n log,\r\n sleep,\r\n randomInteger,\r\n choice\r\n};\r\n"],"names":[],"mappings":";;;;;;IAAA;;;;QAIM,YAAY,GAAG,UAAC,UAAgC;QAAhC,2BAAA,EAAA,eAAgC;QAElD,IAAI,SAAiB,CAAC;QAEtB,IAAI,UAAU,KAAK,EAAE,EAAE;YACnB,SAAS,GA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;;;;;;"} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 6a02fb7..aea3cde 100644 --- a/package-lock.json +++ b/package-lock.json @@ -551,9 +551,9 @@ } }, "@jest/core": { - "version": "26.4.1", - "resolved": "https://registry.npmjs.org/@jest/core/-/core-26.4.1.tgz", - "integrity": "sha512-EFziH1tJC5N8xb8OjUcQgyWdezJh6+zBX5p+9S7HR1jzBVeG8jCE/Edp7yqxW/cToLG/QKj8qrpox+HV9Qw1rw==", + "version": "26.4.2", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-26.4.2.tgz", + "integrity": "sha512-sDva7YkeNprxJfepOctzS8cAk9TOekldh+5FhVuXS40+94SHbiicRO1VV2tSoRtgIo+POs/Cdyf8p76vPTd6dg==", "dev": true, "requires": { "@jest/console": "^26.3.0", @@ -567,17 +567,17 @@ "exit": "^0.1.2", "graceful-fs": "^4.2.4", "jest-changed-files": "^26.3.0", - "jest-config": "^26.4.1", + "jest-config": "^26.4.2", "jest-haste-map": "^26.3.0", "jest-message-util": "^26.3.0", "jest-regex-util": "^26.0.0", "jest-resolve": "^26.4.0", - "jest-resolve-dependencies": "^26.4.1", - "jest-runner": "^26.4.1", - "jest-runtime": "^26.4.1", - "jest-snapshot": "^26.4.1", + "jest-resolve-dependencies": "^26.4.2", + "jest-runner": "^26.4.2", + "jest-runtime": "^26.4.2", + "jest-snapshot": "^26.4.2", "jest-util": "^26.3.0", - "jest-validate": "^26.4.0", + "jest-validate": "^26.4.2", "jest-watcher": "^26.3.0", "micromatch": "^4.0.2", "p-each-series": "^2.1.0", @@ -724,14 +724,14 @@ } }, "@jest/globals": { - "version": "26.4.1", - "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-26.4.1.tgz", - "integrity": "sha512-gdsHefnwjck+AwDUwW+6rmctmKEcZEEZ4F3PB5kKnub7r0dUoN1KVSyNRXtB5qpZgRYESnxgDXhpw/XYKIsAeg==", + "version": "26.4.2", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-26.4.2.tgz", + "integrity": "sha512-Ot5ouAlehhHLRhc+sDz2/9bmNv9p5ZWZ9LE1pXGGTCXBasmi5jnYjlgYcYt03FBwLmZXCZ7GrL29c33/XRQiow==", "dev": true, "requires": { "@jest/environment": "^26.3.0", "@jest/types": "^26.3.0", - "expect": "^26.4.1" + "expect": "^26.4.2" }, "dependencies": { "@jest/types": { @@ -893,16 +893,16 @@ } }, "@jest/test-sequencer": { - "version": "26.4.1", - "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-26.4.1.tgz", - "integrity": "sha512-YR4PNPu1RVHxyv/HSQMjc+pBEWa6wuM7xbEX/u5M5FFg6ZM6m00m7Jf0fjRxGN6hZlY5vECmNhJu/kvJLrxR8w==", + "version": "26.4.2", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-26.4.2.tgz", + "integrity": "sha512-83DRD8N3M0tOhz9h0bn6Kl6dSp+US6DazuVF8J9m21WAp5x7CqSMaNycMP0aemC/SH/pDQQddbsfHRTBXVUgog==", "dev": true, "requires": { "@jest/test-result": "^26.3.0", "graceful-fs": "^4.2.4", "jest-haste-map": "^26.3.0", - "jest-runner": "^26.4.1", - "jest-runtime": "^26.4.1" + "jest-runner": "^26.4.2", + "jest-runtime": "^26.4.2" } }, "@jest/transform": { @@ -1119,9 +1119,9 @@ "dev": true }, "@types/node": { - "version": "14.6.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.6.0.tgz", - "integrity": "sha512-mikldZQitV94akrc4sCcSjtJfsTKt4p+e/s0AGscVA6XArQ9kFclP+ZiYUMnq987rc6QlYxXv/EivqlfSLxpKA==", + "version": "14.6.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.6.1.tgz", + "integrity": "sha512-HnYlg/BRF8uC1FyKRFZwRaCPTPYKa+6I8QiUZFLredaGOou481cgFS4wKRFyKvQtX8xudqkSdBczJHIYSQYKrQ==", "dev": true }, "@types/normalize-package-data": { @@ -1131,9 +1131,9 @@ "dev": true }, "@types/prettier": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.0.2.tgz", - "integrity": "sha512-IkVfat549ggtkZUthUzEX49562eGikhSYeVGX97SkMFn+sTZrgRewXjQ4tPKFPCykZHkX1Zfd9OoELGqKU2jJA==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.1.0.tgz", + "integrity": "sha512-hiYA88aHiEIgDmeKlsyVsuQdcFn3Z2VuFd/Xm/HCnGnPD8UFU5BM128uzzRVVGEzKDKYUrRsRH9S2o+NUy/3IA==", "dev": true }, "@types/stack-utils": { @@ -1158,12 +1158,12 @@ "dev": true }, "@typescript-eslint/eslint-plugin": { - "version": "3.9.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-3.9.1.tgz", - "integrity": "sha512-XIr+Mfv7i4paEdBf0JFdIl9/tVxyj+rlilWIfZ97Be0lZ7hPvUbS5iHt9Glc8kRI53dsr0PcAEudbf8rO2wGgg==", + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-3.10.1.tgz", + "integrity": "sha512-PQg0emRtzZFWq6PxBcdxRH3QIQiyFO3WCVpRL3fgj5oQS3CDs3AeAKfv4DxNhzn8ITdNJGJ4D3Qw8eAJf3lXeQ==", "dev": true, "requires": { - "@typescript-eslint/experimental-utils": "3.9.1", + "@typescript-eslint/experimental-utils": "3.10.1", "debug": "^4.1.1", "functional-red-black-tree": "^1.0.1", "regexpp": "^3.0.0", @@ -1172,45 +1172,45 @@ } }, "@typescript-eslint/experimental-utils": { - "version": "3.9.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-3.9.1.tgz", - "integrity": "sha512-lkiZ8iBBaYoyEKhCkkw4SAeatXyBq9Ece5bZXdLe1LWBUwTszGbmbiqmQbwWA8cSYDnjWXp9eDbXpf9Sn0hLAg==", + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-3.10.1.tgz", + "integrity": "sha512-DewqIgscDzmAfd5nOGe4zm6Bl7PKtMG2Ad0KG8CUZAHlXfAKTF9Ol5PXhiMh39yRL2ChRH1cuuUGOcVyyrhQIw==", "dev": true, "requires": { "@types/json-schema": "^7.0.3", - "@typescript-eslint/types": "3.9.1", - "@typescript-eslint/typescript-estree": "3.9.1", + "@typescript-eslint/types": "3.10.1", + "@typescript-eslint/typescript-estree": "3.10.1", "eslint-scope": "^5.0.0", "eslint-utils": "^2.0.0" } }, "@typescript-eslint/parser": { - "version": "3.9.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-3.9.1.tgz", - "integrity": "sha512-y5QvPFUn4Vl4qM40lI+pNWhTcOWtpZAJ8pOEQ21fTTW4xTJkRplMjMRje7LYTXqVKKX9GJhcyweMz2+W1J5bMg==", + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-3.10.1.tgz", + "integrity": "sha512-Ug1RcWcrJP02hmtaXVS3axPPTTPnZjupqhgj+NnZ6BCkwSImWk/283347+x9wN+lqOdK9Eo3vsyiyDHgsmiEJw==", "dev": true, "requires": { "@types/eslint-visitor-keys": "^1.0.0", - "@typescript-eslint/experimental-utils": "3.9.1", - "@typescript-eslint/types": "3.9.1", - "@typescript-eslint/typescript-estree": "3.9.1", + "@typescript-eslint/experimental-utils": "3.10.1", + "@typescript-eslint/types": "3.10.1", + "@typescript-eslint/typescript-estree": "3.10.1", "eslint-visitor-keys": "^1.1.0" } }, "@typescript-eslint/types": { - "version": "3.9.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-3.9.1.tgz", - "integrity": "sha512-15JcTlNQE1BsYy5NBhctnEhEoctjXOjOK+Q+rk8ugC+WXU9rAcS2BYhoh6X4rOaXJEpIYDl+p7ix+A5U0BqPTw==", + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-3.10.1.tgz", + "integrity": "sha512-+3+FCUJIahE9q0lDi1WleYzjCwJs5hIsbugIgnbB+dSCYUxl8L6PwmsyOPFZde2hc1DlTo/xnkOgiTLSyAbHiQ==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "3.9.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-3.9.1.tgz", - "integrity": "sha512-IqM0gfGxOmIKPhiHW/iyAEXwSVqMmR2wJ9uXHNdFpqVvPaQ3dWg302vW127sBpAiqM9SfHhyS40NKLsoMpN2KA==", + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-3.10.1.tgz", + "integrity": "sha512-QbcXOuq6WYvnB3XPsZpIwztBoquEYLXh2MtwVU+kO8jgYCiv4G5xrSP/1wg4tkvrEE+esZVquIPX/dxPlePk1w==", "dev": true, "requires": { - "@typescript-eslint/types": "3.9.1", - "@typescript-eslint/visitor-keys": "3.9.1", + "@typescript-eslint/types": "3.10.1", + "@typescript-eslint/visitor-keys": "3.10.1", "debug": "^4.1.1", "glob": "^7.1.6", "is-glob": "^4.0.1", @@ -1220,9 +1220,9 @@ } }, "@typescript-eslint/visitor-keys": { - "version": "3.9.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-3.9.1.tgz", - "integrity": "sha512-zxdtUjeoSh+prCpogswMwVUJfEFmCOjdzK9rpNjNBfm6EyPt99x3RrJoBOGZO23FCt0WPKUCOL5mb/9D5LjdwQ==", + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-3.10.1.tgz", + "integrity": "sha512-9JgC82AaQeglebjZMgYR5wgmfUdUc+EitGUUMW8u2nDckaeimzW+VsoLV6FoimPv2id3VQzfjwBxEMVz08ameQ==", "dev": true, "requires": { "eslint-visitor-keys": "^1.1.0" @@ -2566,15 +2566,15 @@ } }, "expect": { - "version": "26.4.1", - "resolved": "https://registry.npmjs.org/expect/-/expect-26.4.1.tgz", - "integrity": "sha512-PnsyF/VmPRH/HAWELjrIAgQ5h+4JLTiomA1A2djx+jXrCQzQ/4egZYBOEx9hShoX+mQLS4enYk6Ouxk8b4kcEw==", + "version": "26.4.2", + "resolved": "https://registry.npmjs.org/expect/-/expect-26.4.2.tgz", + "integrity": "sha512-IlJ3X52Z0lDHm7gjEp+m76uX46ldH5VpqmU0006vqDju/285twh7zaWMRhs67VpQhBwjjMchk+p5aA0VkERCAA==", "dev": true, "requires": { "@jest/types": "^26.3.0", "ansi-styles": "^4.0.0", "jest-get-type": "^26.3.0", - "jest-matcher-utils": "^26.4.1", + "jest-matcher-utils": "^26.4.2", "jest-message-util": "^26.3.0", "jest-regex-util": "^26.0.0" }, @@ -3552,14 +3552,14 @@ } }, "jest": { - "version": "26.4.1", - "resolved": "https://registry.npmjs.org/jest/-/jest-26.4.1.tgz", - "integrity": "sha512-q+az+ZXFOTxTlD6BRIMcZC+a33O9lsryV4Wo9gU4D/AI+Y6KKgVRCmyzpc4H2gWv0rn45lACukmMS2uSB7e1LA==", + "version": "26.4.2", + "resolved": "https://registry.npmjs.org/jest/-/jest-26.4.2.tgz", + "integrity": "sha512-LLCjPrUh98Ik8CzW8LLVnSCfLaiY+wbK53U7VxnFSX7Q+kWC4noVeDvGWIFw0Amfq1lq2VfGm7YHWSLBV62MJw==", "dev": true, "requires": { - "@jest/core": "^26.4.1", + "@jest/core": "^26.4.2", "import-local": "^3.0.2", - "jest-cli": "^26.4.1" + "jest-cli": "^26.4.2" }, "dependencies": { "@jest/types": { @@ -3595,12 +3595,12 @@ } }, "jest-cli": { - "version": "26.4.1", - "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-26.4.1.tgz", - "integrity": "sha512-c6px+IOO0OsZ7X/uSr65wcjZnd7NYNUDWFT5OETyCnJRkkwoTER7gneRDrwgr3Ex5+gCGO7D/IMWxUHB/L624A==", + "version": "26.4.2", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-26.4.2.tgz", + "integrity": "sha512-zb+lGd/SfrPvoRSC/0LWdaWCnscXc1mGYW//NP4/tmBvRPT3VntZ2jtKUONsRi59zc5JqmsSajA9ewJKFYp8Cw==", "dev": true, "requires": { - "@jest/core": "^26.4.1", + "@jest/core": "^26.4.2", "@jest/test-result": "^26.3.0", "@jest/types": "^26.3.0", "chalk": "^4.0.0", @@ -3608,9 +3608,9 @@ "graceful-fs": "^4.2.4", "import-local": "^3.0.2", "is-ci": "^2.0.0", - "jest-config": "^26.4.1", + "jest-config": "^26.4.2", "jest-util": "^26.3.0", - "jest-validate": "^26.4.0", + "jest-validate": "^26.4.2", "prompts": "^2.0.1", "yargs": "^15.3.1" } @@ -3704,13 +3704,13 @@ } }, "jest-config": { - "version": "26.4.1", - "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-26.4.1.tgz", - "integrity": "sha512-0kUnVceEax0sYN+wdkNYF7fxjYKbsvmKmjVWwJvsSYA2p94bIL6wSy3oehewev7L9Dp/FDZFhmc9dyOoavdT6A==", + "version": "26.4.2", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-26.4.2.tgz", + "integrity": "sha512-QBf7YGLuToiM8PmTnJEdRxyYy3mHWLh24LJZKVdXZ2PNdizSe1B/E8bVm+HYcjbEzGuVXDv/di+EzdO/6Gq80A==", "dev": true, "requires": { "@babel/core": "^7.1.0", - "@jest/test-sequencer": "^26.4.1", + "@jest/test-sequencer": "^26.4.2", "@jest/types": "^26.3.0", "babel-jest": "^26.3.0", "chalk": "^4.0.0", @@ -3720,13 +3720,13 @@ "jest-environment-jsdom": "^26.3.0", "jest-environment-node": "^26.3.0", "jest-get-type": "^26.3.0", - "jest-jasmine2": "^26.4.1", + "jest-jasmine2": "^26.4.2", "jest-regex-util": "^26.0.0", "jest-resolve": "^26.4.0", "jest-util": "^26.3.0", - "jest-validate": "^26.4.0", + "jest-validate": "^26.4.2", "micromatch": "^4.0.2", - "pretty-format": "^26.4.0" + "pretty-format": "^26.4.2" }, "dependencies": { "@jest/types": { @@ -3768,9 +3768,9 @@ "dev": true }, "pretty-format": { - "version": "26.4.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.4.0.tgz", - "integrity": "sha512-mEEwwpCseqrUtuMbrJG4b824877pM5xald3AkilJ47Po2YLr97/siejYQHqj2oDQBeJNbu+Q0qUuekJ8F0NAPg==", + "version": "26.4.2", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.4.2.tgz", + "integrity": "sha512-zK6Gd8zDsEiVydOCGLkoBoZuqv8VTiHyAbKznXe/gaph/DAeZOmit9yMfgIz5adIgAMMs5XfoYSwAX3jcCO1tA==", "dev": true, "requires": { "@jest/types": "^26.3.0", @@ -3803,16 +3803,16 @@ } }, "jest-each": { - "version": "26.4.0", - "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-26.4.0.tgz", - "integrity": "sha512-+cyBh1ehs6thVT/bsZVG+WwmRn2ix4Q4noS9yLZgM10yGWPW12/TDvwuOV2VZXn1gi09/ZwJKJWql6YW1C9zNw==", + "version": "26.4.2", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-26.4.2.tgz", + "integrity": "sha512-p15rt8r8cUcRY0Mvo1fpkOGYm7iI8S6ySxgIdfh3oOIv+gHwrHTy5VWCGOecWUhDsit4Nz8avJWdT07WLpbwDA==", "dev": true, "requires": { "@jest/types": "^26.3.0", "chalk": "^4.0.0", "jest-get-type": "^26.3.0", "jest-util": "^26.3.0", - "pretty-format": "^26.4.0" + "pretty-format": "^26.4.2" }, "dependencies": { "@jest/types": { @@ -3854,9 +3854,9 @@ "dev": true }, "pretty-format": { - "version": "26.4.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.4.0.tgz", - "integrity": "sha512-mEEwwpCseqrUtuMbrJG4b824877pM5xald3AkilJ47Po2YLr97/siejYQHqj2oDQBeJNbu+Q0qUuekJ8F0NAPg==", + "version": "26.4.2", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.4.2.tgz", + "integrity": "sha512-zK6Gd8zDsEiVydOCGLkoBoZuqv8VTiHyAbKznXe/gaph/DAeZOmit9yMfgIz5adIgAMMs5XfoYSwAX3jcCO1tA==", "dev": true, "requires": { "@jest/types": "^26.3.0", @@ -4027,9 +4027,9 @@ } }, "jest-jasmine2": { - "version": "26.4.1", - "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-26.4.1.tgz", - "integrity": "sha512-GMPqJXyAWpohCg4wfA82lwac65lmgANH4/rOhNNaAN9yjInMAeMExQcWE1xb3fcCgLwibqeAuqVrV83oQl+szg==", + "version": "26.4.2", + "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-26.4.2.tgz", + "integrity": "sha512-z7H4EpCldHN1J8fNgsja58QftxBSL+JcwZmaXIvV9WKIM+x49F4GLHu/+BQh2kzRKHAgaN/E82od+8rTOBPyPA==", "dev": true, "requires": { "@babel/traverse": "^7.1.0", @@ -4040,15 +4040,15 @@ "@types/node": "*", "chalk": "^4.0.0", "co": "^4.6.0", - "expect": "^26.4.1", + "expect": "^26.4.2", "is-generator-fn": "^2.0.0", - "jest-each": "^26.4.0", - "jest-matcher-utils": "^26.4.1", + "jest-each": "^26.4.2", + "jest-matcher-utils": "^26.4.2", "jest-message-util": "^26.3.0", - "jest-runtime": "^26.4.1", - "jest-snapshot": "^26.4.1", + "jest-runtime": "^26.4.2", + "jest-snapshot": "^26.4.2", "jest-util": "^26.3.0", - "pretty-format": "^26.4.0", + "pretty-format": "^26.4.2", "throat": "^5.0.0" }, "dependencies": { @@ -4085,9 +4085,9 @@ } }, "pretty-format": { - "version": "26.4.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.4.0.tgz", - "integrity": "sha512-mEEwwpCseqrUtuMbrJG4b824877pM5xald3AkilJ47Po2YLr97/siejYQHqj2oDQBeJNbu+Q0qUuekJ8F0NAPg==", + "version": "26.4.2", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.4.2.tgz", + "integrity": "sha512-zK6Gd8zDsEiVydOCGLkoBoZuqv8VTiHyAbKznXe/gaph/DAeZOmit9yMfgIz5adIgAMMs5XfoYSwAX3jcCO1tA==", "dev": true, "requires": { "@jest/types": "^26.3.0", @@ -4099,13 +4099,13 @@ } }, "jest-leak-detector": { - "version": "26.4.0", - "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-26.4.0.tgz", - "integrity": "sha512-7EXKKEKnAWUPyiVtGZzJflbPOtYUdlNoevNVOkAcPpdR8xWiYKPGNGA6sz25S+8YhZq3rmkQJYAh3/P0VnoRwA==", + "version": "26.4.2", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-26.4.2.tgz", + "integrity": "sha512-akzGcxwxtE+9ZJZRW+M2o+nTNnmQZxrHJxX/HjgDaU5+PLmY1qnQPnMjgADPGCRPhB+Yawe1iij0REe+k/aHoA==", "dev": true, "requires": { "jest-get-type": "^26.3.0", - "pretty-format": "^26.4.0" + "pretty-format": "^26.4.2" }, "dependencies": { "@jest/types": { @@ -4147,9 +4147,9 @@ "dev": true }, "pretty-format": { - "version": "26.4.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.4.0.tgz", - "integrity": "sha512-mEEwwpCseqrUtuMbrJG4b824877pM5xald3AkilJ47Po2YLr97/siejYQHqj2oDQBeJNbu+Q0qUuekJ8F0NAPg==", + "version": "26.4.2", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.4.2.tgz", + "integrity": "sha512-zK6Gd8zDsEiVydOCGLkoBoZuqv8VTiHyAbKznXe/gaph/DAeZOmit9yMfgIz5adIgAMMs5XfoYSwAX3jcCO1tA==", "dev": true, "requires": { "@jest/types": "^26.3.0", @@ -4161,15 +4161,15 @@ } }, "jest-matcher-utils": { - "version": "26.4.1", - "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-26.4.1.tgz", - "integrity": "sha512-nmHWaOz54R/w6zJju5tuW0bw6+m38Rb1jnDKehKM/bOngDDL0UwtN634cRxpFoUNVRUrX8Wa0Z34xq/f8iuP5A==", + "version": "26.4.2", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-26.4.2.tgz", + "integrity": "sha512-KcbNqWfWUG24R7tu9WcAOKKdiXiXCbMvQYT6iodZ9k1f7065k0keUOW6XpJMMvah+hTfqkhJhRXmA3r3zMAg0Q==", "dev": true, "requires": { "chalk": "^4.0.0", - "jest-diff": "^26.4.0", + "jest-diff": "^26.4.2", "jest-get-type": "^26.3.0", - "pretty-format": "^26.4.0" + "pretty-format": "^26.4.2" }, "dependencies": { "@jest/types": { @@ -4211,15 +4211,15 @@ "dev": true }, "jest-diff": { - "version": "26.4.0", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-26.4.0.tgz", - "integrity": "sha512-wwC38HlOW+iTq6j5tkj/ZamHn6/nrdcEOc/fKaVILNtN2NLWGdkfRaHWwfNYr5ehaLvuoG2LfCZIcWByVj0gjg==", + "version": "26.4.2", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-26.4.2.tgz", + "integrity": "sha512-6T1XQY8U28WH0Z5rGpQ+VqZSZz8EN8rZcBtfvXaOkbwxIEeRre6qnuZQlbY1AJ4MKDxQF8EkrCvK+hL/VkyYLQ==", "dev": true, "requires": { "chalk": "^4.0.0", "diff-sequences": "^26.3.0", "jest-get-type": "^26.3.0", - "pretty-format": "^26.4.0" + "pretty-format": "^26.4.2" } }, "jest-get-type": { @@ -4229,9 +4229,9 @@ "dev": true }, "pretty-format": { - "version": "26.4.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.4.0.tgz", - "integrity": "sha512-mEEwwpCseqrUtuMbrJG4b824877pM5xald3AkilJ47Po2YLr97/siejYQHqj2oDQBeJNbu+Q0qUuekJ8F0NAPg==", + "version": "26.4.2", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.4.2.tgz", + "integrity": "sha512-zK6Gd8zDsEiVydOCGLkoBoZuqv8VTiHyAbKznXe/gaph/DAeZOmit9yMfgIz5adIgAMMs5XfoYSwAX3jcCO1tA==", "dev": true, "requires": { "@jest/types": "^26.3.0", @@ -4440,14 +4440,14 @@ "dev": true }, "parse-json": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.0.1.tgz", - "integrity": "sha512-ztoZ4/DYeXQq4E21v169sC8qWINGpcosGv9XhTDvg9/hWvx/zrFkc9BiWxR58OJLHGk28j5BL0SDLeV2WmFZlQ==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.1.0.tgz", + "integrity": "sha512-+mi/lmVVNKFNVyLXV31ERiy2CY5E1/F6QtJFEzoChPRwwngMNXRDQ9GJ5WdE2Z2P4AujsOi0/+2qHID68KwfIQ==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", "error-ex": "^1.3.1", - "json-parse-better-errors": "^1.0.1", + "json-parse-even-better-errors": "^2.3.0", "lines-and-columns": "^1.1.6" } }, @@ -4491,14 +4491,14 @@ } }, "jest-resolve-dependencies": { - "version": "26.4.1", - "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-26.4.1.tgz", - "integrity": "sha512-Gx4JfQ1k/hGb4lqVOOx8TPOkNtyJIQSHcJU68pB+sdyDJi9rbMxD1XXiYyaEq9WXufiZo90k9GTK6z6a5m0SQw==", + "version": "26.4.2", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-26.4.2.tgz", + "integrity": "sha512-ADHaOwqEcVc71uTfySzSowA/RdxUpCxhxa2FNLiin9vWLB1uLPad3we+JSSROq5+SrL9iYPdZZF8bdKM7XABTQ==", "dev": true, "requires": { "@jest/types": "^26.3.0", "jest-regex-util": "^26.0.0", - "jest-snapshot": "^26.4.1" + "jest-snapshot": "^26.4.2" }, "dependencies": { "@jest/types": { @@ -4536,9 +4536,9 @@ } }, "jest-runner": { - "version": "26.4.1", - "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-26.4.1.tgz", - "integrity": "sha512-QcKwn1YNlzFumTtFsocETgIm13KNt2X8sae4wcqsF3JnxGUcYYUGBstCQhtAG4fKD/TKThHkgE/ZgQVKipj7oA==", + "version": "26.4.2", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-26.4.2.tgz", + "integrity": "sha512-FgjDHeVknDjw1gRAYaoUoShe1K3XUuFMkIaXbdhEys+1O4bEJS8Avmn4lBwoMfL8O5oFTdWYKcf3tEJyyYyk8g==", "dev": true, "requires": { "@jest/console": "^26.3.0", @@ -4550,13 +4550,13 @@ "emittery": "^0.7.1", "exit": "^0.1.2", "graceful-fs": "^4.2.4", - "jest-config": "^26.4.1", + "jest-config": "^26.4.2", "jest-docblock": "^26.0.0", "jest-haste-map": "^26.3.0", - "jest-leak-detector": "^26.4.0", + "jest-leak-detector": "^26.4.2", "jest-message-util": "^26.3.0", "jest-resolve": "^26.4.0", - "jest-runtime": "^26.4.1", + "jest-runtime": "^26.4.2", "jest-util": "^26.3.0", "jest-worker": "^26.3.0", "source-map-support": "^0.5.6", @@ -4598,15 +4598,15 @@ } }, "jest-runtime": { - "version": "26.4.1", - "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-26.4.1.tgz", - "integrity": "sha512-zXPQBS4iL/CEZtDfX+rDz+oZ/inQK/EYOeVt3uDWu8kwSdP/Cw4yOZtCTPApeNsGtZy6X5WQ1U+fyagN1B/Qkw==", + "version": "26.4.2", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-26.4.2.tgz", + "integrity": "sha512-4Pe7Uk5a80FnbHwSOk7ojNCJvz3Ks2CNQWT5Z7MJo4tX0jb3V/LThKvD9tKPNVNyeMH98J/nzGlcwc00R2dSHQ==", "dev": true, "requires": { "@jest/console": "^26.3.0", "@jest/environment": "^26.3.0", "@jest/fake-timers": "^26.3.0", - "@jest/globals": "^26.4.1", + "@jest/globals": "^26.4.2", "@jest/source-map": "^26.3.0", "@jest/test-result": "^26.3.0", "@jest/transform": "^26.3.0", @@ -4617,15 +4617,15 @@ "exit": "^0.1.2", "glob": "^7.1.3", "graceful-fs": "^4.2.4", - "jest-config": "^26.4.1", + "jest-config": "^26.4.2", "jest-haste-map": "^26.3.0", "jest-message-util": "^26.3.0", "jest-mock": "^26.3.0", "jest-regex-util": "^26.0.0", "jest-resolve": "^26.4.0", - "jest-snapshot": "^26.4.1", + "jest-snapshot": "^26.4.2", "jest-util": "^26.3.0", - "jest-validate": "^26.4.0", + "jest-validate": "^26.4.2", "slash": "^3.0.0", "strip-bom": "^4.0.0", "yargs": "^15.3.1" @@ -4682,25 +4682,25 @@ } }, "jest-snapshot": { - "version": "26.4.1", - "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-26.4.1.tgz", - "integrity": "sha512-5DsxbSSuYA8rZ/ynO+l5J65wSIyzDB2AXjuIvep90YmtslrROqDtba2hBgq1Cj6L6A0j/jv6h8JydEe2WYPM/g==", + "version": "26.4.2", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-26.4.2.tgz", + "integrity": "sha512-N6Uub8FccKlf5SBFnL2Ri/xofbaA68Cc3MGjP/NuwgnsvWh+9hLIR/DhrxbSiKXMY9vUW5dI6EW1eHaDHqe9sg==", "dev": true, "requires": { "@babel/types": "^7.0.0", "@jest/types": "^26.3.0", "@types/prettier": "^2.0.0", "chalk": "^4.0.0", - "expect": "^26.4.1", + "expect": "^26.4.2", "graceful-fs": "^4.2.4", - "jest-diff": "^26.4.0", + "jest-diff": "^26.4.2", "jest-get-type": "^26.3.0", "jest-haste-map": "^26.3.0", - "jest-matcher-utils": "^26.4.1", + "jest-matcher-utils": "^26.4.2", "jest-message-util": "^26.3.0", "jest-resolve": "^26.4.0", "natural-compare": "^1.4.0", - "pretty-format": "^26.4.0", + "pretty-format": "^26.4.2", "semver": "^7.3.2" }, "dependencies": { @@ -4743,15 +4743,15 @@ "dev": true }, "jest-diff": { - "version": "26.4.0", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-26.4.0.tgz", - "integrity": "sha512-wwC38HlOW+iTq6j5tkj/ZamHn6/nrdcEOc/fKaVILNtN2NLWGdkfRaHWwfNYr5ehaLvuoG2LfCZIcWByVj0gjg==", + "version": "26.4.2", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-26.4.2.tgz", + "integrity": "sha512-6T1XQY8U28WH0Z5rGpQ+VqZSZz8EN8rZcBtfvXaOkbwxIEeRre6qnuZQlbY1AJ4MKDxQF8EkrCvK+hL/VkyYLQ==", "dev": true, "requires": { "chalk": "^4.0.0", "diff-sequences": "^26.3.0", "jest-get-type": "^26.3.0", - "pretty-format": "^26.4.0" + "pretty-format": "^26.4.2" } }, "jest-get-type": { @@ -4761,9 +4761,9 @@ "dev": true }, "pretty-format": { - "version": "26.4.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.4.0.tgz", - "integrity": "sha512-mEEwwpCseqrUtuMbrJG4b824877pM5xald3AkilJ47Po2YLr97/siejYQHqj2oDQBeJNbu+Q0qUuekJ8F0NAPg==", + "version": "26.4.2", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.4.2.tgz", + "integrity": "sha512-zK6Gd8zDsEiVydOCGLkoBoZuqv8VTiHyAbKznXe/gaph/DAeZOmit9yMfgIz5adIgAMMs5XfoYSwAX3jcCO1tA==", "dev": true, "requires": { "@jest/types": "^26.3.0", @@ -4823,9 +4823,9 @@ } }, "jest-validate": { - "version": "26.4.0", - "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-26.4.0.tgz", - "integrity": "sha512-t56Z/FRMrLP6mpmje7/YgHy0wOzcuc6i3LBXz6kjmsUWYN62OuMdC86Vg9/dX59SvyitSqqegOrx+h7BkNXeaQ==", + "version": "26.4.2", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-26.4.2.tgz", + "integrity": "sha512-blft+xDX7XXghfhY0mrsBCYhX365n8K5wNDC4XAcNKqqjEzsRUSXP44m6PL0QJEW2crxQFLLztVnJ4j7oPlQrQ==", "dev": true, "requires": { "@jest/types": "^26.3.0", @@ -4833,7 +4833,7 @@ "chalk": "^4.0.0", "jest-get-type": "^26.3.0", "leven": "^3.1.0", - "pretty-format": "^26.4.0" + "pretty-format": "^26.4.2" }, "dependencies": { "@jest/types": { @@ -4881,9 +4881,9 @@ "dev": true }, "pretty-format": { - "version": "26.4.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.4.0.tgz", - "integrity": "sha512-mEEwwpCseqrUtuMbrJG4b824877pM5xald3AkilJ47Po2YLr97/siejYQHqj2oDQBeJNbu+Q0qUuekJ8F0NAPg==", + "version": "26.4.2", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.4.2.tgz", + "integrity": "sha512-zK6Gd8zDsEiVydOCGLkoBoZuqv8VTiHyAbKznXe/gaph/DAeZOmit9yMfgIz5adIgAMMs5XfoYSwAX3jcCO1tA==", "dev": true, "requires": { "@jest/types": "^26.3.0", @@ -5016,10 +5016,10 @@ "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", "dev": true }, - "json-parse-better-errors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", - "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "json-parse-even-better-errors": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.0.tgz", + "integrity": "sha512-o3aP+RsWDJZayj1SbHNQAI8x0v3T3SKiGoZlNYfbUP1S3omJQ6i9CnqADqkSPaOAxwua4/1YWx5CM7oiChJt2Q==", "dev": true }, "json-schema": { @@ -5923,9 +5923,9 @@ } }, "rollup": { - "version": "2.26.4", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.26.4.tgz", - "integrity": "sha512-6+qsGuP0MXGd7vlYmk72utm1MrgZj5GfXibGL+cRkKQ9+ZL/BnFThDl0D5bcl7AqlzMjAQXRAwZX1HVm22M/4Q==", + "version": "2.26.6", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.26.6.tgz", + "integrity": "sha512-iSB7eE3k/VNQHnI7ckS++4yIqTamoUCB1xo7MswhJ/fg22oFYR5+xCrUZVviBj97jvc5A31MPbVMw1Wc3jWxmw==", "dev": true, "requires": { "fsevents": "~2.1.2" @@ -6747,9 +6747,9 @@ } }, "ts-jest": { - "version": "26.2.0", - "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-26.2.0.tgz", - "integrity": "sha512-9+y2qwzXdAImgLSYLXAb/Rhq9+K4rbt0417b8ai987V60g2uoNWBBmMkYgutI7D8Zhu+IbCSHbBtrHxB9d7xyA==", + "version": "26.3.0", + "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-26.3.0.tgz", + "integrity": "sha512-Jq2uKfx6bPd9+JDpZNMBJMdMQUC3sJ08acISj8NXlVgR2d5OqslEHOR2KHMgwymu8h50+lKIm0m0xj/ioYdW2Q==", "dev": true, "requires": { "@types/jest": "26.x", @@ -7041,22 +7041,14 @@ "dev": true }, "whatwg-url": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-8.1.0.tgz", - "integrity": "sha512-vEIkwNi9Hqt4TV9RdnaBPNt+E2Sgmo3gePebCRgZ1R7g6d23+53zCTnuB0amKI4AXq6VM8jj2DUAa0S1vjJxkw==", + "version": "8.2.1", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-8.2.1.tgz", + "integrity": "sha512-ZmVCr6nfBeaMxEHALLEGy0LszYjpJqf6PVNQUQ1qd9Et+q7Jpygd4rGGDXgHjD8e99yLFseD69msHDM4YwPZ4A==", "dev": true, "requires": { "lodash.sortby": "^4.7.0", "tr46": "^2.0.2", - "webidl-conversions": "^5.0.0" - }, - "dependencies": { - "webidl-conversions": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-5.0.0.tgz", - "integrity": "sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA==", - "dev": true - } + "webidl-conversions": "^6.1.0" } }, "which": { diff --git a/package.json b/package.json index 5a06594..66cd622 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "chrisweb-utilities", - "version": "1.2.0", + "version": "1.3.0", "description": "chrisweb utilities", "types": "dist/@types/chrisweb-utilities/index.d.ts", "scripts": { @@ -34,14 +34,14 @@ "homepage": "https://github.com/chrisweb/chrisweb-utilities.js", "devDependencies": { "@types/jest": "26.0.10", - "jest": "26.4.1", - "rollup": "2.26.4", + "jest": "26.4.2", + "rollup": "2.26.6", "rollup-plugin-typescript2": "0.27.2", - "ts-jest": "26.2.0", + "ts-jest": "26.3.0", "eslint": "7.7.0", "eslint-plugin-import": "2.22.0", - "@typescript-eslint/eslint-plugin": "3.9.1", - "@typescript-eslint/parser": "3.9.1", + "@typescript-eslint/eslint-plugin": "3.10.1", + "@typescript-eslint/parser": "3.10.1", "typescript": "4.0.2" } } diff --git a/src/index.ts b/src/index.ts index c1a9f4d..008742d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -8,7 +8,7 @@ import { generateUUID } from './utilities/uuid'; import { removeElements } from './utilities/html'; import { log } from './utilities/log'; import { sleep } from './utilities/helper'; -import { randomInteger } from './utilities/random'; +import { randomInteger, choice } from './utilities/random'; const version = '1.0.0'; @@ -36,5 +36,6 @@ export { removeElements, log, sleep, - randomInteger + randomInteger, + choice }; diff --git a/src/utilities/random.ts b/src/utilities/random.ts index 2357a37..fbd1cab 100644 --- a/src/utilities/random.ts +++ b/src/utilities/random.ts @@ -7,4 +7,8 @@ const randomInteger = (min = 0, max = Infinity): number => { return Math.floor(Math.random() * (max - min + 1) + min); } -export { randomInteger } \ No newline at end of file +const choice = (sequence: unknown[] = []): unknown => { + return sequence[Math.floor(Math.random() * sequence.length)]; +} + +export { randomInteger, choice } \ No newline at end of file