@bytebrand/export-cars 1.21.16 → 1.21.17
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.
|
@@ -7,12 +7,15 @@ class SantanderCSVBuilder extends cronicle_helper_1.XMLBuilderBase {
|
|
|
7
7
|
}
|
|
8
8
|
async addItem(car) {
|
|
9
9
|
let values = Object.values(car).map(value => {
|
|
10
|
-
if (typeof value === 'string'
|
|
11
|
-
|
|
10
|
+
if (typeof value === 'string') {
|
|
11
|
+
if (value.includes(','))
|
|
12
|
+
return `"${value.replace(/"/g, '""')}"`;
|
|
13
|
+
if (value.includes(';'))
|
|
14
|
+
return `"${value}"`;
|
|
12
15
|
}
|
|
13
16
|
return value;
|
|
14
17
|
});
|
|
15
|
-
await this.write(values.join('
|
|
18
|
+
await this.write(values.join(';') + '\n');
|
|
16
19
|
}
|
|
17
20
|
async buildEnd() {
|
|
18
21
|
await this.end();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"santander-csv.builder.js","sourceRoot":"","sources":["../../src/formats/santander-csv.builder.ts"],"names":[],"mappings":";;;AAAA,gEAA4D;AAE5D,MAAa,mBAAoB,SAAQ,gCAAc;IACtD,KAAK,CAAC,UAAU;IAChB,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,GAAY;QACzB,IAAI,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;YAC3C,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC
|
|
1
|
+
{"version":3,"file":"santander-csv.builder.js","sourceRoot":"","sources":["../../src/formats/santander-csv.builder.ts"],"names":[],"mappings":";;;AAAA,gEAA4D;AAE5D,MAAa,mBAAoB,SAAQ,gCAAc;IACtD,KAAK,CAAC,UAAU;IAChB,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,GAAY;QACzB,IAAI,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;YAC3C,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;gBAC9B,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC;oBACtB,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC;gBACzC,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC;oBACtB,OAAO,IAAI,KAAK,GAAG,CAAC;aACrB;YACD,OAAO,KAAK,CAAC;QACd,CAAC,CAAC,CAAC;QACH,MAAM,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;IAC3C,CAAC;IAED,KAAK,CAAC,QAAQ;QACb,MAAM,IAAI,CAAC,GAAG,EAAE,CAAC;IAClB,CAAC;CACD;AApBD,kDAoBC"}
|