foxts 5.6.0 → 5.8.0

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.
@@ -0,0 +1,3 @@
1
+ declare function isObjectEmpty(obj: Record<string, unknown>): boolean;
2
+
3
+ export { isObjectEmpty };
@@ -0,0 +1 @@
1
+ "use strict";exports.isObjectEmpty=function(t){for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r))return!1;return!0};
@@ -0,0 +1 @@
1
+ function t(t){for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r))return!1;return!0}export{t as isObjectEmpty};
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Ponyfill for the TC39 "Property Counting" proposal.
3
+ *
4
+ * @see https://github.com/tc39/proposal-object-property-count
5
+ */
6
+ /**
7
+ * Counts own, enumerable, string-keyed properties (including array indices).
8
+ *
9
+ * Equivalent to `Object.keys(target).length`, but without allocating the
10
+ * intermediate array.
11
+ */
12
+ declare function keysLength(target: object): number;
13
+ /**
14
+ * Counts own, string-keyed properties (including array indices), both
15
+ * enumerable and non-enumerable.
16
+ *
17
+ * There is no allocation-free reflection primitive for this, so it delegates to
18
+ * `Object.getOwnPropertyNames(target).length`.
19
+ */
20
+ declare function getOwnPropertyNamesLength(target: object): number;
21
+ /**
22
+ * Counts own, symbol-keyed properties, regardless of enumerability.
23
+ *
24
+ * There is no allocation-free reflection primitive for this, so it delegates to
25
+ * `Object.getOwnPropertySymbols(target).length`.
26
+ */
27
+ declare function getOwnPropertySymbolsLength(target: object): number;
28
+
29
+ export { getOwnPropertyNamesLength, getOwnPropertySymbolsLength, keysLength };
@@ -0,0 +1,5 @@
1
+ "use strict";/**
2
+ * Ponyfill for the TC39 "Property Counting" proposal.
3
+ *
4
+ * @see https://github.com/tc39/proposal-object-property-count
5
+ */exports.getOwnPropertyNamesLength=function(t){return Object.getOwnPropertyNames(t).length},exports.getOwnPropertySymbolsLength=function(t){return Object.getOwnPropertySymbols(t).length},exports.keysLength=function(t){let e=0;for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&e++;return e};
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Ponyfill for the TC39 "Property Counting" proposal.
3
+ *
4
+ * @see https://github.com/tc39/proposal-object-property-count
5
+ */function t(t){let e=0;for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&e++;return e}function e(t){return Object.getOwnPropertyNames(t).length}function n(t){return Object.getOwnPropertySymbols(t).length}export{e as getOwnPropertyNamesLength,n as getOwnPropertySymbolsLength,t as keysLength};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foxts",
3
- "version": "5.6.0",
3
+ "version": "5.8.0",
4
4
  "description": "Opinionated collection of common TypeScript utils by @SukkaW",
5
5
  "repository": {
6
6
  "url": "https://github.com/SukkaW/foxts"
@@ -208,6 +208,12 @@
208
208
  "require": "./dist/is-network-error/index.js",
209
209
  "default": "./dist/is-network-error/index.js"
210
210
  },
211
+ "./is-object-empty": {
212
+ "types": "./dist/is-object-empty/index.d.ts",
213
+ "import": "./dist/is-object-empty/index.mjs",
214
+ "require": "./dist/is-object-empty/index.js",
215
+ "default": "./dist/is-object-empty/index.js"
216
+ },
211
217
  "./is-probably-ip": {
212
218
  "types": "./dist/is-probably-ip/index.d.ts",
213
219
  "import": "./dist/is-probably-ip/index.mjs",
@@ -262,6 +268,12 @@
262
268
  "require": "./dist/pick-random/index.js",
263
269
  "default": "./dist/pick-random/index.js"
264
270
  },
271
+ "./property-count": {
272
+ "types": "./dist/property-count/index.d.ts",
273
+ "import": "./dist/property-count/index.mjs",
274
+ "require": "./dist/property-count/index.js",
275
+ "default": "./dist/property-count/index.js"
276
+ },
265
277
  "./random-int": {
266
278
  "types": "./dist/random-int/index.d.ts",
267
279
  "import": "./dist/random-int/index.mjs",
@@ -353,7 +365,7 @@
353
365
  "@swc-node/register": "^1.11.1",
354
366
  "@swc/core": "^1.15.43",
355
367
  "@types/mocha": "^10.0.10",
356
- "@types/node": "^22.20.0",
368
+ "@types/node": "^22.20.1",
357
369
  "@types/sinon": "^21.0.1",
358
370
  "bumpp": "^10.4.1",
359
371
  "earl": "^2.0.0",