@candlerip/shared3 0.0.49 → 0.0.50

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@candlerip/shared3",
3
- "version": "0.0.49",
3
+ "version": "0.0.50",
4
4
  "type": "module",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -0,0 +1 @@
1
+ export * from './type-guards/index.js';
@@ -0,0 +1 @@
1
+ export * from './type-guards/index.js';
@@ -0,0 +1 @@
1
+ export * from './is-array/index.js';
@@ -0,0 +1 @@
1
+ export * from './is-array/index.js';
@@ -0,0 +1 @@
1
+ export declare const isArray: <T>(data?: unknown, typeGuard?: (data?: unknown) => data is T) => data is T[];
@@ -0,0 +1,9 @@
1
+ export const isArray = (data, typeGuard) => {
2
+ if (!Array.isArray(data)) {
3
+ return false;
4
+ }
5
+ if (typeGuard && !data.every((a) => typeGuard(a))) {
6
+ return false;
7
+ }
8
+ return true;
9
+ };
@@ -1,3 +1,5 @@
1
- export * from './type-map/domains/index.js';
1
+ export * from './array/index.js';
2
+ export * from './string/index.js';
3
+ export * from './type/index.js';
2
4
  export * from './type-guards/index.js';
3
5
  export * from './type-map/index.js';
package/src/type/index.js CHANGED
@@ -1,3 +1,5 @@
1
- export * from './type-map/domains/index.js';
1
+ export * from './array/index.js';
2
+ export * from './string/index.js';
3
+ export * from './type/index.js';
2
4
  export * from './type-guards/index.js';
3
5
  export * from './type-map/index.js';