@candlerip/shared3 0.0.23 → 0.0.25
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +1 -1
- package/src/environment/environment-variables/domains/index.d.ts +1 -1
- package/src/index.d.ts +1 -0
- package/src/index.js +1 -0
- package/src/project/project-config/domains/cache-service-project-config/index.d.ts +1 -1
- package/src/project/project-config/domains/logger-service-project-config/index.d.ts +2 -0
- package/src/project/project-config/domains/project-config-map/index.d.ts +2 -1
- package/src/project/project-config-name/configs/index.d.ts +1 -1
- package/src/project/project-config-name/configs/index.js +1 -1
- package/src/type/index.d.ts +1 -0
- package/src/type/index.js +1 -0
- package/src/type/type-guards/index.d.ts +8 -0
- package/src/type/type-guards/index.js +8 -0
- package/src/type/type-guards/is-array/index.d.ts +1 -0
- package/src/type/type-guards/is-array/index.js +9 -0
- package/src/type/type-guards/is-boolean/index.d.ts +1 -0
- package/src/type/type-guards/is-boolean/index.js +1 -0
- package/src/type/type-guards/is-null/index.d.ts +1 -0
- package/src/type/type-guards/is-null/index.js +1 -0
- package/src/type/type-guards/is-number/index.d.ts +1 -0
- package/src/type/type-guards/is-number/index.js +1 -0
- package/src/type/type-guards/is-object/index.d.ts +3 -0
- package/src/type/type-guards/is-object/index.js +3 -0
- package/src/type/type-guards/is-object/object/index.d.ts +1 -0
- package/src/type/type-guards/is-object/object/index.js +11 -0
- package/src/type/type-guards/is-object/properties-in-object/index.d.ts +1 -0
- package/src/type/type-guards/is-object/properties-in-object/index.js +8 -0
- package/src/type/type-guards/is-object/property-in-object/index.d.ts +1 -0
- package/src/type/type-guards/is-object/property-in-object/index.js +13 -0
- package/src/type/type-guards/is-string/index.d.ts +1 -0
- package/src/type/type-guards/is-string/index.js +1 -0
- package/src/type/type-guards/is-type/index.d.ts +1 -0
- package/src/type/type-guards/is-type/index.js +6 -0
- package/src/type/type-guards/is-undefined/index.d.ts +1 -0
- package/src/type/type-guards/is-undefined/index.js +1 -0
- package/src/project/project-config/domains/logger-project-config/index.d.ts +0 -2
- /package/src/project/project-config/domains/{logger-project-config → logger-service-project-config}/index.js +0 -0
package/package.json
CHANGED
@@ -3,10 +3,10 @@ export interface EnvironmentVariables {
|
|
3
3
|
REDIS_PORT: number;
|
4
4
|
REDIS_PWD: string;
|
5
5
|
CACHE_SERVICE_PORT: number;
|
6
|
-
CACHE_URL: string;
|
7
6
|
DATABASE_URL: string;
|
8
7
|
DICTIONARY_SERVICE_PORT: number;
|
9
8
|
DOMAIN_NAME: string;
|
10
9
|
FRONTEND_URL: string;
|
10
|
+
REDIS_URL: string;
|
11
11
|
S3_IMAGES_BUCKET_NAME: string;
|
12
12
|
}
|
package/src/index.d.ts
CHANGED
package/src/index.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
import { EnvironmentVariables } from '../../../../environment/index.js';
|
2
|
-
export type CacheServiceProjectConfig = Pick<EnvironmentVariables, 'CACHE_SERVICE_PORT' | 'DATABASE_URL' | 'REDIS_PWD' | '
|
2
|
+
export type CacheServiceProjectConfig = Pick<EnvironmentVariables, 'CACHE_SERVICE_PORT' | 'DATABASE_URL' | 'REDIS_PWD' | 'REDIS_URL'>;
|
@@ -4,6 +4,7 @@ import { CacheServiceProjectConfig } from '../cache-service-project-config/index
|
|
4
4
|
import { DictionaryServiceProjectConfig } from '../dictionary-service-poject-config/index.js';
|
5
5
|
import { ImagesInitProjectConfig } from '../images-init-project-config/index.js';
|
6
6
|
import { ImagesProjectConfig } from '../images-project-config/index.js';
|
7
|
+
import { LoggerServiceProjectConfig } from '../logger-service-project-config/index.js';
|
7
8
|
import { RedisProjectConfig } from '../redis-project-config/index.js';
|
8
9
|
export type ProjectConfigMap = {
|
9
10
|
'backend-project-config': BackendProjectConfig;
|
@@ -12,6 +13,6 @@ export type ProjectConfigMap = {
|
|
12
13
|
'dictionary-service-project-config': DictionaryServiceProjectConfig;
|
13
14
|
'images-project-config': ImagesProjectConfig;
|
14
15
|
'images-init-project-config': ImagesInitProjectConfig;
|
15
|
-
'logger-project-config':
|
16
|
+
'logger-service-project-config': LoggerServiceProjectConfig;
|
16
17
|
'redis-project-config': RedisProjectConfig;
|
17
18
|
};
|
@@ -1 +1 @@
|
|
1
|
-
export declare const PROJECT_CONFIG_NAMES: readonly ["backend-init-project-config", "backend-project-config", "cache-service-project-config", "dictionary-service-project-config", "images-project-config", "images-init-project-config", "logger-project-config", "redis-project-config"];
|
1
|
+
export declare const PROJECT_CONFIG_NAMES: readonly ["backend-init-project-config", "backend-project-config", "cache-service-project-config", "dictionary-service-project-config", "images-project-config", "images-init-project-config", "logger-service-project-config", "redis-project-config"];
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './type-guards/index.js';
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './type-guards/index.js';
|
@@ -0,0 +1,8 @@
|
|
1
|
+
export * from './is-array/index.js';
|
2
|
+
export * from './is-boolean/index.js';
|
3
|
+
export * from './is-null/index.js';
|
4
|
+
export * from './is-number/index.js';
|
5
|
+
export * from './is-object/index.js';
|
6
|
+
export * from './is-string/index.js';
|
7
|
+
export * from './is-type/index.js';
|
8
|
+
export * from './is-undefined/index.js';
|
@@ -0,0 +1,8 @@
|
|
1
|
+
export * from './is-array/index.js';
|
2
|
+
export * from './is-boolean/index.js';
|
3
|
+
export * from './is-null/index.js';
|
4
|
+
export * from './is-number/index.js';
|
5
|
+
export * from './is-object/index.js';
|
6
|
+
export * from './is-string/index.js';
|
7
|
+
export * from './is-type/index.js';
|
8
|
+
export * from './is-undefined/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 @@
|
|
1
|
+
export declare const isBoolean: (data?: unknown) => data is boolean;
|
@@ -0,0 +1 @@
|
|
1
|
+
export const isBoolean = (data) => typeof data === 'boolean';
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const isNull: (data?: unknown) => data is null;
|
@@ -0,0 +1 @@
|
|
1
|
+
export const isNull = (data) => data === null;
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const isNumber: (data?: unknown) => data is number;
|
@@ -0,0 +1 @@
|
|
1
|
+
export const isNumber = (data) => typeof data === 'number';
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const isObject: (data?: unknown) => data is Record<string, unknown>;
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { isArray } from '../../is-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
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const isString: (data?: unknown) => data is string;
|
@@ -0,0 +1 @@
|
|
1
|
+
export const isString = (data) => typeof data === 'string';
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const isType: <T>(data: unknown, valid: readonly T[]) => data is T;
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const isUndefined: (data?: unknown) => data is undefined;
|
@@ -0,0 +1 @@
|
|
1
|
+
export const isUndefined = (data) => data === undefined;
|
File without changes
|