Support Unicode characters in tags

This commit is contained in:
Zaid Abdulla committed 2020-10-20 15:44:11 -07:00
1 parent dfab724515
commit c52ff6f6ec
7 files changed
+48 -40

No files matched your search

+3 -4
View File
@@ -19,7 +19,7 @@
import { MongoClient, ObjectID, Collection } from "mongodb";
import { get } from "./config";
import { escapeRegExp } from "./common";
import { encodeTag, escapeRegExp } from "./common";
import { parse } from "./common/expression-parser";
import {
DeviceData,
@@ -234,10 +234,9 @@ export async function fetchDevice(
]);
}
for (let t of v as string[]) {
t = t.replace(/[^a-zA-Z0-9-]+/g, "_");
for (const t of v as string[]) {
res.push([
Path.parse("Tags." + t),
Path.parse("Tags." + encodeTag(t)),
timestamp,
{
object: [timestamp, 0],