atmosx-nwws-parser 1.0.1917 → 1.0.1918
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/src/text-parser.js +4 -0
- package/package.json +1 -1
- package/src/text-parser.ts +2 -0
package/dist/src/text-parser.js
CHANGED
|
@@ -82,6 +82,7 @@ var mTextParser = /** @class */ (function () {
|
|
|
82
82
|
* @param {string} handle - The VTEC handle to help identify the start of the main content.
|
|
83
83
|
*/
|
|
84
84
|
mTextParser.getCleanDescription = function (message, handle) {
|
|
85
|
+
var originalMessage = message; // Store the original message for reference
|
|
85
86
|
var dateLineMatches = Array.from(message.matchAll(/\d{3,4}\s*(AM|PM)?\s*[A-Z]{2,4}\s+[A-Z]{3,}\s+[A-Z]{3,}\s+\d{1,2}\s+\d{4}/gim));
|
|
86
87
|
if (dateLineMatches.length) {
|
|
87
88
|
var dateLineMatch = dateLineMatches[dateLineMatches.length - 1];
|
|
@@ -111,6 +112,9 @@ var mTextParser = /** @class */ (function () {
|
|
|
111
112
|
message = latStart !== -1 ? afterVtec.substring(0, latStart).trim() : afterVtec.trim();
|
|
112
113
|
}
|
|
113
114
|
}
|
|
115
|
+
if (message.replace(/\s+/g, ' ').trim().startsWith("ISSUED TIME...")) {
|
|
116
|
+
message = originalMessage;
|
|
117
|
+
}
|
|
114
118
|
return message;
|
|
115
119
|
};
|
|
116
120
|
return mTextParser;
|
package/package.json
CHANGED
package/src/text-parser.ts
CHANGED
|
@@ -85,6 +85,7 @@ export class mTextParser {
|
|
|
85
85
|
*/
|
|
86
86
|
|
|
87
87
|
static getCleanDescription(message: string, handle: string) {
|
|
88
|
+
let originalMessage = message; // Store the original message for reference
|
|
88
89
|
let dateLineMatches = Array.from(message.matchAll(/\d{3,4}\s*(AM|PM)?\s*[A-Z]{2,4}\s+[A-Z]{3,}\s+[A-Z]{3,}\s+\d{1,2}\s+\d{4}/gim));
|
|
89
90
|
if (dateLineMatches.length) {
|
|
90
91
|
let dateLineMatch = dateLineMatches[dateLineMatches.length - 1];
|
|
@@ -110,6 +111,7 @@ export class mTextParser {
|
|
|
110
111
|
message = latStart !== -1 ? afterVtec.substring(0, latStart).trim() : afterVtec.trim();
|
|
111
112
|
}
|
|
112
113
|
}
|
|
114
|
+
if (message.replace(/\s+/g, ' ').trim().startsWith(`ISSUED TIME...`)) { message = originalMessage; }
|
|
113
115
|
return message;
|
|
114
116
|
}
|
|
115
117
|
|