@dra2020/baseclient 1.0.135 → 1.0.137
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/dist/baseclient.js +44 -2
- package/dist/baseclient.js.map +1 -1
- package/dist/csv/all.d.ts +1 -0
- package/dist/csv/csvparseline.d.ts +1 -0
- package/lib/csv/all.ts +1 -0
- package/lib/csv/csvparseline.ts +35 -0
- package/lib/util/util.ts +1 -1
- package/package.json +1 -1
package/dist/baseclient.js
CHANGED
|
@@ -860,6 +860,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
860
860
|
};
|
|
861
861
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
862
862
|
__exportStar(__webpack_require__(/*! ./csv */ "./lib/csv/csv.ts"), exports);
|
|
863
|
+
__exportStar(__webpack_require__(/*! ./csvparseline */ "./lib/csv/csvparseline.ts"), exports);
|
|
863
864
|
|
|
864
865
|
|
|
865
866
|
/***/ }),
|
|
@@ -1025,6 +1026,48 @@ class ParseOne {
|
|
|
1025
1026
|
exports.ParseOne = ParseOne;
|
|
1026
1027
|
|
|
1027
1028
|
|
|
1029
|
+
/***/ }),
|
|
1030
|
+
|
|
1031
|
+
/***/ "./lib/csv/csvparseline.ts":
|
|
1032
|
+
/*!*********************************!*\
|
|
1033
|
+
!*** ./lib/csv/csvparseline.ts ***!
|
|
1034
|
+
\*********************************/
|
|
1035
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
1036
|
+
|
|
1037
|
+
|
|
1038
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1039
|
+
exports.csvParseLine = void 0;
|
|
1040
|
+
const reField = /^\s*("([^"]*(?:""[^"]*)*)"|[^,|]*)\s*[|,]?/;
|
|
1041
|
+
const reQuote = /^"/;
|
|
1042
|
+
const reAddOne = /[|,]$/;
|
|
1043
|
+
function csvParseLine(s) {
|
|
1044
|
+
let fields = [];
|
|
1045
|
+
s = s.trim();
|
|
1046
|
+
let addOne = reAddOne.test(s);
|
|
1047
|
+
while (s) {
|
|
1048
|
+
const match = reField.exec(s);
|
|
1049
|
+
if (match) {
|
|
1050
|
+
let field = match[1];
|
|
1051
|
+
if (reQuote.test(field)) {
|
|
1052
|
+
// if quoted string, convert quoted double-quotes to single quote
|
|
1053
|
+
field = field.slice(1, -1).replace(/""/g, '"');
|
|
1054
|
+
// and remove optional start and end double quote
|
|
1055
|
+
field = field.replace(/^["]?/, '').replace(/["]?$/, '');
|
|
1056
|
+
}
|
|
1057
|
+
fields.push(field);
|
|
1058
|
+
s = s.substring(match[0].length);
|
|
1059
|
+
}
|
|
1060
|
+
else
|
|
1061
|
+
s = null;
|
|
1062
|
+
}
|
|
1063
|
+
// Handle trailing separator
|
|
1064
|
+
if (addOne)
|
|
1065
|
+
fields.push('');
|
|
1066
|
+
return fields;
|
|
1067
|
+
}
|
|
1068
|
+
exports.csvParseLine = csvParseLine;
|
|
1069
|
+
|
|
1070
|
+
|
|
1028
1071
|
/***/ }),
|
|
1029
1072
|
|
|
1030
1073
|
/***/ "./lib/dataflow/all.ts":
|
|
@@ -12312,8 +12355,7 @@ function toNumber(a) {
|
|
|
12312
12355
|
exports.toNumber = toNumber;
|
|
12313
12356
|
function toSafeNumber(a) {
|
|
12314
12357
|
let n = toNumber(a);
|
|
12315
|
-
|
|
12316
|
-
return 0;
|
|
12358
|
+
return (isNaN(n) || typeof n !== 'number') ? 0 : n;
|
|
12317
12359
|
}
|
|
12318
12360
|
exports.toSafeNumber = toSafeNumber;
|
|
12319
12361
|
|