1
0
Fork 0

Added Statistics calculation

Statistics now show calculated values
This commit is contained in:
Techognito 2025-09-04 17:30:00 +02:00
parent fe87374e47
commit fc0f69dacb
2147 changed files with 141321 additions and 39 deletions

View file

@ -0,0 +1,5 @@
/**
* Fast shallow compare for objects.
* @returns true if objects are equal.
*/
export declare function fastObjectShallowCompare<T extends Record<string, any> | null>(a: T, b: T): boolean;

View file

@ -0,0 +1,39 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.fastObjectShallowCompare = fastObjectShallowCompare;
const is = Object.is;
/**
* Fast shallow compare for objects.
* @returns true if objects are equal.
*/
function fastObjectShallowCompare(a, b) {
if (a === b) {
return true;
}
if (!(a instanceof Object) || !(b instanceof Object)) {
return false;
}
let aLength = 0;
let bLength = 0;
/* eslint-disable guard-for-in */
for (const key in a) {
aLength += 1;
if (!is(a[key], b[key])) {
return false;
}
if (!(key in b)) {
return false;
}
}
/* eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-unused-vars */
for (const _ in b) {
bLength += 1;
}
return aLength === bLength;
}

View file

@ -0,0 +1 @@
export { fastObjectShallowCompare } from "./fastObjectShallowCompare.js";

View file

@ -0,0 +1,12 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "fastObjectShallowCompare", {
enumerable: true,
get: function () {
return _fastObjectShallowCompare.fastObjectShallowCompare;
}
});
var _fastObjectShallowCompare = require("./fastObjectShallowCompare");