mirror of
https://github.com/gchq/CyberChef
synced 2026-01-01 08:03:30 +00:00
Remove multi-line operations
This commit is contained in:
@@ -34,10 +34,8 @@ class FromGeohash extends Operation {
|
||||
* @returns {string}
|
||||
*/
|
||||
run(input, args) {
|
||||
return input.split("\n").map(line => {
|
||||
const coords = geohash.decode(line);
|
||||
return [coords.latitude, coords.longitude].join(",");
|
||||
}).join("\n");
|
||||
const coords = geohash.decode(input);
|
||||
return [coords.latitude, coords.longitude].join(",");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -41,11 +41,9 @@ class ToGeohash extends Operation {
|
||||
run(input, args) {
|
||||
const [precision] = args;
|
||||
|
||||
return input.split("\n").map(line => {
|
||||
line = line.replace(/ /g, "");
|
||||
if (line === "") return "";
|
||||
return geohash.encode(...line.split(",").map(num => parseFloat(num)), precision);
|
||||
}).join("\n");
|
||||
input = input.replace(/ /g, "");
|
||||
if (input === "") return "";
|
||||
return geohash.encode(...input.split(",").map(num => parseFloat(num)), precision);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user