@punks/backend-core 0.0.14 → 0.0.16

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.
@@ -0,0 +1,9 @@
1
+ export declare const csvParseRaw: (rows: string[], separator: string) => string[][];
2
+ export interface CsvColumnDefinition<T> {
3
+ name: string;
4
+ value: (item: T) => any;
5
+ }
6
+ export type CsvBuildOptions = {
7
+ delimiter?: string;
8
+ };
9
+ export declare const csvBuild: <T>(data: T[], columns: CsvColumnDefinition<T>[], options?: CsvBuildOptions) => string;
@@ -1,4 +1,5 @@
1
1
  export * from "./array";
2
+ export { CsvColumnDefinition as ColumnDefinition, CsvBuildOptions, csvBuild, csvParseRaw, } from "./csv";
2
3
  export { getDirectoryFilePaths } from "./files";
3
4
  export { joinPath, splitPath, ensureDirectory, getDirectoryPath } from "./paths";
4
5
  export * from "./strings";
@@ -6,3 +7,4 @@ export * from "./objects";
6
7
  export * from "./text";
7
8
  export * from "./threading";
8
9
  export * from "./uid";
10
+ export { ExcelSheetDefinition, ExcelKeyTransform, ExcelColumnDefinition as ExcelRowBuilder, ExcelParseOptions, excelBuild, excelParse, } from "./xls";
@@ -1,3 +1,4 @@
1
1
  export declare const removeUndefinedProps: <T extends Record<string, any>>(obj: T, options?: {
2
2
  recursive?: boolean;
3
3
  }) => T;
4
+ export declare const isNullOrUndefined: (value: any) => boolean;
@@ -0,0 +1,24 @@
1
+ export interface ExcelColumnDefinition<T> {
2
+ value: (row: T) => any;
3
+ header: string;
4
+ headerSize?: number;
5
+ }
6
+ export type ExcelSheetDefinition<T> = {
7
+ sheetName: string;
8
+ data: T[];
9
+ columns: ExcelColumnDefinition<T>[];
10
+ };
11
+ export declare const excelBuild: <T>(...sheets: ExcelSheetDefinition<T>[]) => ArrayBuffer;
12
+ export declare const parseExcelRaw: (file: string | ArrayBuffer) => {
13
+ name: string;
14
+ data: any[][];
15
+ }[];
16
+ export declare enum ExcelKeyTransform {
17
+ Lower = "lower",
18
+ Upper = "upper"
19
+ }
20
+ export type ExcelParseOptions = {
21
+ keysTransform?: ExcelKeyTransform;
22
+ sheetIndex?: number;
23
+ };
24
+ export declare const excelParse: (file: string | ArrayBuffer, options?: ExcelParseOptions) => any[];