@takeshape/util 8.68.3 → 8.69.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/es/types.js +5 -7
- package/lib/types.d.ts +3 -4
- package/lib/types.d.ts.map +1 -1
- package/lib/types.js +5 -9
- package/package.json +2 -2
package/es/types.js
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import isNull from 'lodash/isNull';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
2
|
+
import isPlainObject from 'lodash/isPlainObject';
|
|
3
|
+
|
|
5
4
|
/**
|
|
6
|
-
* A
|
|
7
|
-
*
|
|
5
|
+
* A guard for objects that ensures they are plain objects, and thus, can
|
|
6
|
+
* reasonably be typed as a Record.
|
|
8
7
|
*/
|
|
9
|
-
|
|
10
8
|
export function isRecord(maybeRecord) {
|
|
11
|
-
return
|
|
9
|
+
return isPlainObject(maybeRecord);
|
|
12
10
|
}
|
|
13
11
|
|
|
14
12
|
/**
|
package/lib/types.d.ts
CHANGED
|
@@ -2,12 +2,11 @@ import type { Primitive } from 'type-fest';
|
|
|
2
2
|
export declare type StringProps<Obj> = {
|
|
3
3
|
[K in keyof Required<Obj>]: Obj[K] extends string ? K : never;
|
|
4
4
|
}[keyof Obj];
|
|
5
|
-
export declare function isObject(obj: unknown): obj is Record<string, unknown>;
|
|
6
5
|
/**
|
|
7
|
-
* A
|
|
8
|
-
*
|
|
6
|
+
* A guard for objects that ensures they are plain objects, and thus, can
|
|
7
|
+
* reasonably be typed as a Record.
|
|
9
8
|
*/
|
|
10
|
-
export declare function isRecord
|
|
9
|
+
export declare function isRecord(maybeRecord: unknown): maybeRecord is Record<string, unknown>;
|
|
11
10
|
export declare type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
12
11
|
export declare type Maybe<T> = T | undefined;
|
|
13
12
|
/**
|
package/lib/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,WAAW,CAAC;AAIzC,oBAAY,WAAW,CAAC,GAAG,IAAI;KAAE,CAAC,IAAI,MAAM,QAAQ,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,SAAS,MAAM,GAAG,CAAC,GAAG,KAAK;CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;AAE1G;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,WAAW,EAAE,OAAO,GAAG,WAAW,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAErF;AAED,oBAAY,SAAS,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAG/E,oBAAY,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC;AAErC;;;GAGG;AACH,oBAAY,SAAS,CAAC,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AAErE;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,MAAM,EAAE,KAAK,SAAS,MAAM,EAAE,YAAY,EAAE;KAAE,GAAG,IAAI,CAAC,GAAG,KAAK;CAAC,eACtF,MAAM,mCAC1B;AAED,wBAAgB,WAAW,CAAC,cAAc,EAAE,OAAO,GAAG,cAAc,IAAI,SAAS,CAUhF;AAED,oBAAY,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;AAExD,wBAAgB,QAAQ,CAAC,WAAW,EAAE,OAAO,GAAG,WAAW,IAAI,MAAM,CAOpE"}
|
package/lib/types.js
CHANGED
|
@@ -4,26 +4,22 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.createEnumMatcher = createEnumMatcher;
|
|
7
|
-
exports.isObject = isObject;
|
|
8
7
|
exports.isPrimitive = isPrimitive;
|
|
9
8
|
exports.isRecord = isRecord;
|
|
10
9
|
exports.isScalar = isScalar;
|
|
11
10
|
|
|
12
11
|
var _isNull = _interopRequireDefault(require("lodash/isNull"));
|
|
13
12
|
|
|
13
|
+
var _isPlainObject = _interopRequireDefault(require("lodash/isPlainObject"));
|
|
14
|
+
|
|
14
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
16
|
|
|
16
|
-
function isObject(obj) {
|
|
17
|
-
return obj !== null && typeof obj === 'object';
|
|
18
|
-
}
|
|
19
17
|
/**
|
|
20
|
-
* A
|
|
21
|
-
*
|
|
18
|
+
* A guard for objects that ensures they are plain objects, and thus, can
|
|
19
|
+
* reasonably be typed as a Record.
|
|
22
20
|
*/
|
|
23
|
-
|
|
24
|
-
|
|
25
21
|
function isRecord(maybeRecord) {
|
|
26
|
-
return
|
|
22
|
+
return (0, _isPlainObject.default)(maybeRecord);
|
|
27
23
|
}
|
|
28
24
|
|
|
29
25
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@takeshape/util",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.69.0",
|
|
4
4
|
"description": "Shared utilities",
|
|
5
5
|
"homepage": "https://www.takeshape.io",
|
|
6
6
|
"repository": {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"es"
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@takeshape/routing": "8.
|
|
24
|
+
"@takeshape/routing": "8.69.0",
|
|
25
25
|
"@types/url-parse": "^1.4.4",
|
|
26
26
|
"aws-sdk": "^2.802.0",
|
|
27
27
|
"classnames": "^2.2.5",
|