Icard/angular-clarity-master(work.../node_modules/primeng/fesm2022/primeng-utils.mjs.map

1 line
22 KiB
Plaintext
Raw Normal View History

2024-07-16 15:23:22 +00:00
{"version":3,"file":"primeng-utils.mjs","sources":["../../src/app/components/utils/objectutils.ts","../../src/app/components/utils/uniquecomponentid.ts","../../src/app/components/utils/zindexutils.ts","../../src/app/components/utils/primeng-utils.ts"],"sourcesContent":["export class ObjectUtils {\n public static isArray(value, empty = true) {\n return Array.isArray(value) && (empty || value.length !== 0);\n }\n\n public static isObject(value, empty = true) {\n return typeof value === 'object' && !Array.isArray(value) && value != null && (empty || Object.keys(value).length !== 0);\n }\n\n public static equals(obj1: any, obj2: any, field?: string): boolean {\n if (field) return this.resolveFieldData(obj1, field) === this.resolveFieldData(obj2, field);\n else return this.equalsByValue(obj1, obj2);\n }\n\n public static equalsByValue(obj1: any, obj2: any): boolean {\n if (obj1 === obj2) return true;\n\n if (obj1 && obj2 && typeof obj1 == 'object' && typeof obj2 == 'object') {\n var arrA = Array.isArray(obj1),\n arrB = Array.isArray(obj2),\n i,\n length,\n key;\n\n if (arrA && arrB) {\n length = obj1.length;\n if (length != obj2.length) return false;\n for (i = length; i-- !== 0; ) if (!this.equalsByValue(obj1[i], obj2[i])) return false;\n return true;\n }\n\n if (arrA != arrB) return false;\n\n var dateA = this.isDate(obj1),\n dateB = this.isDate(obj2);\n if (dateA != dateB) return false;\n if (dateA && dateB) return obj1.getTime() == obj2.getTime();\n\n var regexpA = obj1 instanceof RegExp,\n regexpB = obj2 instanceof RegExp;\n if (regexpA != regexpB) return false;\n if (regexpA && regexpB) return obj1.toString() == obj2.toString();\n\n var keys = Object.keys(obj1);\n length = keys.length;\n\n if (length !== Object.keys(obj2).length) return false;\n\n for (i = length; i-- !== 0; ) if (!Object.prototype.hasOwnProperty.call(obj2, keys[i])) return false;\n\n for (i = length; i-- !== 0; ) {\n key = keys[i];\n if (!this.equalsByValue(obj1[key], obj2[key])) return false;\n }\n\n return true;\n }\n\n return obj1 !== obj1 && obj2 !== obj2;\n }\n\n public static resolveFieldData(data: any, field: any): any {\n if (data && field) {\n if (this.isFunction(field)) {\n return field(data);\n } else if (field.indexOf('.') == -1) {\n return data[field];\n } else {\n let fields: string[] = field.split('.');\n let value = data;\n for (let i = 0, len = fields.length; i < len; ++i) {\n if (value == null) {\n return null;\n }\n value = value[fields[i]];\n }\n return value;\n }\n } else {\n return null;\n }\n }\n\n public static isFunction(obj: any) {\n return !!(obj && obj.constructor && obj.call && obj.apply);\n }\n\n public static reorderArray(value: any[], from: number, to: number) {\n let target: number;\n if (value && from !== to) {\n if (to >= value.length) {\n to %= value.length;\n from %= value.length;\n }\n value.splice(to, 0, value.splice(from, 1)[0]);\n }\n }\n\n public static insertIntoOrderedArray(item: any, index: number, arr: any[], sourceArr: any[]): void {\n if (arr.length > 0) {\n let injected = false;\n for (let i = 0; i < arr.length; i++) {\n let currentItemIndex = this.findIndexInList(arr[i], sourceArr);\n if (currentItemIndex > index) {\n arr