@naturalcycles/nodejs-lib 13.7.0 → 13.7.2

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.
@@ -108,7 +108,7 @@ function objectToShellExport(obj, prefix = '') {
108
108
  return '';
109
109
  return (Object.entries(obj)
110
110
  .map(([k, v]) => {
111
- if (v) {
111
+ if (v !== undefined && v !== null) {
112
112
  return `export ${prefix}${k}="${v}"`;
113
113
  }
114
114
  })
@@ -137,7 +137,7 @@ function objectToGithubActionsEnv(obj, prefix = '') {
137
137
  return '';
138
138
  return (Object.entries(obj)
139
139
  .map(([k, v]) => {
140
- if (v) {
140
+ if (v !== undefined && v !== null) {
141
141
  return `${prefix}${k}=${v}`;
142
142
  }
143
143
  })
@@ -1,5 +1,5 @@
1
1
  /// <reference types="node" />
2
- import { BaseDBEntity, NumberEnum, SavedDBEntity, StringEnum } from '@naturalcycles/js-lib';
2
+ import { BaseDBEntity, NumberEnum, StringEnum } from '@naturalcycles/js-lib';
3
3
  import { AlternativesSchema, AnySchema, ArraySchema, ObjectSchema } from 'joi';
4
4
  import { NumberSchema } from './number.extensions';
5
5
  import { StringSchema } from './string.extensions';
@@ -92,4 +92,3 @@ export declare const userAgentSchema: StringSchema<string>;
92
92
  export declare const utcOffsetSchema: NumberSchema<number>;
93
93
  export declare const ipAddressSchema: StringSchema<string>;
94
94
  export declare const baseDBEntitySchema: ObjectSchema<BaseDBEntity>;
95
- export declare const savedDBEntitySchema: ObjectSchema<SavedDBEntity>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.savedDBEntitySchema = exports.baseDBEntitySchema = exports.ipAddressSchema = exports.utcOffsetSchema = exports.userAgentSchema = exports.semVerSchema = exports.SEM_VER_REGEX = exports.emailSchema = exports.verSchema = exports.unixTimestampMillis2000Schema = exports.unixTimestampMillisSchema = exports.unixTimestamp2000Schema = exports.unixTimestampSchema = exports.slugSchema = exports.SLUG_REGEX = exports.idBase64UrlSchema = exports.idBase64Schema = exports.idBase62Schema = exports.idSchema = exports.jwtSchema = exports.JWT_REGEX = exports.base64UrlSchema = exports.base64Schema = exports.base62Schema = exports.BASE64URL_REGEX = exports.BASE64_REGEX = exports.BASE62_REGEX = exports.anyObjectSchema = exports.anySchema = exports.oneOfSchema = exports.objectSchema = exports.arraySchema = exports.urlSchema = exports.numberEnumKeySchema = exports.numberEnumValueSchema = exports.stringEnumKeySchema = exports.stringEnumValueSchema = exports.dateObjectSchema = exports.binarySchema = exports.dateStringSchema = exports.percentageSchema = exports.integerSchema = exports.numberSchemaTyped = exports.numberSchema = exports.stringSchemaTyped = exports.stringSchema = exports.booleanDefaultToFalseSchema = exports.booleanSchema = void 0;
3
+ exports.baseDBEntitySchema = exports.ipAddressSchema = exports.utcOffsetSchema = exports.userAgentSchema = exports.semVerSchema = exports.SEM_VER_REGEX = exports.emailSchema = exports.verSchema = exports.unixTimestampMillis2000Schema = exports.unixTimestampMillisSchema = exports.unixTimestamp2000Schema = exports.unixTimestampSchema = exports.slugSchema = exports.SLUG_REGEX = exports.idBase64UrlSchema = exports.idBase64Schema = exports.idBase62Schema = exports.idSchema = exports.jwtSchema = exports.JWT_REGEX = exports.base64UrlSchema = exports.base64Schema = exports.base62Schema = exports.BASE64URL_REGEX = exports.BASE64_REGEX = exports.BASE62_REGEX = exports.anyObjectSchema = exports.anySchema = exports.oneOfSchema = exports.objectSchema = exports.arraySchema = exports.urlSchema = exports.numberEnumKeySchema = exports.numberEnumValueSchema = exports.stringEnumKeySchema = exports.stringEnumValueSchema = exports.dateObjectSchema = exports.binarySchema = exports.dateStringSchema = exports.percentageSchema = exports.integerSchema = exports.numberSchemaTyped = exports.numberSchema = exports.stringSchemaTyped = exports.stringSchema = exports.booleanDefaultToFalseSchema = exports.booleanSchema = void 0;
4
4
  const js_lib_1 = require("@naturalcycles/js-lib");
5
5
  const joi_extensions_1 = require("./joi.extensions");
6
6
  exports.booleanSchema = joi_extensions_1.Joi.boolean();
@@ -126,8 +126,3 @@ exports.baseDBEntitySchema = objectSchema({
126
126
  created: exports.unixTimestamp2000Schema.optional(),
127
127
  updated: exports.unixTimestamp2000Schema.optional(),
128
128
  });
129
- exports.savedDBEntitySchema = objectSchema({
130
- id: exports.stringSchema,
131
- created: exports.unixTimestamp2000Schema,
132
- updated: exports.unixTimestamp2000Schema,
133
- });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naturalcycles/nodejs-lib",
3
- "version": "13.7.0",
3
+ "version": "13.7.2",
4
4
  "scripts": {
5
5
  "prepare": "husky install",
6
6
  "docs-serve": "vuepress dev docs",
@@ -148,7 +148,7 @@ export function objectToShellExport(obj: AnyObject, prefix = ''): string {
148
148
  return (
149
149
  Object.entries(obj)
150
150
  .map(([k, v]) => {
151
- if (v) {
151
+ if (v !== undefined && v !== null) {
152
152
  return `export ${prefix}${k}="${v}"`
153
153
  }
154
154
  })
@@ -179,7 +179,7 @@ export function objectToGithubActionsEnv(obj: AnyObject, prefix = ''): string {
179
179
  return (
180
180
  Object.entries(obj)
181
181
  .map(([k, v]) => {
182
- if (v) {
182
+ if (v !== undefined && v !== null) {
183
183
  return `${prefix}${k}=${v}`
184
184
  }
185
185
  })
@@ -5,7 +5,6 @@ import {
5
5
  _stringEnumValues,
6
6
  BaseDBEntity,
7
7
  NumberEnum,
8
- SavedDBEntity,
9
8
  StringEnum,
10
9
  } from '@naturalcycles/js-lib'
11
10
  import { AlternativesSchema, AnySchema, ArraySchema, ObjectSchema } from 'joi'
@@ -159,9 +158,3 @@ export const baseDBEntitySchema: ObjectSchema<BaseDBEntity> = objectSchema<BaseD
159
158
  created: unixTimestamp2000Schema.optional(),
160
159
  updated: unixTimestamp2000Schema.optional(),
161
160
  })
162
-
163
- export const savedDBEntitySchema = objectSchema<SavedDBEntity>({
164
- id: stringSchema,
165
- created: unixTimestamp2000Schema,
166
- updated: unixTimestamp2000Schema,
167
- })