@candlerip/shared3 0.0.98 → 0.0.100

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.98",
3
+ "version": "0.0.100",
4
4
  "type": "module",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -1,11 +1,13 @@
1
1
  import { Auth } from '../../auth/index.js';
2
2
  import { CookieConsent } from '../../cookie/index.js';
3
3
  import { Dictionary, Language } from '../../dictionary/index.js';
4
+ import { CandleFilterSort } from '../../filter-sort/index.js';
4
5
  import { CandlesPageData } from '../../page/index.js';
5
6
  export interface CandlesPageServerSideProps {
6
7
  auth: Auth;
7
8
  cookieConsent?: CookieConsent;
8
9
  dictionary: Dictionary;
10
+ filterSort: CandleFilterSort;
9
11
  language: Language;
10
12
  pageData: CandlesPageData;
11
13
  }
@@ -3,3 +3,4 @@ export * from './object/index.js';
3
3
  export * from './string/index.js';
4
4
  export * from './type/index.js';
5
5
  export * from './undefined/index.js';
6
+ export * from './is-null/index.js';
package/src/type/index.js CHANGED
@@ -3,3 +3,4 @@ export * from './object/index.js';
3
3
  export * from './string/index.js';
4
4
  export * from './type/index.js';
5
5
  export * from './undefined/index.js';
6
+ export * from './is-null/index.js';
@@ -0,0 +1 @@
1
+ export declare const isNull: (data?: unknown) => data is null;
@@ -0,0 +1 @@
1
+ export const isNull = (data) => data === null;
@@ -1 +1,2 @@
1
1
  export * from './add-prefix-to-object-props/util.js';
2
+ export * from './is-object/index.js';
@@ -1 +1,2 @@
1
1
  export * from './add-prefix-to-object-props/util.js';
2
+ export * from './is-object/index.js';
@@ -0,0 +1,3 @@
1
+ export * from './object/index.js';
2
+ export * from './properties-in-object/index.js';
3
+ export * from './property-in-object/index.js';
@@ -0,0 +1,3 @@
1
+ export * from './object/index.js';
2
+ export * from './properties-in-object/index.js';
3
+ export * from './property-in-object/index.js';
@@ -0,0 +1 @@
1
+ export declare const isObject: (data?: unknown) => data is Record<string, unknown>;
@@ -0,0 +1,11 @@
1
+ import { isArray } from '../../../array/index.js';
2
+ import { isNull } from '../../../is-null/index.js';
3
+ export const isObject = (data) => {
4
+ if (typeof data !== 'object') {
5
+ return false;
6
+ }
7
+ if (isNull(data)) {
8
+ return false;
9
+ }
10
+ return !isArray(data);
11
+ };
@@ -0,0 +1 @@
1
+ export declare const isPropertiesInObject: <X extends string, T>(props: X[], data?: unknown, typeGuard?: (data?: unknown) => data is T) => data is { [key in X]: T; };
@@ -0,0 +1,8 @@
1
+ import { isObject } from '../object/index.js';
2
+ import { isPropertyInObject } from '../property-in-object/index.js';
3
+ export const isPropertiesInObject = (props, data, typeGuard) => {
4
+ if (!isObject(data)) {
5
+ return false;
6
+ }
7
+ return props.every((a) => isPropertyInObject(a, data, typeGuard));
8
+ };
@@ -0,0 +1 @@
1
+ export declare const isPropertyInObject: <X extends string, T>(prop: X, data?: unknown, typeGuard?: (data?: unknown) => data is T) => data is Record<X, T>;
@@ -0,0 +1,13 @@
1
+ import { isObject } from '../object/index.js';
2
+ export const isPropertyInObject = (prop, data, typeGuard) => {
3
+ if (!isObject(data)) {
4
+ return false;
5
+ }
6
+ if (!(prop in data)) {
7
+ return false;
8
+ }
9
+ if (typeGuard && !typeGuard(data[prop])) {
10
+ return false;
11
+ }
12
+ return true;
13
+ };