uicore-ts 1.0.578 → 1.0.580

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,10 +6,10 @@ declare global {
6
6
  replaceElementAtIndex(index: number, element: T): void;
7
7
  contains(element: T): boolean;
8
8
  findAsyncSequential(functionToCall: (value: any) => Promise<boolean>): Promise<any>;
9
- groupedBy<T>(keyFunction: (item: T) => any): {
9
+ groupedBy(keyFunction: (item: T) => any): {
10
10
  [key: string]: Array<T>;
11
11
  } & Object;
12
- uniqueMap<T, R>(keyFunction: (item: T) => R): R[];
12
+ uniqueMap<R>(keyFunction: (item: T) => R): R[];
13
13
  copy(): Array<T>;
14
14
  arrayByRepeating(numberOfRepetitions: number): Array<T>;
15
15
  arrayByTrimmingToLengthIfLonger(maxLength: number): Array<T>;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../scripts/UICoreExtensions.ts"],
4
- "sourcesContent": ["import { UICoreExtensionValueObject } from \"./UICoreExtensionValueObject\"\nimport { UIObject } from \"./UIObject\"\n\n\ndeclare global {\n \n \n interface Array<T> {\n \n removeElementAtIndex(index: number): void;\n \n removeElement(element: T): void;\n \n insertElementAtIndex(index: number, element: T): void;\n \n replaceElementAtIndex(index: number, element: T): void;\n \n \n contains(element: T): boolean;\n \n findAsyncSequential(functionToCall: (value: any) => Promise<boolean>): Promise<any>;\n \n groupedBy<T>(keyFunction: (item: T) => any): { [key: string]: Array<T> } & Object;\n \n uniqueMap<T, R>(keyFunction: (item: T) => R): R[]; \n \n copy(): Array<T>;\n \n arrayByRepeating(numberOfRepetitions: number): Array<T>;\n \n arrayByTrimmingToLengthIfLonger(maxLength: number): Array<T>;\n \n anyMatch(predicate: (value: T, index: number, obj: T[]) => boolean): boolean\n \n noneMatch(predicate: (value: T, index: number, obj: T[]) => boolean): boolean\n \n allMatch(predicate: (value: T, index: number, obj: T[]) => boolean): boolean\n \n firstElement: T;\n lastElement: T;\n readonly summedValue: T;\n \n everyElement: UIEveryElementItem<T>;\n \n max(): number;\n \n min(): number;\n \n average(): number;\n \n isEqualToArray(array: Array<T>, keyPath?: string): boolean;\n \n }\n \n \n interface String {\n \n contains(string: string): boolean;\n \n readonly numericalValue: number;\n readonly integerValue: number;\n isAString: boolean;\n \n }\n \n \n interface Number {\n \n isANumber: boolean;\n \n readonly integerValue: number;\n \n constrainedValue(min: number, max: number): number;\n \n }\n \n \n interface Date {\n \n readonly dateString: string;\n \n }\n \n \n interface Object {\n \n forEach(callbackFunction: (value: any, key: string, stopLooping: () => void) => void): void;\n \n objectByCopyingValuesRecursivelyFromObject<T extends object>(object: T): T & this;\n \n readonly allValues: Array<any>;\n readonly allKeys: (keyof this)[];\n \n }\n \n}\n\nexport {}\n\nconst YES = true\nconst NO = false\n\nif (\"removeElementAtIndex\" in Array.prototype == NO) {\n \n (Array.prototype as any).removeElementAtIndex = function (this: Array<any>, index: number) {\n \n // @ts-ignore\n if (index >= 0 && index < this.length) {\n this.splice(index, 1)\n }\n \n }\n \n}\n\n\n// interface Array<T> {\n//\n// removeElementAtIndex(index: number);\n//\n// }\n\n\nif (\"removeElement\" in Array.prototype == NO) {\n \n (Array.prototype as any).removeElement = function (this: Array<any>, element: any) {\n this.removeElementAtIndex(this.indexOf(element))\n }\n \n}\n\n\n// interface Array<T> {\n//\n// removeElement(element: T);\n//\n// }\n\n\nif (\"insertElementAtIndex\" in Array.prototype == NO) {\n \n (Array.prototype as any).insertElementAtIndex = function (this: Array<any>, index: number, element: any) {\n \n if (index >= 0 && index <= this.length) {\n this.splice(index, 0, element)\n }\n \n }\n \n}\n\n\n// interface Array<T> {\n//\n// insertElementAtIndex(index: number, element: T);\n//\n// }\n\n\nif (\"replaceElementAtIndex\" in Array.prototype == NO) {\n \n (Array.prototype as any).replaceElementAtIndex = function (this: Array<any>, index: number, element: any) {\n \n this.removeElementAtIndex(index)\n this.insertElementAtIndex(index, element)\n \n }\n \n}\n\n\n// interface Array<T> {\n//\n// replaceElementAtIndex(index: number, element: T);\n//\n// }\n\n\nif (\"contains\" in Array.prototype == NO) {\n \n (Array.prototype as any).contains = function (this: Array<any>, element: any) {\n return (this.indexOf(element) != -1)\n }\n \n}\n\nif (\"containsAny\" in Array.prototype == NO) {\n \n (Array.prototype as any).containsAny = function (this: Array<any>, elements: any[]) {\n return this.anyMatch(element => elements.contains(element))\n }\n \n}\n\n\n// interface Array<T> {\n//\n// contains(element: T): boolean;\n//\n// containsAny(element: T[]): boolean;\n//\n// }\n\n\nif (\"anyMatch\" in Array.prototype == NO) {\n \n (Array.prototype as any).anyMatch = function (\n this: Array<any>,\n functionToCall: (value: any, index: number, array: any[]) => boolean\n ) {\n // @ts-ignore\n return (this.findIndex(functionToCall) > -1)\n }\n \n}\n\nif (\"noneMatch\" in Array.prototype == NO) {\n \n (Array.prototype as any).noneMatch = function (\n this: Array<any>,\n functionToCall: (value: any, index: number, array: any[]) => boolean\n ) {\n // @ts-ignore\n return (this.findIndex(functionToCall) == -1)\n }\n \n}\n\nif (\"allMatch\" in Array.prototype == NO) {\n \n (Array.prototype as any).allMatch = function (\n this: Array<any>,\n functionToCall: (value: any, index: number, array: any[]) => boolean\n ) {\n \n function reversedFunction(value: any, index: number, array: any[]) {\n return !functionToCall(value, index, array)\n }\n \n // @ts-ignore\n return (this.findIndex(reversedFunction) == -1)\n \n }\n \n}\n\nif (\"findAsyncSequential\" in Array.prototype == NO) {\n \n (Array.prototype as any).findAsyncSequential = function (\n this: Array<any>,\n functionToCall: (value: any) => Promise<boolean>\n ) {\n \n // https://stackoverflow.com/questions/55601062/using-an-async-function-in-array-find\n async function findAsyncSequential<T>(\n array: T[],\n predicate: (t: T) => Promise<boolean>\n ): Promise<T | undefined> {\n for (const t of array) {\n if (await predicate(t)) {\n return t\n }\n }\n return undefined\n }\n \n return findAsyncSequential(this, functionToCall)\n \n }\n \n}\n\n\n// interface Array<T> {\n//\n// anyMatch(predicate: (value: T, index: number, obj: T[]) => boolean): boolean\n//\n// noneMatch(predicate: (value: T, index: number, obj: T[]) => boolean): boolean\n//\n// allMatch(predicate: (value: T, index: number, obj: T[]) => boolean): boolean\n//\n// }\n\n\nif (\"groupedBy\" in Array.prototype == NO) {\n \n Array.prototype.groupedBy = function (this: Array<any>, funcProp) {\n return this.reduce(function (acc, val) {\n (acc[funcProp(val)] = acc[funcProp(val)] || []).push(val)\n return acc\n }, {})\n }\n \n}\n\nif (\"uniqueMap\" in Array.prototype == NO) {\n \n Array.prototype.uniqueMap = function (this: Array<any>, funcProp) {\n \n const result: any[] = []\n \n for (let i = 0; i < this.length; i++){\n \n const element = this[i]\n const elementResult = funcProp(element)\n \n if (!result.contains(elementResult)) {\n result.push(elementResult);\n }\n \n }\n \n return result;\n \n }\n \n}\n\n\n// interface Array<T> {\n//\n// groupedBy(keyFunction: (item: T) => any): { [key: string]: Array<T> };\n//\n// }\n\n\nif (\"firstElement\" in Array.prototype == NO) {\n Object.defineProperty(Array.prototype, \"firstElement\", {\n get: function firstElement(this: Array<any>) {\n return this[0]\n },\n set: function (this: Array<any>, element: any) {\n if (this.length == 0) {\n this.push(element)\n return\n }\n this[0] = element\n }\n })\n}\n\nif (\"lastElement\" in Array.prototype == NO) {\n Object.defineProperty(Array.prototype, \"lastElement\", {\n get: function lastElement(this: Array<any>) {\n return this[this.length - 1]\n },\n set: function (this: Array<any>, element: any) {\n if (this.length == 0) {\n this.push(element)\n return\n }\n this[this.length - 1] = element\n }\n })\n}\n\nif (\"everyElement\" in Array.prototype == NO) {\n \n Object.defineProperty(Array.prototype, \"everyElement\", {\n \n get: function everyElement(this: Array<any>) {\n \n const valueKeys: string[] = []\n \n const targetFunction = (objects: any) => {\n \n return this.map((element) => {\n \n const thisObject = UIObject.valueForKeyPath(\n valueKeys.arrayByTrimmingToLengthIfLonger(valueKeys.length - 1).join(\".\"),\n element\n ) || element\n \n const elementFunction = (UIObject.valueForKeyPath(valueKeys.join(\".\"), element) as Function)?.bind(\n thisObject,\n objects\n )\n \n return elementFunction?.()\n \n })\n \n }\n \n const result: any = new Proxy(\n targetFunction,\n {\n \n get: (target, key: string, _receiver) => {\n \n if (key == \"UI_elementValues\") {\n return this.map(element => UIObject.valueForKeyPath(\n valueKeys.join(\".\"),\n element\n ))\n }\n \n valueKeys.push(key)\n \n return result\n \n },\n set: (target, key: string, value, _receiver) => {\n \n valueKeys.push(key)\n this.forEach(element => UIObject.setValueForKeyPath(valueKeys.join(\".\"), value, element, YES))\n return true\n \n }\n \n }\n )\n \n return result\n \n },\n set: function (this: Array<any>, element: any) {\n for (let i = 0; i < this.length; ++i) {\n this[i] = element\n }\n }\n \n })\n \n}\n\n\nexport type UIEveryElementItem<T> = {\n \n [P in keyof T]: UIEveryElementItem<T[P]>\n \n} & {\n \n UI_elementValues?: T[];\n \n} & T\n\n// interface Array<T> {\n//\n// firstElement: T;\n// lastElement: T;\n//\n// everyElement: UIEveryElementItem<T>;\n//\n// }\n\n\nif (\"copy\" in Array.prototype == NO) {\n \n (Array.prototype as any).copy = function (this: Array<any>) {\n return this.slice(0)\n }\n \n}\n\n\n// interface Array<T> {\n//\n// copy(): Array<T>;\n//\n// }\n\n\nif (\"arrayByRepeating\" in Array.prototype == NO) {\n \n (Array.prototype as any).arrayByRepeating = function (this: Array<any>, numberOfRepetitions: number) {\n const result: any[] = []\n for (let i = 0; i < numberOfRepetitions; i++) {\n this.forEach(element => result.push(element))\n }\n return result\n }\n \n}\n\n\n// interface Array<T> {\n//\n// arrayByRepeating(numberOfRepetitions: number): Array<T>;\n//\n// }\n\n\nif (\"arrayByTrimmingToLengthIfLonger\" in Array.prototype == NO) {\n (Array.prototype as any).arrayByTrimmingToLengthIfLonger = function (this: Array<any>, maxLength: number) {\n const result = []\n for (let i = 0; i < maxLength && i < this.length; i++) {\n result.push(this[i])\n }\n return result\n }\n}\n\n\n// interface Array<T> {\n//\n// arrayByTrimmingToLengthIfLonger(maxLength: number): Array<T>;\n//\n// }\n\n\nif (\"summedValue\" in Array.prototype == NO) {\n \n Object.defineProperty(Array.prototype, \"summedValue\", {\n get: function summedValue(this: Array<any>) {\n return this.reduce(function (a, b) {\n return a + b\n }, 0)\n }\n })\n \n}\n\n\n// interface Array<T> {\n//\n// readonly summedValue: T;\n//\n// max(): number;\n// min(): number;\n//\n//\n// }\n\nArray.prototype.max = function () {\n return Math.max.apply(null, this)\n}\n\nArray.prototype.min = function () {\n return Math.min.apply(null, this)\n}\n\nif (!Array.prototype.average) {\n \n Array.prototype.average = function () {\n if (this.length == 0) {\n return 0;\n }\n const sum = this.reduce((a, b) => a + b, 0)\n return sum / this.length\n }\n \n}\n\n// interface Array<T> {\n//\n// isEqualToArray(array: Array<T>, keyPath?: string): boolean;\n//\n// }\n\n\nif (\"isEqualToArray\" in Array.prototype == NO) {\n \n // attach the .equals method to Array's prototype to call it on any array\n Array.prototype.isEqualToArray = function (array: any[], keyPath?: string) {\n \n // if the other array is a falsy value, return\n if (!array) {\n return false\n }\n \n // compare lengths - can save a lot of time\n if (this.length != array.length) {\n return false\n }\n \n var i = 0\n const l = this.length\n for (; i < l; i++) {\n \n // Check if we have nested arrays\n if (this[i] instanceof Array && array[i] instanceof Array && !keyPath) {\n \n // recurse into the nested arrays\n if (!this[i].isEqualToArray(array[i])) {\n return false\n }\n \n }\n else if (keyPath && UIObject.valueForKeyPath(keyPath, this[i]) != UIObject.valueForKeyPath(\n keyPath,\n array[i]\n )) {\n \n return false\n \n }\n else if (this[i] != array[i]) {\n \n // Warning - two different object instances will never be equal: {x:20} != {x:20}\n return false\n \n }\n \n }\n \n return true\n \n }\n \n // Hide method from for-in loops\n Object.defineProperty(Array.prototype, \"isEqualToArray\", { enumerable: false })\n \n}\n\n\nif (\"forEach\" in Object.prototype == NO) {\n \n (Object.prototype as any).forEach = function (\n this: Record<string, any>,\n callbackFunction: (\n value: any,\n key: string,\n stopLooping: Function\n ) => void\n ) {\n const keys = Object.keys(this)\n let shouldStopLooping = NO\n \n function stopLooping() {\n shouldStopLooping = YES\n }\n \n keys.anyMatch(key => {\n callbackFunction(this[key], key, stopLooping)\n return shouldStopLooping\n })\n }\n \n // Hide method from for-in loops\n Object.defineProperty(Object.prototype, \"forEach\", { enumerable: false })\n \n}\n\n\n// interface Object {\n//\n// forEach(callbackFunction: (value: any, key: string) => void): void;\n//\n// }\n\n\nif (\"allValues\" in Object.prototype == NO) {\n Object.defineProperty(Object.prototype, \"allValues\", {\n get: function (this: Object) {\n const values: any[] = []\n this.forEach((value: any) => {\n values.push(value)\n })\n return values\n },\n enumerable: NO\n })\n}\n\n\n// interface Object {\n//\n// readonly allValues: Array<any>;\n//\n// }\n\n\nif (\"allKeys\" in Object.prototype == NO) {\n Object.defineProperty(Object.prototype, \"allKeys\", {\n get: function (this: Object) {\n return Object.keys(this)\n },\n enumerable: NO\n })\n}\n\n\n// interface Object {\n//\n// readonly allKeys: string[];\n//\n// }\n\n\nif (\"objectByCopyingValuesRecursivelyFromObject\" in Object.prototype == NO) {\n \n (Object.prototype as any).objectByCopyingValuesRecursivelyFromObject = function (this: Object, object: any) {\n \n \n function isAnObject(item: any) {\n return (item && typeof item === \"object\" && !Array.isArray(item))\n }\n \n function mergeRecursively(target: any, source: any) {\n \n const output = Object.assign({}, target)\n \n if (isAnObject(target) && isAnObject(source)) {\n \n Object.keys(source).forEach(function (key) {\n \n if (isAnObject(source[key])) {\n \n // if (!(key in target)) {\n \n // Object.assign(output, { [key]: source[key] });\n \n // }\n // else {\n \n output[key] = mergeRecursively(target[key] ?? {}, source[key])\n \n //}\n \n }\n else {\n \n Object.assign(output, { [key]: source[key] })\n \n }\n \n })\n \n }\n \n return output\n \n }\n \n return mergeRecursively(this, object)\n \n }\n \n // Hide method from for-in loops\n Object.defineProperty(Object.prototype, \"objectByCopyingValuesRecursivelyFromObject\", { enumerable: false })\n \n}\n\n\nif (\"asValueObject\" in Object.prototype == NO) {\n \n (Object.prototype as any).asValueObject = function () {\n \n return new UICoreExtensionValueObject(this)\n \n }\n \n // Hide method from for-in loops\n Object.defineProperty(Object.prototype, \"asValueObject\", { enumerable: false })\n \n}\n\n\n// interface Object {\n//\n// objectByCopyingValuesRecursivelyFromObject<T>(object: T): this & T;\n//\n// asValueObject(): this;\n//\n// }\n\n// export type Unpacked<T> =\n// T extends (infer U)[]\n// ? U\n// : T extends (...args: any[]) => infer U\n// ? U\n// : T extends Promise<infer U>\n// ? U\n// : T\n//\n// export type UnpackedObject<T> = {\n// [P in keyof T]: Unpacked<T[P]>\n// }\n\n// export function promisedProperties<ObjectType extends Record<string, any>>(object: ObjectType): UnpackedObject<ObjectType> {\n//\n// let promisedProperties: any[] = []\n// const objectKeys = Object.keys(object)\n//\n// objectKeys.forEach((key) => promisedProperties.push(object[key]))\n//\n// // @ts-ignore\n// return Promise.all(promisedProperties)\n// .then((resolvedValues) => {\n// return resolvedValues.reduce((resolvedObject, property, index) => {\n// resolvedObject[objectKeys[index]] = property\n// return resolvedObject\n// }, object)\n// })\n//\n// }\n\n// if (\"promisedProperties\" in Object.prototype == NO) {\n//\n// (Object.prototype as any).promisedProperties = function () {\n//\n// const result = promisedProperties(this);\n//\n// return result\n//\n// }\n//\n// // Hide method from for-in loops\n// Object.defineProperty(Object.prototype, \"promisedProperties\", { enumerable: false });\n//\n// }\n//\n//\n// interface Object {\n//\n// readonly promisedProperties: UnpackedObject<this>;\n//\n// }\n\n\nif (\"contains\" in String.prototype == NO) {\n \n (String.prototype as any).contains = function (this: String, string: string) {\n return (this.indexOf(string) != -1)\n }\n \n // Hide method from for-in loops\n Object.defineProperty(Object.prototype, \"contains\", { enumerable: false })\n \n}\n\n\n// interface String {\n//\n// contains(string): boolean;\n//\n// }\n\n\nif (\"capitalizedString\" in String.prototype == NO) {\n Object.defineProperty(Object.prototype, \"capitalizedString\", {\n get: function (this: String) {\n return this.charAt(0).toUpperCase() + this.slice(1).toLowerCase()\n },\n enumerable: NO\n })\n}\n\n\n// interface String {\n//\n// readonly capitalizedString: string;\n//\n// }\n\n\nif (\"numericalValue\" in String.prototype == NO) {\n Object.defineProperty(String.prototype, \"numericalValue\", {\n get: function numericalValue(this: string) {\n return Number(this)\n }\n })\n}\n\nif (\"integerValue\" in String.prototype == NO) {\n Object.defineProperty(String.prototype, \"integerValue\", {\n get: function integerValue(this: string) {\n return Number(this).integerValue\n }\n })\n}\n\n\n// interface String {\n//\n// readonly numericalValue: number;\n//\n// }\n\n\nif (\"isAString\" in String.prototype == NO) {\n \n (String.prototype as any).isAString = YES\n \n}\n\n\n// interface String {\n//\n// isAString: boolean;\n//\n// }\n\n\nif (\"isANumber\" in Number.prototype == NO) {\n \n (Number.prototype as any).isANumber = YES\n \n}\n\n\n// interface Number {\n//\n// isANumber: boolean;\n//\n// }\n\n\nif (\"integerValue\" in Number.prototype == NO) {\n Object.defineProperty(Number.prototype, \"integerValue\", {\n get: function (this: number) {\n return parseInt(\"\" + (Math.round(this) + 0.5))\n },\n enumerable: NO\n })\n}\n\nif (\"constrainedValue\" in Number.prototype == NO) {\n \n (Number.prototype as any).constrainedValue = function (this: number, min: number, max: number) {\n if (this < min) {\n return min;\n }\n if (this > max) {\n return max;\n }\n return this\n }\n \n // Hide method from for-in loops\n Object.defineProperty(Number.prototype, \"constrainedValue\", {\n enumerable: NO\n })\n \n}\n\n\n// interface Number {\n//\n// readonly integerValue: number;\n//\n// }\n\n\nif (\"integerValue\" in Boolean.prototype == NO) {\n \n Object.defineProperty(Boolean.prototype, \"integerValue\", {\n get: function (this: boolean) {\n if (this == true) {\n return 1\n }\n return 0\n }\n })\n \n}\n\n\n// interface Boolean {\n//\n// readonly integerValue: number;\n//\n// }\n\n\nif (\"dateString\" in Date.prototype == NO) {\n \n Object.defineProperty(Date.prototype, \"dateString\", {\n get: function dateString(this: Date) {\n return (\"0\" + this.getDate()).slice(-2) + \"-\" + (\"0\" + (this.getMonth() + 1)).slice(-2) + \"-\" +\n this.getFullYear() + \" \" + (\"0\" + this.getHours()).slice(-2) + \":\" +\n (\"0\" + this.getMinutes()).slice(-2)\n }\n })\n \n \n}\n\n\n// interface Date {\n//\n// readonly dateString: string;\n//\n// }\n\n\n\n\n\n\n\n\n"],
4
+ "sourcesContent": ["import { UICoreExtensionValueObject } from \"./UICoreExtensionValueObject\"\nimport { UIObject } from \"./UIObject\"\n\n\ndeclare global {\n \n \n interface Array<T> {\n \n removeElementAtIndex(index: number): void;\n \n removeElement(element: T): void;\n \n insertElementAtIndex(index: number, element: T): void;\n \n replaceElementAtIndex(index: number, element: T): void;\n \n \n contains(element: T): boolean;\n \n findAsyncSequential(functionToCall: (value: any) => Promise<boolean>): Promise<any>;\n \n groupedBy(keyFunction: (item: T) => any): { [key: string]: Array<T> } & Object;\n \n uniqueMap<R>(keyFunction: (item: T) => R): R[];\n \n copy(): Array<T>;\n \n arrayByRepeating(numberOfRepetitions: number): Array<T>;\n \n arrayByTrimmingToLengthIfLonger(maxLength: number): Array<T>;\n \n anyMatch(predicate: (value: T, index: number, obj: T[]) => boolean): boolean\n \n noneMatch(predicate: (value: T, index: number, obj: T[]) => boolean): boolean\n \n allMatch(predicate: (value: T, index: number, obj: T[]) => boolean): boolean\n \n firstElement: T;\n lastElement: T;\n readonly summedValue: T;\n \n everyElement: UIEveryElementItem<T>;\n \n max(): number;\n \n min(): number;\n \n average(): number;\n \n isEqualToArray(array: Array<T>, keyPath?: string): boolean;\n \n }\n \n \n interface String {\n \n contains(string: string): boolean;\n \n readonly numericalValue: number;\n readonly integerValue: number;\n isAString: boolean;\n \n }\n \n \n interface Number {\n \n isANumber: boolean;\n \n readonly integerValue: number;\n \n constrainedValue(min: number, max: number): number;\n \n }\n \n \n interface Date {\n \n readonly dateString: string;\n \n }\n \n \n interface Object {\n \n forEach(callbackFunction: (value: any, key: string, stopLooping: () => void) => void): void;\n \n objectByCopyingValuesRecursivelyFromObject<T extends object>(object: T): T & this;\n \n readonly allValues: Array<any>;\n readonly allKeys: (keyof this)[];\n \n }\n \n}\n\nexport {}\n\nconst YES = true\nconst NO = false\n\nif (\"removeElementAtIndex\" in Array.prototype == NO) {\n \n (Array.prototype as any).removeElementAtIndex = function (this: Array<any>, index: number) {\n \n // @ts-ignore\n if (index >= 0 && index < this.length) {\n this.splice(index, 1)\n }\n \n }\n \n}\n\n\n// interface Array<T> {\n//\n// removeElementAtIndex(index: number);\n//\n// }\n\n\nif (\"removeElement\" in Array.prototype == NO) {\n \n (Array.prototype as any).removeElement = function (this: Array<any>, element: any) {\n this.removeElementAtIndex(this.indexOf(element))\n }\n \n}\n\n\n// interface Array<T> {\n//\n// removeElement(element: T);\n//\n// }\n\n\nif (\"insertElementAtIndex\" in Array.prototype == NO) {\n \n (Array.prototype as any).insertElementAtIndex = function (this: Array<any>, index: number, element: any) {\n \n if (index >= 0 && index <= this.length) {\n this.splice(index, 0, element)\n }\n \n }\n \n}\n\n\n// interface Array<T> {\n//\n// insertElementAtIndex(index: number, element: T);\n//\n// }\n\n\nif (\"replaceElementAtIndex\" in Array.prototype == NO) {\n \n (Array.prototype as any).replaceElementAtIndex = function (this: Array<any>, index: number, element: any) {\n \n this.removeElementAtIndex(index)\n this.insertElementAtIndex(index, element)\n \n }\n \n}\n\n\n// interface Array<T> {\n//\n// replaceElementAtIndex(index: number, element: T);\n//\n// }\n\n\nif (\"contains\" in Array.prototype == NO) {\n \n (Array.prototype as any).contains = function (this: Array<any>, element: any) {\n return (this.indexOf(element) != -1)\n }\n \n}\n\nif (\"containsAny\" in Array.prototype == NO) {\n \n (Array.prototype as any).containsAny = function (this: Array<any>, elements: any[]) {\n return this.anyMatch(element => elements.contains(element))\n }\n \n}\n\n\n// interface Array<T> {\n//\n// contains(element: T): boolean;\n//\n// containsAny(element: T[]): boolean;\n//\n// }\n\n\nif (\"anyMatch\" in Array.prototype == NO) {\n \n (Array.prototype as any).anyMatch = function (\n this: Array<any>,\n functionToCall: (value: any, index: number, array: any[]) => boolean\n ) {\n // @ts-ignore\n return (this.findIndex(functionToCall) > -1)\n }\n \n}\n\nif (\"noneMatch\" in Array.prototype == NO) {\n \n (Array.prototype as any).noneMatch = function (\n this: Array<any>,\n functionToCall: (value: any, index: number, array: any[]) => boolean\n ) {\n // @ts-ignore\n return (this.findIndex(functionToCall) == -1)\n }\n \n}\n\nif (\"allMatch\" in Array.prototype == NO) {\n \n (Array.prototype as any).allMatch = function (\n this: Array<any>,\n functionToCall: (value: any, index: number, array: any[]) => boolean\n ) {\n \n function reversedFunction(value: any, index: number, array: any[]) {\n return !functionToCall(value, index, array)\n }\n \n // @ts-ignore\n return (this.findIndex(reversedFunction) == -1)\n \n }\n \n}\n\nif (\"findAsyncSequential\" in Array.prototype == NO) {\n \n (Array.prototype as any).findAsyncSequential = function (\n this: Array<any>,\n functionToCall: (value: any) => Promise<boolean>\n ) {\n \n // https://stackoverflow.com/questions/55601062/using-an-async-function-in-array-find\n async function findAsyncSequential<T>(\n array: T[],\n predicate: (t: T) => Promise<boolean>\n ): Promise<T | undefined> {\n for (const t of array) {\n if (await predicate(t)) {\n return t\n }\n }\n return undefined\n }\n \n return findAsyncSequential(this, functionToCall)\n \n }\n \n}\n\n\n// interface Array<T> {\n//\n// anyMatch(predicate: (value: T, index: number, obj: T[]) => boolean): boolean\n//\n// noneMatch(predicate: (value: T, index: number, obj: T[]) => boolean): boolean\n//\n// allMatch(predicate: (value: T, index: number, obj: T[]) => boolean): boolean\n//\n// }\n\n\nif (\"groupedBy\" in Array.prototype == NO) {\n \n Array.prototype.groupedBy = function (this: Array<any>, funcProp) {\n return this.reduce(function (acc, val) {\n (acc[funcProp(val)] = acc[funcProp(val)] || []).push(val)\n return acc\n }, {})\n }\n \n}\n\nif (\"uniqueMap\" in Array.prototype == NO) {\n \n Array.prototype.uniqueMap = function (this: Array<any>, funcProp) {\n \n const result: any[] = []\n \n for (let i = 0; i < this.length; i++){\n \n const element = this[i]\n const elementResult = funcProp(element)\n \n if (!result.contains(elementResult)) {\n result.push(elementResult);\n }\n \n }\n \n return result;\n \n }\n \n}\n\n\n// interface Array<T> {\n//\n// groupedBy(keyFunction: (item: T) => any): { [key: string]: Array<T> };\n//\n// }\n\n\nif (\"firstElement\" in Array.prototype == NO) {\n Object.defineProperty(Array.prototype, \"firstElement\", {\n get: function firstElement(this: Array<any>) {\n return this[0]\n },\n set: function (this: Array<any>, element: any) {\n if (this.length == 0) {\n this.push(element)\n return\n }\n this[0] = element\n }\n })\n}\n\nif (\"lastElement\" in Array.prototype == NO) {\n Object.defineProperty(Array.prototype, \"lastElement\", {\n get: function lastElement(this: Array<any>) {\n return this[this.length - 1]\n },\n set: function (this: Array<any>, element: any) {\n if (this.length == 0) {\n this.push(element)\n return\n }\n this[this.length - 1] = element\n }\n })\n}\n\nif (\"everyElement\" in Array.prototype == NO) {\n \n Object.defineProperty(Array.prototype, \"everyElement\", {\n \n get: function everyElement(this: Array<any>) {\n \n const valueKeys: string[] = []\n \n const targetFunction = (objects: any) => {\n \n return this.map((element) => {\n \n const thisObject = UIObject.valueForKeyPath(\n valueKeys.arrayByTrimmingToLengthIfLonger(valueKeys.length - 1).join(\".\"),\n element\n ) || element\n \n const elementFunction = (UIObject.valueForKeyPath(valueKeys.join(\".\"), element) as Function)?.bind(\n thisObject,\n objects\n )\n \n return elementFunction?.()\n \n })\n \n }\n \n const result: any = new Proxy(\n targetFunction,\n {\n \n get: (target, key: string, _receiver) => {\n \n if (key == \"UI_elementValues\") {\n return this.map(element => UIObject.valueForKeyPath(\n valueKeys.join(\".\"),\n element\n ))\n }\n \n valueKeys.push(key)\n \n return result\n \n },\n set: (target, key: string, value, _receiver) => {\n \n valueKeys.push(key)\n this.forEach(element => UIObject.setValueForKeyPath(valueKeys.join(\".\"), value, element, YES))\n return true\n \n }\n \n }\n )\n \n return result\n \n },\n set: function (this: Array<any>, element: any) {\n for (let i = 0; i < this.length; ++i) {\n this[i] = element\n }\n }\n \n })\n \n}\n\n\nexport type UIEveryElementItem<T> = {\n \n [P in keyof T]: UIEveryElementItem<T[P]>\n \n} & {\n \n UI_elementValues?: T[];\n \n} & T\n\n// interface Array<T> {\n//\n// firstElement: T;\n// lastElement: T;\n//\n// everyElement: UIEveryElementItem<T>;\n//\n// }\n\n\nif (\"copy\" in Array.prototype == NO) {\n \n (Array.prototype as any).copy = function (this: Array<any>) {\n return this.slice(0)\n }\n \n}\n\n\n// interface Array<T> {\n//\n// copy(): Array<T>;\n//\n// }\n\n\nif (\"arrayByRepeating\" in Array.prototype == NO) {\n \n (Array.prototype as any).arrayByRepeating = function (this: Array<any>, numberOfRepetitions: number) {\n const result: any[] = []\n for (let i = 0; i < numberOfRepetitions; i++) {\n this.forEach(element => result.push(element))\n }\n return result\n }\n \n}\n\n\n// interface Array<T> {\n//\n// arrayByRepeating(numberOfRepetitions: number): Array<T>;\n//\n// }\n\n\nif (\"arrayByTrimmingToLengthIfLonger\" in Array.prototype == NO) {\n (Array.prototype as any).arrayByTrimmingToLengthIfLonger = function (this: Array<any>, maxLength: number) {\n const result = []\n for (let i = 0; i < maxLength && i < this.length; i++) {\n result.push(this[i])\n }\n return result\n }\n}\n\n\n// interface Array<T> {\n//\n// arrayByTrimmingToLengthIfLonger(maxLength: number): Array<T>;\n//\n// }\n\n\nif (\"summedValue\" in Array.prototype == NO) {\n \n Object.defineProperty(Array.prototype, \"summedValue\", {\n get: function summedValue(this: Array<any>) {\n return this.reduce(function (a, b) {\n return a + b\n }, 0)\n }\n })\n \n}\n\n\n// interface Array<T> {\n//\n// readonly summedValue: T;\n//\n// max(): number;\n// min(): number;\n//\n//\n// }\n\nArray.prototype.max = function () {\n return Math.max.apply(null, this)\n}\n\nArray.prototype.min = function () {\n return Math.min.apply(null, this)\n}\n\nif (!Array.prototype.average) {\n \n Array.prototype.average = function () {\n if (this.length == 0) {\n return 0;\n }\n const sum = this.reduce((a, b) => a + b, 0)\n return sum / this.length\n }\n \n}\n\n// interface Array<T> {\n//\n// isEqualToArray(array: Array<T>, keyPath?: string): boolean;\n//\n// }\n\n\nif (\"isEqualToArray\" in Array.prototype == NO) {\n \n // attach the .equals method to Array's prototype to call it on any array\n Array.prototype.isEqualToArray = function (array: any[], keyPath?: string) {\n \n // if the other array is a falsy value, return\n if (!array) {\n return false\n }\n \n // compare lengths - can save a lot of time\n if (this.length != array.length) {\n return false\n }\n \n var i = 0\n const l = this.length\n for (; i < l; i++) {\n \n // Check if we have nested arrays\n if (this[i] instanceof Array && array[i] instanceof Array && !keyPath) {\n \n // recurse into the nested arrays\n if (!this[i].isEqualToArray(array[i])) {\n return false\n }\n \n }\n else if (keyPath && UIObject.valueForKeyPath(keyPath, this[i]) != UIObject.valueForKeyPath(\n keyPath,\n array[i]\n )) {\n \n return false\n \n }\n else if (this[i] != array[i]) {\n \n // Warning - two different object instances will never be equal: {x:20} != {x:20}\n return false\n \n }\n \n }\n \n return true\n \n }\n \n // Hide method from for-in loops\n Object.defineProperty(Array.prototype, \"isEqualToArray\", { enumerable: false })\n \n}\n\n\nif (\"forEach\" in Object.prototype == NO) {\n \n (Object.prototype as any).forEach = function (\n this: Record<string, any>,\n callbackFunction: (\n value: any,\n key: string,\n stopLooping: Function\n ) => void\n ) {\n const keys = Object.keys(this)\n let shouldStopLooping = NO\n \n function stopLooping() {\n shouldStopLooping = YES\n }\n \n keys.anyMatch(key => {\n callbackFunction(this[key], key, stopLooping)\n return shouldStopLooping\n })\n }\n \n // Hide method from for-in loops\n Object.defineProperty(Object.prototype, \"forEach\", { enumerable: false })\n \n}\n\n\n// interface Object {\n//\n// forEach(callbackFunction: (value: any, key: string) => void): void;\n//\n// }\n\n\nif (\"allValues\" in Object.prototype == NO) {\n Object.defineProperty(Object.prototype, \"allValues\", {\n get: function (this: Object) {\n const values: any[] = []\n this.forEach((value: any) => {\n values.push(value)\n })\n return values\n },\n enumerable: NO\n })\n}\n\n\n// interface Object {\n//\n// readonly allValues: Array<any>;\n//\n// }\n\n\nif (\"allKeys\" in Object.prototype == NO) {\n Object.defineProperty(Object.prototype, \"allKeys\", {\n get: function (this: Object) {\n return Object.keys(this)\n },\n enumerable: NO\n })\n}\n\n\n// interface Object {\n//\n// readonly allKeys: string[];\n//\n// }\n\n\nif (\"objectByCopyingValuesRecursivelyFromObject\" in Object.prototype == NO) {\n \n (Object.prototype as any).objectByCopyingValuesRecursivelyFromObject = function (this: Object, object: any) {\n \n \n function isAnObject(item: any) {\n return (item && typeof item === \"object\" && !Array.isArray(item))\n }\n \n function mergeRecursively(target: any, source: any) {\n \n const output = Object.assign({}, target)\n \n if (isAnObject(target) && isAnObject(source)) {\n \n Object.keys(source).forEach(function (key) {\n \n if (isAnObject(source[key])) {\n \n // if (!(key in target)) {\n \n // Object.assign(output, { [key]: source[key] });\n \n // }\n // else {\n \n output[key] = mergeRecursively(target[key] ?? {}, source[key])\n \n //}\n \n }\n else {\n \n Object.assign(output, { [key]: source[key] })\n \n }\n \n })\n \n }\n \n return output\n \n }\n \n return mergeRecursively(this, object)\n \n }\n \n // Hide method from for-in loops\n Object.defineProperty(Object.prototype, \"objectByCopyingValuesRecursivelyFromObject\", { enumerable: false })\n \n}\n\n\nif (\"asValueObject\" in Object.prototype == NO) {\n \n (Object.prototype as any).asValueObject = function () {\n \n return new UICoreExtensionValueObject(this)\n \n }\n \n // Hide method from for-in loops\n Object.defineProperty(Object.prototype, \"asValueObject\", { enumerable: false })\n \n}\n\n\n// interface Object {\n//\n// objectByCopyingValuesRecursivelyFromObject<T>(object: T): this & T;\n//\n// asValueObject(): this;\n//\n// }\n\n// export type Unpacked<T> =\n// T extends (infer U)[]\n// ? U\n// : T extends (...args: any[]) => infer U\n// ? U\n// : T extends Promise<infer U>\n// ? U\n// : T\n//\n// export type UnpackedObject<T> = {\n// [P in keyof T]: Unpacked<T[P]>\n// }\n\n// export function promisedProperties<ObjectType extends Record<string, any>>(object: ObjectType): UnpackedObject<ObjectType> {\n//\n// let promisedProperties: any[] = []\n// const objectKeys = Object.keys(object)\n//\n// objectKeys.forEach((key) => promisedProperties.push(object[key]))\n//\n// // @ts-ignore\n// return Promise.all(promisedProperties)\n// .then((resolvedValues) => {\n// return resolvedValues.reduce((resolvedObject, property, index) => {\n// resolvedObject[objectKeys[index]] = property\n// return resolvedObject\n// }, object)\n// })\n//\n// }\n\n// if (\"promisedProperties\" in Object.prototype == NO) {\n//\n// (Object.prototype as any).promisedProperties = function () {\n//\n// const result = promisedProperties(this);\n//\n// return result\n//\n// }\n//\n// // Hide method from for-in loops\n// Object.defineProperty(Object.prototype, \"promisedProperties\", { enumerable: false });\n//\n// }\n//\n//\n// interface Object {\n//\n// readonly promisedProperties: UnpackedObject<this>;\n//\n// }\n\n\nif (\"contains\" in String.prototype == NO) {\n \n (String.prototype as any).contains = function (this: String, string: string) {\n return (this.indexOf(string) != -1)\n }\n \n // Hide method from for-in loops\n Object.defineProperty(Object.prototype, \"contains\", { enumerable: false })\n \n}\n\n\n// interface String {\n//\n// contains(string): boolean;\n//\n// }\n\n\nif (\"capitalizedString\" in String.prototype == NO) {\n Object.defineProperty(Object.prototype, \"capitalizedString\", {\n get: function (this: String) {\n return this.charAt(0).toUpperCase() + this.slice(1).toLowerCase()\n },\n enumerable: NO\n })\n}\n\n\n// interface String {\n//\n// readonly capitalizedString: string;\n//\n// }\n\n\nif (\"numericalValue\" in String.prototype == NO) {\n Object.defineProperty(String.prototype, \"numericalValue\", {\n get: function numericalValue(this: string) {\n return Number(this)\n }\n })\n}\n\nif (\"integerValue\" in String.prototype == NO) {\n Object.defineProperty(String.prototype, \"integerValue\", {\n get: function integerValue(this: string) {\n return Number(this).integerValue\n }\n })\n}\n\n\n// interface String {\n//\n// readonly numericalValue: number;\n//\n// }\n\n\nif (\"isAString\" in String.prototype == NO) {\n \n (String.prototype as any).isAString = YES\n \n}\n\n\n// interface String {\n//\n// isAString: boolean;\n//\n// }\n\n\nif (\"isANumber\" in Number.prototype == NO) {\n \n (Number.prototype as any).isANumber = YES\n \n}\n\n\n// interface Number {\n//\n// isANumber: boolean;\n//\n// }\n\n\nif (\"integerValue\" in Number.prototype == NO) {\n Object.defineProperty(Number.prototype, \"integerValue\", {\n get: function (this: number) {\n return parseInt(\"\" + (Math.round(this) + 0.5))\n },\n enumerable: NO\n })\n}\n\nif (\"constrainedValue\" in Number.prototype == NO) {\n \n (Number.prototype as any).constrainedValue = function (this: number, min: number, max: number) {\n if (this < min) {\n return min;\n }\n if (this > max) {\n return max;\n }\n return this\n }\n \n // Hide method from for-in loops\n Object.defineProperty(Number.prototype, \"constrainedValue\", {\n enumerable: NO\n })\n \n}\n\n\n// interface Number {\n//\n// readonly integerValue: number;\n//\n// }\n\n\nif (\"integerValue\" in Boolean.prototype == NO) {\n \n Object.defineProperty(Boolean.prototype, \"integerValue\", {\n get: function (this: boolean) {\n if (this == true) {\n return 1\n }\n return 0\n }\n })\n \n}\n\n\n// interface Boolean {\n//\n// readonly integerValue: number;\n//\n// }\n\n\nif (\"dateString\" in Date.prototype == NO) {\n \n Object.defineProperty(Date.prototype, \"dateString\", {\n get: function dateString(this: Date) {\n return (\"0\" + this.getDate()).slice(-2) + \"-\" + (\"0\" + (this.getMonth() + 1)).slice(-2) + \"-\" +\n this.getFullYear() + \" \" + (\"0\" + this.getHours()).slice(-2) + \":\" +\n (\"0\" + this.getMinutes()).slice(-2)\n }\n })\n \n \n}\n\n\n// interface Date {\n//\n// readonly dateString: string;\n//\n// }\n\n\n\n\n\n\n\n\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,wCAA2C;AAC3C,sBAAyB;AAkGzB,MAAM,MAAM;AACZ,MAAM,KAAK;AAEX,IAAI,0BAA0B,MAAM,aAAa,IAAI;AAEjD,EAAC,MAAM,UAAkB,uBAAuB,SAA4B,OAAe;AAGvF,QAAI,SAAS,KAAK,QAAQ,KAAK,QAAQ;AACnC,WAAK,OAAO,OAAO,CAAC;AAAA,IACxB;AAAA,EAEJ;AAEJ;AAUA,IAAI,mBAAmB,MAAM,aAAa,IAAI;AAE1C,EAAC,MAAM,UAAkB,gBAAgB,SAA4B,SAAc;AAC/E,SAAK,qBAAqB,KAAK,QAAQ,OAAO,CAAC;AAAA,EACnD;AAEJ;AAUA,IAAI,0BAA0B,MAA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,YAAY;AAAA,EAChB,CAAC;AACL;AAEA,IAAI,sBAAsB,OAAO,aAAa,IAAI;AAE9C,EAAC,OAAO,UAAkB,mBAAmB,SAAwB,KAAa,KAAa;AAC3F,QAAI,OAAO,KAAK;AACZ,aAAO;AAAA,IACX;AACA,QAAI,OAAO,KAAK;AACZ,aAAO;AAAA,IACX;AACA,WAAO;AAAA,EACX;AAGA,SAAO,eAAe,OAAO,WAAW,oBAAoB;AAAA,IACxD,YAAY;AAAA,EAChB,CAAC;AAEL;AAUA,IAAI,kBAAkB,QAAQ,aAAa,IAAI;AAE3C,SAAO,eAAe,QAAQ,WAAW,gBAAgB;AAAA,IACrD,KAAK,WAAyB;AAC1B,UAAI,QAAQ,MAAM;AACd,eAAO;AAAA,MACX;AACA,aAAO;AAAA,IACX;AAAA,EACJ,CAAC;AAEL;AAUA,IAAI,gBAAgB,KAAK,aAAa,IAAI;AAEtC,SAAO,eAAe,KAAK,WAAW,cAAc;AAAA,IAChD,KAAK,SAAS,aAAuB;AACjC,cAAQ,MAAM,KAAK,QAAQ,GAAG,MAAM,EAAE,IAAI,OAAO,OAAO,KAAK,SAAS,IAAI,IAAI,MAAM,EAAE,IAAI,MACtF,KAAK,YAAY,IAAI,OAAO,MAAM,KAAK,SAAS,GAAG,MAAM,EAAE,IAAI,OAC9D,MAAM,KAAK,WAAW,GAAG,MAAM,EAAE;AAAA,IAC1C;AAAA,EACJ,CAAC;AAGL;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uicore-ts",
3
- "version": "1.0.578",
3
+ "version": "1.0.580",
4
4
  "description": "UICore is a library to build native-like user interfaces using pure Typescript. No HTML is needed at all. Components are described as TS classes and all user interactions are handled explicitly. This library is strongly inspired by the UIKit framework that is used in IOS. In addition, UICore has tools to handle URL based routing, array sorting and filtering and adds a number of other utilities for convenience.",
5
5
  "main": "compiledScripts/index.js",
6
6
  "types": "compiledScripts/index.d.ts",
@@ -20,9 +20,9 @@ declare global {
20
20
 
21
21
  findAsyncSequential(functionToCall: (value: any) => Promise<boolean>): Promise<any>;
22
22
 
23
- groupedBy<T>(keyFunction: (item: T) => any): { [key: string]: Array<T> } & Object;
23
+ groupedBy(keyFunction: (item: T) => any): { [key: string]: Array<T> } & Object;
24
24
 
25
- uniqueMap<T, R>(keyFunction: (item: T) => R): R[];
25
+ uniqueMap<R>(keyFunction: (item: T) => R): R[];
26
26
 
27
27
  copy(): Array<T>;
28
28