ng2csv 6.0.0 → 8.0.0

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.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2017, 2018, 2021, 2023, 2024 Richard Russell
3
+ Copyright (c) 2017, 2018, 2021, 2023-2026 Richard Russell
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -3,32 +3,31 @@ import { Injectable, NgModule } from '@angular/core';
3
3
  import { saveAs } from 'file-saver';
4
4
 
5
5
  class OrderedProjectionCsvRowMapper {
6
+ projections;
6
7
  constructor(projections) {
7
8
  this.projections = projections;
8
9
  }
9
10
  getColumnNames() {
10
- return this.projections.map(x => x[0]);
11
+ return this.projections.map((x) => x[0]);
11
12
  }
12
13
  map(obj) {
13
- return this.projections.map(x => x[1](obj));
14
+ return this.projections.map((x) => x[1](obj));
14
15
  }
15
16
  }
16
17
 
17
18
  class AutoCsvRowMapper {
19
+ derivedCsvRowMapper;
18
20
  constructor(data) {
19
21
  if (!data || data.length === 0) {
20
- throw new Error('Parameter \'data\' must be a non-empty array of objects.');
22
+ throw new Error("Parameter 'data' must be a non-empty array of objects.");
21
23
  }
22
24
  if (typeof data[0] !== 'object') {
23
- throw new Error('Parameter \'data\' must contain objects.');
25
+ throw new Error("Parameter 'data' must contain objects.");
24
26
  }
25
27
  const projections = [];
26
28
  const allKeys = this.getAllKeys(data);
27
29
  for (const key of allKeys) {
28
- projections.push([
29
- key,
30
- this.createProjection(key)
31
- ]);
30
+ projections.push([key, this.createProjection(key)]);
32
31
  }
33
32
  this.derivedCsvRowMapper = new OrderedProjectionCsvRowMapper(projections);
34
33
  }
@@ -40,7 +39,7 @@ class AutoCsvRowMapper {
40
39
  }
41
40
  createProjection(property) {
42
41
  return (x) => {
43
- if (x.hasOwnProperty(property)) {
42
+ if (x && typeof x === 'object' && Object.hasOwn(x, property)) {
44
43
  const propertyValue = x[property];
45
44
  if (propertyValue === undefined || propertyValue === null) {
46
45
  return '';
@@ -64,23 +63,20 @@ class AutoCsvRowMapper {
64
63
  }
65
64
 
66
65
  class CsvConfiguration {
67
- constructor() {
68
- this.delimiter = ',';
69
- this.quote = '"';
70
- this.newLine = '\r\n';
71
- this.includeHeaderLine = true;
72
- this.outputValueForNull = '';
73
- this.outputValueForUndefined = '';
74
- }
66
+ delimiter = ',';
67
+ quote = '"';
68
+ newLine = '\r\n';
69
+ includeHeaderLine = true;
70
+ outputValueForNull = '';
71
+ outputValueForUndefined = '';
75
72
  }
76
73
 
77
74
  class Ng2CsvService {
78
75
  download(data, filename, csvRowMapper, config = new CsvConfiguration()) {
79
76
  const csvData = this.convertToCsv(data, csvRowMapper, config);
80
- const mimeType = 'text/csv; header='
81
- + (config.includeHeaderLine ? 'present' : 'absent');
77
+ const mimeType = 'text/csv; header=' + (config.includeHeaderLine ? 'present' : 'absent');
82
78
  const csvBlob = new Blob([csvData], { type: mimeType });
83
- saveAs(csvBlob, filename, true);
79
+ saveAs(csvBlob, filename, { autoBom: false });
84
80
  }
85
81
  convertToCsv(data, csvRowMapper, config = new CsvConfiguration()) {
86
82
  if (csvRowMapper === undefined) {
@@ -89,16 +85,18 @@ class Ng2CsvService {
89
85
  const rows = [];
90
86
  if (config.includeHeaderLine) {
91
87
  const headerFieldSeparator = `${config.quote}${config.delimiter}${config.quote}`;
92
- rows.push(config.quote
93
- + csvRowMapper.getColumnNames()
94
- .map(x => this.escapeQuotes(x, config.quote))
95
- .join(headerFieldSeparator)
96
- + config.quote);
88
+ rows.push(config.quote +
89
+ csvRowMapper
90
+ .getColumnNames()
91
+ .map((x) => this.escapeQuotes(x, config.quote))
92
+ .join(headerFieldSeparator) +
93
+ config.quote);
97
94
  }
98
95
  for (const row of data) {
99
- rows.push(csvRowMapper.map(row)
100
- .map(x => this.mapNullOrUndefinedValues(x, config))
101
- .map(x => this.escapeRowValue(x, config))
96
+ rows.push(csvRowMapper
97
+ .map(row)
98
+ .map((x) => this.mapNullOrUndefinedValues(x, config))
99
+ .map((x) => this.escapeRowValue(x, config))
102
100
  .join(config.delimiter));
103
101
  }
104
102
  return rows.join(config.newLine);
@@ -120,29 +118,29 @@ class Ng2CsvService {
120
118
  return value.replace(new RegExp(quoteChar.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'), 'g'), quoteChar + quoteChar);
121
119
  }
122
120
  escapeRowValue(value, config) {
123
- if (value.indexOf(config.delimiter) > -1
124
- || value.indexOf(config.quote) > -1) {
121
+ if (value.indexOf(config.delimiter) > -1 ||
122
+ value.indexOf(config.quote) > -1) {
125
123
  const escapedValue = this.escapeQuotes(value, config.quote);
126
124
  return `${config.quote}${escapedValue}${config.quote}`;
127
125
  }
128
126
  return value;
129
127
  }
130
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: Ng2CsvService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
131
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: Ng2CsvService, providedIn: 'root' }); }
128
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: Ng2CsvService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
129
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: Ng2CsvService, providedIn: 'root' });
132
130
  }
133
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: Ng2CsvService, decorators: [{
131
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: Ng2CsvService, decorators: [{
134
132
  type: Injectable,
135
133
  args: [{
136
- providedIn: 'root'
134
+ providedIn: 'root',
137
135
  }]
138
136
  }] });
139
137
 
140
138
  class Ng2CsvModule {
141
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: Ng2CsvModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
142
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.3", ngImport: i0, type: Ng2CsvModule }); }
143
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: Ng2CsvModule }); }
139
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: Ng2CsvModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
140
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.0.6", ngImport: i0, type: Ng2CsvModule });
141
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: Ng2CsvModule });
144
142
  }
145
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: Ng2CsvModule, decorators: [{
143
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: Ng2CsvModule, decorators: [{
146
144
  type: NgModule,
147
145
  args: [{}]
148
146
  }] });
@@ -1 +1 @@
1
- {"version":3,"file":"ng2csv.mjs","sources":["../../../projects/ng2csv/src/lib/ordered-projection-csv-row-mapper.class.ts","../../../projects/ng2csv/src/lib/auto-csv-row-mapper.class.ts","../../../projects/ng2csv/src/lib/csv-configuration.class.ts","../../../projects/ng2csv/src/lib/ng2csv.service.ts","../../../projects/ng2csv/src/lib/ng2csv.module.ts","../../../projects/ng2csv/src/public-api.ts","../../../projects/ng2csv/src/ng2csv.ts"],"sourcesContent":["import { ICsvRowMapper } from './csv-row-mapper.interface';\n\nexport class OrderedProjectionCsvRowMapper<T>\n implements ICsvRowMapper<T> {\n\n private projections: Array<[string, (obj: T) => string]>;\n\n public constructor(\n projections: Array<[string, (obj: T) => string]>) {\n this.projections = projections;\n }\n\n public getColumnNames(): string[] {\n return this.projections.map(x => x[0]);\n }\n\n public map(obj: T): string[] {\n return this.projections.map(x => x[1](obj));\n }\n}\n","import { ICsvRowMapper } from './csv-row-mapper.interface';\nimport { OrderedProjectionCsvRowMapper } from './ordered-projection-csv-row-mapper.class';\n\nexport class AutoCsvRowMapper<T> implements ICsvRowMapper<T> {\n\n private derivedCsvRowMapper: OrderedProjectionCsvRowMapper<T>;\n\n public constructor(data: T[]) {\n if (!data || data.length === 0) {\n throw new Error(\n 'Parameter \\'data\\' must be a non-empty array of objects.');\n }\n\n if (typeof data[0] !== 'object') {\n throw new Error(\n 'Parameter \\'data\\' must contain objects.'\n );\n }\n\n const projections: Array<[string, (obj: T) => string]> = [];\n\n const allKeys: string[] = this.getAllKeys(data);\n for (const key of allKeys) {\n projections.push([\n key,\n this.createProjection(key)\n ]);\n }\n\n this.derivedCsvRowMapper = new OrderedProjectionCsvRowMapper<T>(\n projections\n );\n }\n\n public getColumnNames(): string[] {\n return this.derivedCsvRowMapper.getColumnNames();\n }\n\n public map(obj: T): string[] {\n return this.derivedCsvRowMapper.map(obj);\n }\n\n private createProjection(property: string): (obj: T) => string {\n return (x: T) => {\n if (x.hasOwnProperty(property)) {\n const propertyValue = (x as any)[property];\n if (propertyValue === undefined || propertyValue === null) {\n return '';\n }\n return propertyValue.toString();\n } else {\n return '';\n }\n };\n }\n\n private getAllKeys(objs: T[]): string[] {\n const allKeys: any = {};\n\n for (const obj of objs) {\n for (const objectKey of Object.keys(obj)) {\n allKeys[objectKey] = 1;\n }\n }\n\n return Object.keys(allKeys);\n }\n}\n","export class CsvConfiguration {\n public delimiter = ',';\n public quote = '\"';\n public newLine = '\\r\\n';\n public includeHeaderLine = true;\n public outputValueForNull = '';\n public outputValueForUndefined = '';\n}\n","import { Injectable } from '@angular/core';\nimport { saveAs } from 'file-saver';\nimport { AutoCsvRowMapper } from './auto-csv-row-mapper.class';\nimport { CsvConfiguration } from './csv-configuration.class';\nimport { ICsvRowMapper } from './csv-row-mapper.interface';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class Ng2CsvService {\n public download<T>(\n data: T[],\n filename: string,\n csvRowMapper?: ICsvRowMapper<T>,\n config: CsvConfiguration = new CsvConfiguration()): void {\n const csvData: string = this.convertToCsv(data, csvRowMapper, config);\n\n const mimeType: string = 'text/csv; header='\n + (config.includeHeaderLine ? 'present' : 'absent');\n\n const csvBlob: Blob = new Blob([csvData], { type: mimeType });\n saveAs(csvBlob, filename, true);\n }\n\n public convertToCsv<T>(\n data: T[],\n csvRowMapper?: ICsvRowMapper<T>,\n config: CsvConfiguration = new CsvConfiguration()): string {\n if (csvRowMapper === undefined) {\n csvRowMapper = new AutoCsvRowMapper(data);\n }\n\n const rows: string[] = [];\n\n if (config.includeHeaderLine) {\n const headerFieldSeparator =\n `${config.quote}${config.delimiter}${config.quote}`;\n rows.push(config.quote\n + csvRowMapper.getColumnNames()\n .map(x => this.escapeQuotes(x, config.quote))\n .join(headerFieldSeparator)\n + config.quote);\n }\n\n for (const row of data) {\n rows.push(csvRowMapper.map(row)\n .map(x => this.mapNullOrUndefinedValues(x, config))\n .map(x => this.escapeRowValue(x, config))\n .join(config.delimiter));\n }\n\n return rows.join(config.newLine);\n }\n\n private mapNullOrUndefinedValues(\n value: string,\n config: CsvConfiguration): string {\n switch (value) {\n case null: {\n return config.outputValueForNull;\n }\n case undefined: {\n return config.outputValueForUndefined;\n }\n default: {\n return value;\n }\n }\n }\n\n private escapeQuotes(\n value: string,\n quoteChar: string): string {\n return value.replace(\n new RegExp(quoteChar.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'), 'g'),\n quoteChar + quoteChar);\n }\n\n private escapeRowValue(\n value: string,\n config: CsvConfiguration): string {\n if (value.indexOf(config.delimiter) > -1\n || value.indexOf(config.quote) > -1) {\n const escapedValue = this.escapeQuotes(value, config.quote);\n return `${config.quote}${escapedValue}${config.quote}`;\n }\n return value;\n }\n}\n","import { NgModule } from '@angular/core';\n\n@NgModule({})\nexport class Ng2CsvModule { }\n","/*\n * Public API Surface of ng2csv\n */\n\nexport * from './lib/ng2csv.service';\nexport * from './lib/ng2csv.module';\nexport * from './lib/auto-csv-row-mapper.class';\nexport * from './lib/csv-configuration.class';\nexport * from './lib/csv-row-mapper.interface';\nexport * from './lib/ordered-projection-csv-row-mapper.class';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MAEa,6BAA6B,CAAA;AAKxC,IAAA,WAAA,CACI,WAAgD,EAAA;AAClD,QAAA,IAAI,CAAC,WAAW,GAAG,WAAW;;IAGzB,cAAc,GAAA;AACnB,QAAA,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;;AAGjC,IAAA,GAAG,CAAC,GAAM,EAAA;AACf,QAAA,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;;AAE9C;;MChBY,gBAAgB,CAAA;AAI3B,IAAA,WAAA,CAAmB,IAAS,EAAA;QAC1B,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;AAC9B,YAAA,MAAM,IAAI,KAAK,CACb,0DAA0D,CAAC;;QAG/D,IAAI,OAAO,IAAI,CAAC,CAAC,CAAC,KAAK,QAAQ,EAAE;AAC/B,YAAA,MAAM,IAAI,KAAK,CACb,0CAA0C,CAC3C;;QAGH,MAAM,WAAW,GAAwC,EAAE;QAE3D,MAAM,OAAO,GAAa,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;AAC/C,QAAA,KAAK,MAAM,GAAG,IAAI,OAAO,EAAE;YACzB,WAAW,CAAC,IAAI,CAAC;gBACf,GAAG;AACH,gBAAA,IAAI,CAAC,gBA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,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,aAAa,cAFZ,MAAM,EAAA,CAAA,CAAA;;2FAEP,aAAa,EAAA,UAAA,EAAA,CAAA;kBAHzB,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE;AACb,iBAAA;;;MCLY,YAAY,CAAA;8GAAZ,YAAY,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;+GAAZ,YAAY,EAAA,CAAA,CAAA;+GAAZ,YAAY,EAAA,CAAA,CAAA;;2FAAZ,YAAY,EAAA,UAAA,EAAA,CAAA;kBADxB,QAAQ;mBAAC,EAAE;;;ACFZ;;AAEG;;ACFH;;AAEG;;;;"}
1
+ {"version":3,"file":"ng2csv.mjs","sources":["../../../projects/ng2csv/src/lib/ordered-projection-csv-row-mapper.class.ts","../../../projects/ng2csv/src/lib/auto-csv-row-mapper.class.ts","../../../projects/ng2csv/src/lib/csv-configuration.class.ts","../../../projects/ng2csv/src/lib/ng2csv.service.ts","../../../projects/ng2csv/src/lib/ng2csv.module.ts","../../../projects/ng2csv/src/public-api.ts","../../../projects/ng2csv/src/ng2csv.ts"],"sourcesContent":["import { ICsvRowMapper } from './csv-row-mapper.interface';\n\nexport class OrderedProjectionCsvRowMapper<T> implements ICsvRowMapper<T> {\n private readonly projections: Array<\n [string, (obj: T) => string | null | undefined]\n >;\n\n public constructor(\n projections: Array<[string, (obj: T) => string | null | undefined]>\n ) {\n this.projections = projections;\n }\n\n public getColumnNames(): string[] {\n return this.projections.map((x) => x[0]);\n }\n\n public map(obj: T): (string | null | undefined)[] {\n return this.projections.map((x) => x[1](obj));\n }\n}\n","import { ICsvRowMapper } from './csv-row-mapper.interface';\nimport { OrderedProjectionCsvRowMapper } from './ordered-projection-csv-row-mapper.class';\n\nexport class AutoCsvRowMapper<T extends object> implements ICsvRowMapper<T> {\n private derivedCsvRowMapper: OrderedProjectionCsvRowMapper<T>;\n\n public constructor(data: T[]) {\n if (!data || data.length === 0) {\n throw new Error(\"Parameter 'data' must be a non-empty array of objects.\");\n }\n\n if (typeof data[0] !== 'object') {\n throw new Error(\"Parameter 'data' must contain objects.\");\n }\n\n const projections: Array<[string, (obj: T) => string]> = [];\n\n const allKeys: string[] = this.getAllKeys(data);\n for (const key of allKeys) {\n projections.push([key, this.createProjection(key)]);\n }\n\n this.derivedCsvRowMapper = new OrderedProjectionCsvRowMapper<T>(\n projections\n );\n }\n\n public getColumnNames(): string[] {\n return this.derivedCsvRowMapper.getColumnNames();\n }\n\n public map(obj: T): (string | null | undefined)[] {\n return this.derivedCsvRowMapper.map(obj);\n }\n\n private createProjection(property: string): (obj: T) => string {\n return (x: T) => {\n if (x && typeof x === 'object' && Object.hasOwn(x, property)) {\n const propertyValue = x[property as keyof T];\n if (propertyValue === undefined || propertyValue === null) {\n return '';\n }\n return propertyValue.toString();\n } else {\n return '';\n }\n };\n }\n\n private getAllKeys(objs: T[]): string[] {\n const allKeys: any = {};\n\n for (const obj of objs) {\n for (const objectKey of Object.keys(obj)) {\n allKeys[objectKey] = 1;\n }\n }\n\n return Object.keys(allKeys);\n }\n}\n","export class CsvConfiguration {\n public delimiter = ',';\n public quote = '\"';\n public newLine = '\\r\\n';\n public includeHeaderLine = true;\n public outputValueForNull = '';\n public outputValueForUndefined = '';\n}\n","import { Injectable } from '@angular/core';\nimport { saveAs } from 'file-saver';\nimport { AutoCsvRowMapper } from './auto-csv-row-mapper.class';\nimport { CsvConfiguration } from './csv-configuration.class';\nimport { ICsvRowMapper } from './csv-row-mapper.interface';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class Ng2CsvService {\n public download<T extends object>(\n data: T[],\n filename: string,\n csvRowMapper?: ICsvRowMapper<T>,\n config: CsvConfiguration = new CsvConfiguration()\n ): void {\n const csvData: string = this.convertToCsv(data, csvRowMapper, config);\n\n const mimeType: string =\n 'text/csv; header=' + (config.includeHeaderLine ? 'present' : 'absent');\n\n const csvBlob: Blob = new Blob([csvData], { type: mimeType });\n saveAs(csvBlob, filename, { autoBom: false });\n }\n\n public convertToCsv<T extends object>(\n data: T[],\n csvRowMapper?: ICsvRowMapper<T>,\n config: CsvConfiguration = new CsvConfiguration()\n ): string {\n if (csvRowMapper === undefined) {\n csvRowMapper = new AutoCsvRowMapper(data);\n }\n\n const rows: string[] = [];\n\n if (config.includeHeaderLine) {\n const headerFieldSeparator = `${config.quote}${config.delimiter}${config.quote}`;\n rows.push(\n config.quote +\n csvRowMapper\n .getColumnNames()\n .map((x) => this.escapeQuotes(x, config.quote))\n .join(headerFieldSeparator) +\n config.quote\n );\n }\n\n for (const row of data) {\n rows.push(\n csvRowMapper\n .map(row)\n .map((x) => this.mapNullOrUndefinedValues(x, config))\n .map((x) => this.escapeRowValue(x, config))\n .join(config.delimiter)\n );\n }\n\n return rows.join(config.newLine);\n }\n\n private mapNullOrUndefinedValues(\n value: string | null | undefined,\n config: CsvConfiguration\n ): string {\n switch (value) {\n case null: {\n return config.outputValueForNull;\n }\n case undefined: {\n return config.outputValueForUndefined;\n }\n default: {\n return value;\n }\n }\n }\n\n private escapeQuotes(value: string, quoteChar: string): string {\n return value.replace(\n new RegExp(quoteChar.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'), 'g'),\n quoteChar + quoteChar\n );\n }\n\n private escapeRowValue(value: string, config: CsvConfiguration): string {\n if (\n value.indexOf(config.delimiter) > -1 ||\n value.indexOf(config.quote) > -1\n ) {\n const escapedValue = this.escapeQuotes(value, config.quote);\n return `${config.quote}${escapedValue}${config.quote}`;\n }\n return value;\n }\n}\n","import { NgModule } from '@angular/core';\n\n@NgModule({})\nexport class Ng2CsvModule { }\n","/*\n * Public API Surface of ng2csv\n */\n\nexport * from './lib/ng2csv.service';\nexport * from './lib/ng2csv.module';\nexport * from './lib/auto-csv-row-mapper.class';\nexport * from './lib/csv-configuration.class';\nexport * from './lib/csv-row-mapper.interface';\nexport * from './lib/ordered-projection-csv-row-mapper.class';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MAEa,6BAA6B,CAAA;AACvB,IAAA,WAAW;AAI5B,IAAA,WAAA,CACE,WAAmE,EAAA;AAEnE,QAAA,IAAI,CAAC,WAAW,GAAG,WAAW;IAChC;IAEO,cAAc,GAAA;AACnB,QAAA,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1C;AAEO,IAAA,GAAG,CAAC,GAAM,EAAA;AACf,QAAA,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IAC/C;AACD;;MCjBY,gBAAgB,CAAA;AACnB,IAAA,mBAAmB;AAE3B,IAAA,WAAA,CAAmB,IAAS,EAAA;QAC1B,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;AAC9B,YAAA,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC;QAC3E;QAEA,IAAI,OAAO,IAAI,CAAC,CAAC,CAAC,KAAK,QAAQ,EAAE;AAC/B,YAAA,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC;QAC3D;QAEA,MAAM,WAAW,GAAwC,EAAE;QAE3D,MAAM,OAAO,GAAa,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;AAC/C,QAAA,KAAK,MAAM,GAAG,IAAI,OAAO,EAAE;AACzB,YAAA,WAAW,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC;QACrD;QAEA,IAAI,CAAC,mBAAmB,GAAG,IAAI,6BAA6B,CAC1D,WAAW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,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,aAAa,cAFZ,MAAM,EAAA,CAAA;;2FAEP,aAAa,EAAA,UAAA,EAAA,CAAA;kBAHzB,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;MCLY,YAAY,CAAA;uGAAZ,YAAY,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;wGAAZ,YAAY,EAAA,CAAA;wGAAZ,YAAY,EAAA,CAAA;;2FAAZ,YAAY,EAAA,UAAA,EAAA,CAAA;kBADxB,QAAQ;mBAAC,EAAE;;;ACFZ;;AAEG;;ACFH;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "ng2csv",
3
- "version": "6.0.0",
3
+ "version": "8.0.0",
4
+ "description": "An Angular library for exporting data to CSV.",
4
5
  "dependencies": {
5
6
  "tslib": "^2.0.0"
6
7
  },
7
8
  "peerDependencies": {
8
- "@angular/core": "^19.0.0",
9
+ "@angular/core": "^21.0.0",
9
10
  "file-saver": "^2.0.0"
10
11
  },
11
12
  "repository": {
@@ -24,13 +25,13 @@
24
25
  },
25
26
  "homepage": "https://github.com/rars/ng2csv#readme",
26
27
  "module": "fesm2022/ng2csv.mjs",
27
- "typings": "index.d.ts",
28
+ "typings": "types/ng2csv.d.ts",
28
29
  "exports": {
29
30
  "./package.json": {
30
31
  "default": "./package.json"
31
32
  },
32
33
  ".": {
33
- "types": "./index.d.ts",
34
+ "types": "./types/ng2csv.d.ts",
34
35
  "default": "./fesm2022/ng2csv.mjs"
35
36
  }
36
37
  },
@@ -0,0 +1,50 @@
1
+ import * as i0 from '@angular/core';
2
+
3
+ declare class CsvConfiguration {
4
+ delimiter: string;
5
+ quote: string;
6
+ newLine: string;
7
+ includeHeaderLine: boolean;
8
+ outputValueForNull: string;
9
+ outputValueForUndefined: string;
10
+ }
11
+
12
+ interface ICsvRowMapper<T> {
13
+ getColumnNames(): string[];
14
+ map(obj: T): (string | null | undefined)[];
15
+ }
16
+
17
+ declare class Ng2CsvService {
18
+ download<T extends object>(data: T[], filename: string, csvRowMapper?: ICsvRowMapper<T>, config?: CsvConfiguration): void;
19
+ convertToCsv<T extends object>(data: T[], csvRowMapper?: ICsvRowMapper<T>, config?: CsvConfiguration): string;
20
+ private mapNullOrUndefinedValues;
21
+ private escapeQuotes;
22
+ private escapeRowValue;
23
+ static ɵfac: i0.ɵɵFactoryDeclaration<Ng2CsvService, never>;
24
+ static ɵprov: i0.ɵɵInjectableDeclaration<Ng2CsvService>;
25
+ }
26
+
27
+ declare class Ng2CsvModule {
28
+ static ɵfac: i0.ɵɵFactoryDeclaration<Ng2CsvModule, never>;
29
+ static ɵmod: i0.ɵɵNgModuleDeclaration<Ng2CsvModule, never, never, never>;
30
+ static ɵinj: i0.ɵɵInjectorDeclaration<Ng2CsvModule>;
31
+ }
32
+
33
+ declare class AutoCsvRowMapper<T extends object> implements ICsvRowMapper<T> {
34
+ private derivedCsvRowMapper;
35
+ constructor(data: T[]);
36
+ getColumnNames(): string[];
37
+ map(obj: T): (string | null | undefined)[];
38
+ private createProjection;
39
+ private getAllKeys;
40
+ }
41
+
42
+ declare class OrderedProjectionCsvRowMapper<T> implements ICsvRowMapper<T> {
43
+ private readonly projections;
44
+ constructor(projections: Array<[string, (obj: T) => string | null | undefined]>);
45
+ getColumnNames(): string[];
46
+ map(obj: T): (string | null | undefined)[];
47
+ }
48
+
49
+ export { AutoCsvRowMapper, CsvConfiguration, Ng2CsvModule, Ng2CsvService, OrderedProjectionCsvRowMapper };
50
+ export type { ICsvRowMapper };
package/index.d.ts DELETED
@@ -1,5 +0,0 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- /// <amd-module name="ng2csv" />
5
- export * from './public-api';
@@ -1,9 +0,0 @@
1
- import { ICsvRowMapper } from './csv-row-mapper.interface';
2
- export declare class AutoCsvRowMapper<T> implements ICsvRowMapper<T> {
3
- private derivedCsvRowMapper;
4
- constructor(data: T[]);
5
- getColumnNames(): string[];
6
- map(obj: T): string[];
7
- private createProjection;
8
- private getAllKeys;
9
- }
@@ -1,8 +0,0 @@
1
- export declare class CsvConfiguration {
2
- delimiter: string;
3
- quote: string;
4
- newLine: string;
5
- includeHeaderLine: boolean;
6
- outputValueForNull: string;
7
- outputValueForUndefined: string;
8
- }
@@ -1,4 +0,0 @@
1
- export interface ICsvRowMapper<T> {
2
- getColumnNames(): string[];
3
- map(obj: T): string[];
4
- }
@@ -1,6 +0,0 @@
1
- import * as i0 from "@angular/core";
2
- export declare class Ng2CsvModule {
3
- static ɵfac: i0.ɵɵFactoryDeclaration<Ng2CsvModule, never>;
4
- static ɵmod: i0.ɵɵNgModuleDeclaration<Ng2CsvModule, never, never, never>;
5
- static ɵinj: i0.ɵɵInjectorDeclaration<Ng2CsvModule>;
6
- }
@@ -1,12 +0,0 @@
1
- import { CsvConfiguration } from './csv-configuration.class';
2
- import { ICsvRowMapper } from './csv-row-mapper.interface';
3
- import * as i0 from "@angular/core";
4
- export declare class Ng2CsvService {
5
- download<T>(data: T[], filename: string, csvRowMapper?: ICsvRowMapper<T>, config?: CsvConfiguration): void;
6
- convertToCsv<T>(data: T[], csvRowMapper?: ICsvRowMapper<T>, config?: CsvConfiguration): string;
7
- private mapNullOrUndefinedValues;
8
- private escapeQuotes;
9
- private escapeRowValue;
10
- static ɵfac: i0.ɵɵFactoryDeclaration<Ng2CsvService, never>;
11
- static ɵprov: i0.ɵɵInjectableDeclaration<Ng2CsvService>;
12
- }
@@ -1,7 +0,0 @@
1
- import { ICsvRowMapper } from './csv-row-mapper.interface';
2
- export declare class OrderedProjectionCsvRowMapper<T> implements ICsvRowMapper<T> {
3
- private projections;
4
- constructor(projections: Array<[string, (obj: T) => string]>);
5
- getColumnNames(): string[];
6
- map(obj: T): string[];
7
- }
package/public-api.d.ts DELETED
@@ -1,6 +0,0 @@
1
- export * from './lib/ng2csv.service';
2
- export * from './lib/ng2csv.module';
3
- export * from './lib/auto-csv-row-mapper.class';
4
- export * from './lib/csv-configuration.class';
5
- export * from './lib/csv-row-mapper.interface';
6
- export * from './lib/ordered-projection-csv-row-mapper.class';