@punks/backend-core 0.0.79 → 0.0.81

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.
@@ -8,6 +8,7 @@ type LoggerOptions = {
8
8
  level: LogLevel;
9
9
  loggerName?: string;
10
10
  serialization: MetaSerializationType;
11
+ maxMetaLength?: number;
11
12
  };
12
13
  export declare class Log {
13
14
  private static readonly container;
@@ -5,7 +5,7 @@ export { CsvColumnDefinition, CsvBuildOptions, csvBuild, csvParse } from "./csv"
5
5
  export { getDirectoryFilePaths } from "./files";
6
6
  export { joinPath, splitPath, ensureDirectory, getDirectoryPath, createDayPath, } from "./paths";
7
7
  export * from "./strings";
8
- export * from "./objects";
8
+ export { buildObject, isNullOrUndefined, jsonSerialize, mergeDeep, removeUndefinedProps, replaceUndefinedWithNull, } from "./objects";
9
9
  export * from "./encoding";
10
10
  export { stripTags } from "./html";
11
11
  export { maskVariable } from "./variables";
@@ -1,3 +1,4 @@
1
+ import { ReplaceUndefinedWithNull } from "./types";
1
2
  export declare const removeUndefinedProps: <T extends Record<string, any>>(obj: T, options?: {
2
3
  recursive?: boolean;
3
4
  }) => T;
@@ -14,3 +15,4 @@ export declare const jsonSerialize: (obj: any, options?: {
14
15
  maxStringsLength?: number;
15
16
  prettify?: boolean;
16
17
  }) => string;
18
+ export declare function replaceUndefinedWithNull<T>(obj: T): ReplaceUndefinedWithNull<T>;
@@ -0,0 +1,3 @@
1
+ export type ReplaceUndefinedWithNull<T> = T extends undefined ? null : T extends (infer U)[] ? ReplaceUndefinedWithNull<U>[] : T extends object ? {
2
+ [K in keyof T]: ReplaceUndefinedWithNull<T[K]>;
3
+ } : T;
@@ -8,3 +8,4 @@ export declare const toTitleCase: (str: string) => string;
8
8
  export declare const ensureTailingSlash: (value: string) => string;
9
9
  export declare const ensureStartSlash: (value: string) => string;
10
10
  export declare const multipleSplit: (str: string, separators: string[]) => string[];
11
+ export declare const truncateString: (str: string, maxLength: number, filler?: string) => string;
package/dist/index.d.ts CHANGED
@@ -75,6 +75,7 @@ type LoggerOptions = {
75
75
  level: LogLevel;
76
76
  loggerName?: string;
77
77
  serialization: MetaSerializationType;
78
+ maxMetaLength?: number;
78
79
  };
79
80
  declare class Log {
80
81
  private static readonly container;
@@ -233,6 +234,11 @@ declare const toTitleCase: (str: string) => string;
233
234
  declare const ensureTailingSlash: (value: string) => string;
234
235
  declare const ensureStartSlash: (value: string) => string;
235
236
  declare const multipleSplit: (str: string, separators: string[]) => string[];
237
+ declare const truncateString: (str: string, maxLength: number, filler?: string) => string;
238
+
239
+ type ReplaceUndefinedWithNull<T> = T extends undefined ? null : T extends (infer U)[] ? ReplaceUndefinedWithNull<U>[] : T extends object ? {
240
+ [K in keyof T]: ReplaceUndefinedWithNull<T[K]>;
241
+ } : T;
236
242
 
237
243
  declare const removeUndefinedProps: <T extends Record<string, any>>(obj: T, options?: {
238
244
  recursive?: boolean;
@@ -250,6 +256,7 @@ declare const jsonSerialize: (obj: any, options?: {
250
256
  maxStringsLength?: number;
251
257
  prettify?: boolean;
252
258
  }) => string;
259
+ declare function replaceUndefinedWithNull<T>(obj: T): ReplaceUndefinedWithNull<T>;
253
260
 
254
261
  declare const encodeUtf8: (value: Uint8Array) => string;
255
262
  declare const decodeUtf8: (value: string) => Buffer;
@@ -329,4 +336,4 @@ type ExcelParseOptions = {
329
336
  };
330
337
  declare const excelParse: (file: string | ArrayBuffer, options?: ExcelParseOptions) => any;
331
338
 
332
- export { AppServiceReference, ConsoleLogger, CsvBuildOptions, CsvColumnDefinition, DatadogLogger, Dict, ExcelColumnDefinition, ExcelKeyTransform, ExcelParseOptions, ExcelSheetDefinition, FileLogger, ILogger, ILoggerProvider, IResolveServiceOptions, IServiceLocator, ITree, ITreeNode, LocalizedField, Log, LogLevel, MetaSerializationType, Optional, RichText, TimeUnit, TreeNodeBuilder, addTime, buildObject, buildTree, buildUrl, byField, byFieldDesc, camelToKebabCase, camelToSnakeCase, createDayPath, csvBuild, csvParse, decodeBase64, decodeUtf8, deserializeQueryString, distinct, distinctElements, encodeBase64, encodeUtf8, ensureDirectory, ensureStartSlash, ensureTailingSlash, excelBuild, excelParse, first, flatten, floorDateToSecond, generateHash, getDirectoryFilePaths, getDirectoryPath, getQueryParameter, groupBy, indexes, isNullOrUndefined, iterate, joinPath, joinUrl, jsonDistinct, jsonSerialize, last, logMemoryUsage, mapAsync, mapOrThrow, maskVariable, mergeDeep, multipleSplit, newUuid, notNull, notUndefined, pluralize, processArrayDifferences, processArrayItemMove, range, removeUndefinedProps, selectMany, serializeQueryString, sleep, sort, splitPath, stripTags, subArrays, subtractTime, testInternetConnection, toArrayDict, toCamelCase, toDict, toItemsDict, toItemsMap, toMap, toTitleCase, trim, trimEnd, trimStart, updateQueryParameters };
339
+ export { AppServiceReference, ConsoleLogger, CsvBuildOptions, CsvColumnDefinition, DatadogLogger, Dict, ExcelColumnDefinition, ExcelKeyTransform, ExcelParseOptions, ExcelSheetDefinition, FileLogger, ILogger, ILoggerProvider, IResolveServiceOptions, IServiceLocator, ITree, ITreeNode, LocalizedField, Log, LogLevel, MetaSerializationType, Optional, RichText, TimeUnit, TreeNodeBuilder, addTime, buildObject, buildTree, buildUrl, byField, byFieldDesc, camelToKebabCase, camelToSnakeCase, createDayPath, csvBuild, csvParse, decodeBase64, decodeUtf8, deserializeQueryString, distinct, distinctElements, encodeBase64, encodeUtf8, ensureDirectory, ensureStartSlash, ensureTailingSlash, excelBuild, excelParse, first, flatten, floorDateToSecond, generateHash, getDirectoryFilePaths, getDirectoryPath, getQueryParameter, groupBy, indexes, isNullOrUndefined, iterate, joinPath, joinUrl, jsonDistinct, jsonSerialize, last, logMemoryUsage, mapAsync, mapOrThrow, maskVariable, mergeDeep, multipleSplit, newUuid, notNull, notUndefined, pluralize, processArrayDifferences, processArrayItemMove, range, removeUndefinedProps, replaceUndefinedWithNull, selectMany, serializeQueryString, sleep, sort, splitPath, stripTags, subArrays, subtractTime, testInternetConnection, toArrayDict, toCamelCase, toDict, toItemsDict, toItemsMap, toMap, toTitleCase, trim, trimEnd, trimStart, truncateString, updateQueryParameters };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@punks/backend-core",
3
- "version": "0.0.79",
3
+ "version": "0.0.81",
4
4
  "description": "WebPunks Backend Core",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",