@candlerip/shared 0.0.22 → 0.0.23

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.
Files changed (32) hide show
  1. package/package.json +1 -1
  2. package/src/environment/environment-variable-name/domains.d.ts +2 -2
  3. package/src/environment/environment-variables/domains.d.ts +1 -1
  4. package/src/index.d.ts +1 -0
  5. package/src/index.js +1 -0
  6. package/src/service/index.d.ts +1 -1
  7. package/src/service/index.js +1 -1
  8. package/src/service/service-environment-variable-names/constants.d.ts +2 -0
  9. package/src/service/{service-environment-variables → service-environment-variable-names}/constants.js +1 -1
  10. package/src/service/{service-environment-variables → service-environment-variable-names}/type.d.ts +1 -1
  11. package/src/type/array/index.d.ts +1 -0
  12. package/src/type/array/index.js +1 -0
  13. package/src/type/array/type-guards.d.ts +1 -0
  14. package/src/type/array/type-guards.js +9 -0
  15. package/src/type/index.d.ts +4 -0
  16. package/src/type/index.js +4 -0
  17. package/src/type/null/index.d.ts +1 -0
  18. package/src/type/null/index.js +1 -0
  19. package/src/type/null/type-guards.d.ts +1 -0
  20. package/src/type/null/type-guards.js +1 -0
  21. package/src/type/object/index.d.ts +1 -0
  22. package/src/type/object/index.js +1 -0
  23. package/src/type/object/type-guards.d.ts +1 -0
  24. package/src/type/object/type-guards.js +11 -0
  25. package/src/type/string/index.d.ts +1 -0
  26. package/src/type/string/index.js +1 -0
  27. package/src/type/string/type-guards.d.ts +1 -0
  28. package/src/type/string/type-guards.js +1 -0
  29. package/src/service/service-environment-variables/constants.d.ts +0 -2
  30. /package/src/service/{service-environment-variables → service-environment-variable-names}/index.d.ts +0 -0
  31. /package/src/service/{service-environment-variables → service-environment-variable-names}/index.js +0 -0
  32. /package/src/service/{service-environment-variables → service-environment-variable-names}/type.js +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@candlerip/shared",
3
- "version": "0.0.22",
3
+ "version": "0.0.23",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": "=22.19.0"
@@ -1,2 +1,2 @@
1
- import { Envs } from '../environment-variables/index.js';
2
- export type EnvironmentVariableName = keyof Envs;
1
+ import { EnvironmentVariables } from '../environment-variables/index.js';
2
+ export type EnvironmentVariableName = keyof EnvironmentVariables;
@@ -1,5 +1,5 @@
1
1
  import { EnvironmentMode } from '../environment-mode/index.js';
2
- export type Envs = {
2
+ export type EnvironmentVariables = {
3
3
  APP_NAME: string;
4
4
  APP_PORT: number;
5
5
  AWS_REGION: string;
package/src/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from './environment/index.js';
2
2
  export * from './service/index.js';
3
+ export * from './type/index.js';
package/src/index.js CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from './environment/index.js';
2
2
  export * from './service/index.js';
3
+ export * from './type/index.js';
@@ -1,2 +1,2 @@
1
- export * from './service-environment-variables/index.js';
1
+ export * from './service-environment-variable-names/index.js';
2
2
  export * from './service-name/index.js';
@@ -1,2 +1,2 @@
1
- export * from './service-environment-variables/index.js';
1
+ export * from './service-environment-variable-names/index.js';
2
2
  export * from './service-name/index.js';
@@ -0,0 +1,2 @@
1
+ import { ServiceEnvironmentVariableNames } from './type.js';
2
+ export declare const SERVICE_ENVIRONMENT_VARIABLE_NAMES: ServiceEnvironmentVariableNames;
@@ -1,4 +1,4 @@
1
- export const SERVICE_ENVIRONMENT_VARIABLES = {
1
+ export const SERVICE_ENVIRONMENT_VARIABLE_NAMES = {
2
2
  'environment-service': ['APP_NAME'],
3
3
  'cache-service': ['APP_NAME', 'MOBILE_APP_URL'],
4
4
  nginx: ['APP_PORT', 'EC2_IP_ADDRESS', 'SSL_PRIVATE_KEY'],
@@ -1,5 +1,5 @@
1
1
  import { EnvironmentVariableName } from 'src/environment';
2
2
  import { ServiceName } from '../service-name/index.js';
3
- export type ServiceEnvironmentVariables = {
3
+ export type ServiceEnvironmentVariableNames = {
4
4
  [key in ServiceName]: EnvironmentVariableName[];
5
5
  };
@@ -0,0 +1 @@
1
+ export * from './type-guards.js';
@@ -0,0 +1 @@
1
+ export * from './type-guards.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
+ };
@@ -0,0 +1,4 @@
1
+ export * from './array/index.js';
2
+ export * from './null/index.js';
3
+ export * from './object/index.js';
4
+ export * from './string/index.js';
@@ -0,0 +1,4 @@
1
+ export * from './array/index.js';
2
+ export * from './null/index.js';
3
+ export * from './object/index.js';
4
+ export * from './string/index.js';
@@ -0,0 +1 @@
1
+ export * from './type-guards.js';
@@ -0,0 +1 @@
1
+ export * from './type-guards.js';
@@ -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 * from './type-guards.js';
@@ -0,0 +1 @@
1
+ export * from './type-guards.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 '../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 * from './type-guards.js';
@@ -0,0 +1 @@
1
+ export * from './type-guards.js';
@@ -0,0 +1 @@
1
+ export declare const isString: (data?: unknown) => data is string;
@@ -0,0 +1 @@
1
+ export const isString = (data) => typeof data === 'string';
@@ -1,2 +0,0 @@
1
- import { ServiceEnvironmentVariables } from './type.js';
2
- export declare const SERVICE_ENVIRONMENT_VARIABLES: ServiceEnvironmentVariables;