@clipboard-health/util-ts 5.10.0 → 5.11.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.
- package/package.json +1 -1
- package/src/index.d.ts +1 -0
- package/src/index.js +1 -0
- package/src/index.js.map +1 -1
- package/src/lib/objects/index.d.ts +1 -0
- package/src/lib/objects/index.js +5 -0
- package/src/lib/objects/index.js.map +1 -0
- package/src/lib/objects/isRecord.d.ts +8 -0
- package/src/lib/objects/isRecord.js +14 -0
- package/src/lib/objects/isRecord.js.map +1 -0
package/package.json
CHANGED
package/src/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export * from "./lib/forceCast";
|
|
|
5
5
|
export * from "./lib/functional";
|
|
6
6
|
export type * from "./lib/logger";
|
|
7
7
|
export * from "./lib/nullish";
|
|
8
|
+
export * from "./lib/objects";
|
|
8
9
|
export * from "./lib/strings";
|
|
9
10
|
export * from "./lib/strings/parseJson";
|
|
10
11
|
export type * from "./lib/types";
|
package/src/index.js
CHANGED
|
@@ -7,6 +7,7 @@ tslib_1.__exportStar(require("./lib/errors"), exports);
|
|
|
7
7
|
tslib_1.__exportStar(require("./lib/forceCast"), exports);
|
|
8
8
|
tslib_1.__exportStar(require("./lib/functional"), exports);
|
|
9
9
|
tslib_1.__exportStar(require("./lib/nullish"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./lib/objects"), exports);
|
|
10
11
|
tslib_1.__exportStar(require("./lib/strings"), exports);
|
|
11
12
|
tslib_1.__exportStar(require("./lib/strings/parseJson"), exports);
|
|
12
13
|
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/util-ts/src/index.ts"],"names":[],"mappings":";;;AAAA,uDAA6B;AAC7B,2DAAiC;AACjC,uDAA6B;AAC7B,0DAAgC;AAChC,2DAAiC;AAEjC,wDAA8B;AAC9B,wDAA8B;AAC9B,kEAAwC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/util-ts/src/index.ts"],"names":[],"mappings":";;;AAAA,uDAA6B;AAC7B,2DAAiC;AACjC,uDAA6B;AAC7B,0DAAgC;AAChC,2DAAiC;AAEjC,wDAA8B;AAC9B,wDAA8B;AAC9B,wDAA8B;AAC9B,kEAAwC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./isRecord";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/util-ts/src/lib/objects/index.ts"],"names":[],"mappings":";;;AAAA,qDAA2B"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type guard that checks if a value is a non-null, non-array object (e.g. `{}`, `Date`, `Map`,
|
|
3
|
+
* a class instance) — narrowed to `Record<string, unknown>` for keyed property access.
|
|
4
|
+
*
|
|
5
|
+
* @param value - The value to check
|
|
6
|
+
* @returns True if the value is a record, false otherwise
|
|
7
|
+
*/
|
|
8
|
+
export declare function isRecord(value: unknown): value is Record<string, unknown>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isRecord = isRecord;
|
|
4
|
+
/**
|
|
5
|
+
* Type guard that checks if a value is a non-null, non-array object (e.g. `{}`, `Date`, `Map`,
|
|
6
|
+
* a class instance) — narrowed to `Record<string, unknown>` for keyed property access.
|
|
7
|
+
*
|
|
8
|
+
* @param value - The value to check
|
|
9
|
+
* @returns True if the value is a record, false otherwise
|
|
10
|
+
*/
|
|
11
|
+
function isRecord(value) {
|
|
12
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=isRecord.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isRecord.js","sourceRoot":"","sources":["../../../../../../packages/util-ts/src/lib/objects/isRecord.ts"],"names":[],"mappings":";;;AAAA;;;;;;GAMG;AACH,kBAAyB,KAAc;IACrC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC"}
|