@tstdl/base 0.90.75 → 0.90.77

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tstdl/base",
3
- "version": "0.90.75",
3
+ "version": "0.90.77",
4
4
  "author": "Patrick Hein",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -124,7 +124,6 @@
124
124
  "@types/node": "20",
125
125
  "@types/nodemailer": "6.4",
126
126
  "concurrently": "8.2",
127
- "esbuild": "0.20",
128
127
  "eslint": "8.57",
129
128
  "eslint-import-resolver-typescript": "3.6",
130
129
  "eslint-plugin-import": "2.29",
@@ -132,7 +131,7 @@
132
131
  "typedoc": "0.25",
133
132
  "typedoc-plugin-missing-exports": "2.2",
134
133
  "typescript": "5.4",
135
- "typescript-eslint": "7.8"
134
+ "typescript-eslint": "7.9"
136
135
  },
137
136
  "peerDependencies": {
138
137
  "@elastic/elasticsearch": "^8.13",
@@ -149,10 +148,10 @@
149
148
  "mjml": "^4.15",
150
149
  "mongodb": "^6.6",
151
150
  "nodemailer": "^6.9",
152
- "playwright": "^1.43",
153
- "preact": "^10.21",
151
+ "playwright": "^1.44",
152
+ "preact": "^10.22",
154
153
  "preact-render-to-string": "^6.4",
155
- "undici": "^6.15",
154
+ "undici": "^6.16",
156
155
  "urlpattern-polyfill": "^10.0"
157
156
  },
158
157
  "peerDependenciesMeta": {
@@ -1,8 +1,7 @@
1
1
  import { Subject, concatAll, exhaustAll, isObservable, mergeAll, of, switchAll, takeUntil } from 'rxjs';
2
2
  import { registerFinalization } from '../../memory/finalization.js';
3
3
  import { isPromise } from '../../utils/type-guards.js';
4
- import { computed, toSignal, untracked } from '../api.js';
5
- import { effect } from '../implementation/effect.js';
4
+ import { computed, effect, toSignal, untracked } from '../api.js';
6
5
  const operatorMap = {
7
6
  merge: mergeAll,
8
7
  concat: concatAll,
package/utils/equals.d.ts CHANGED
@@ -19,6 +19,7 @@ export type EqualsOptions = {
19
19
  arrayDeep?: boolean;
20
20
  sortArray?: boolean;
21
21
  coerceStrings?: boolean;
22
+ checkPrototype?: boolean;
22
23
  };
23
24
  export declare function equals(a: any, b: any, options?: EqualsOptions): boolean;
24
25
  export declare function equals(a: any, b: any, options?: EqualsOptions, __internal?: any): boolean;
package/utils/equals.js CHANGED
@@ -3,6 +3,7 @@ import { toArray } from './array/array.js';
3
3
  import { toUint8Array } from './binary.js';
4
4
  import { compareByValue } from './comparison.js';
5
5
  import { sort } from './iterable-helpers/sort.js';
6
+ import { objectKeys } from './object/object.js';
6
7
  import { isDefined, isNotNull, isNull } from './type-guards.js';
7
8
  const equalsSymbol = Symbol('equals');
8
9
  // eslint-disable-next-line @typescript-eslint/no-redeclare, @typescript-eslint/naming-convention
@@ -56,9 +57,10 @@ export function equals(a, b, options = {}, visitedNodes = new Set()) {
56
57
  }
57
58
  visitedNodes.add(a);
58
59
  const aPrototype = Object.getPrototypeOf(a);
59
- const bPrototype = Object.getPrototypeOf(b);
60
- if (aPrototype !== bPrototype) {
61
- return false;
60
+ if (options.checkPrototype != false) {
61
+ if (aPrototype !== Object.getPrototypeOf(b)) {
62
+ return false;
63
+ }
62
64
  }
63
65
  if (Array.isArray(a)) {
64
66
  return (options.arrayDeep != false && (options.deep == true || options.arrayDeep == true))
@@ -71,7 +73,7 @@ export function equals(a, b, options = {}, visitedNodes = new Set()) {
71
73
  if (Equals.symbol in b) {
72
74
  return b[Equals.symbol](a);
73
75
  }
74
- if ((aPrototype != Object.prototype) && isNotNull(aPrototype)) { // Checking a is enough, because b must have equal prototype (checked above)
76
+ if ((options.checkPrototype != false) && (aPrototype != Object.prototype) && isNotNull(aPrototype)) { // Checking a is enough, because b must have equal prototype (checked above)
75
77
  throw new Error('Equals only supports literal objects, arrays, primitives and Equals interface implementations.');
76
78
  }
77
79
  if (options.deep == false) {
@@ -85,8 +87,8 @@ export function equals(a, b, options = {}, visitedNodes = new Set()) {
85
87
  }
86
88
  // eslint-disable-next-line max-statements, max-lines-per-function
87
89
  function objectEquals(a, b, options, visitedNodes) {
88
- const aProperties = Object.getOwnPropertyNames(a);
89
- const bProperties = Object.getOwnPropertyNames(b);
90
+ const aProperties = objectKeys(a);
91
+ const bProperties = objectKeys(b);
90
92
  if (!arrayEquals(aProperties, bProperties, { sort: compareByValue })) {
91
93
  return false;
92
94
  }