Tweaks to P-List Viewer operation

This commit is contained in:
n1474335 2022-07-08 15:26:33 +01:00
parent 2858a74cbf
commit 7d4e554571
2 changed files with 11 additions and 24 deletions

View File

@ -457,7 +457,7 @@
"Frequency distribution", "Frequency distribution",
"Index of Coincidence", "Index of Coincidence",
"Chi Square", "Chi Square",
"PLIST Viewer", "P-list Viewer",
"Disassemble x86", "Disassemble x86",
"Pseudo-Random Number Generator", "Pseudo-Random Number Generator",
"Generate UUID", "Generate UUID",

View File

@ -7,36 +7,23 @@
import Operation from "../Operation.mjs"; import Operation from "../Operation.mjs";
/** /**
* PLIST Viewer operation * P-list Viewer operation
*/ */
class PLISTViewer extends Operation { class PlistViewer extends Operation {
/** /**
* PLISTViewer constructor * PlistViewer constructor
*/ */
constructor() { constructor() {
super(); super();
this.name = "PLIST Viewer"; this.name = "P-list Viewer";
this.module = "Other"; this.module = "Default";
this.description = "Converts PLISTXML file into a human readable format."; this.description = "In the macOS, iOS, NeXTSTEP, and GNUstep programming frameworks, property list files are files that store serialized objects. Property list files use the filename extension .plist, and thus are often referred to as p-list files.<br><br>This operation displays plist files in a human readable format.";
this.infoURL = ""; this.infoURL = "https://wikipedia.org/wiki/Property_list";
this.inputType = "string"; this.inputType = "string";
this.outputType = "string"; this.outputType = "string";
this.args = [ this.args = [];
/* Example arguments. See the project wiki for full details.
{
name: "First arg",
type: "string",
value: "Don't Panic"
},
{
name: "Second arg",
type: "number",
value: 42
}
*/
];
} }
/** /**
@ -46,7 +33,7 @@ class PLISTViewer extends Operation {
*/ */
run(input, args) { run(input, args) {
// Regexes are designed to transform the xml format into a reasonably more readable string format. // Regexes are designed to transform the xml format into a more readable string format.
input = input.slice(input.indexOf("<plist")) input = input.slice(input.indexOf("<plist"))
.replace(/<plist.+>/g, "plist => ") .replace(/<plist.+>/g, "plist => ")
.replace(/<dict>/g, "{") .replace(/<dict>/g, "{")
@ -143,4 +130,4 @@ class PLISTViewer extends Operation {
} }
} }
export default PLISTViewer; export default PlistViewer;