Last active
May 20, 2020 15:57
-
-
Save zeddash/842ef7d76a9e6ad0a0c4c1c012ea6752 to your computer and use it in GitHub Desktop.
Revisions
-
zeddash revised this gist
May 20, 2020 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -15,14 +15,14 @@ const servers = { const createPattern = arr => { arr = arr.map(x => x.replace(/([\?\*\|\^\$\-\\+{}\[\]()<>,.])/g, "\\$1")) return new RegExp(`^(${arr.join("|")}|dolphin)`) } const getPrefixes = n => { if(servers[n]) { return createPattern(servers[n]) } else { return /^(\-\-|\-d|dolphin)/ } } -
zeddash revised this gist
May 20, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -15,7 +15,7 @@ const servers = { const createPattern = arr => { arr = arr.map(x => x.replace(/([\?\*\|\^\$\-\\+{}\[\]()<>,.])/g, "\\$1")) return new RegExp(`(${arr.join("|")}|dolphin)`) } const getPrefixes = n => { -
zeddash revised this gist
May 20, 2020 . 1 changed file with 3 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -106,7 +106,7 @@ const expectedOutput = [ const parseCommands = (command, server) => { const prefixes = getPrefixes(server) //if() command.split(';').forEach(x => { x.trim() }); @@ -115,4 +115,5 @@ const parseCommands = (command, server) => { commands.forEach((element) => { parseCommands(element, 0); }); console.log(getPrefixes()) console.log(getPrefixes(1000)) -
zeddash revised this gist
May 20, 2020 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -102,7 +102,7 @@ const expectedOutput = [ ] ]; //const parseCommand = const parseCommands = (command, server) => { const prefixes = getPrefixes(server) @@ -115,3 +115,4 @@ const parseCommands = (command, server) => { commands.forEach((element) => { parseCommands(element, 0); }); console.log() -
zeddash revised this gist
May 20, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -20,7 +20,7 @@ const createPattern = arr => { const getPrefixes = n => { if(servers[n]) { return createPattern(servers[n]) } else { return /(\-\-|\-d|dolphin)/ } -
zeddash revised this gist
May 20, 2020 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,12 +14,13 @@ const servers = { } const createPattern = arr => { arr = arr.map(x => x.replace(/([\?\*\|\^\$\-\\+{}\[\]()<>,.])/g, "\\$1")) return new Regex(`/${arr.join("|")}|dolphin/`) } const getPrefixes = n => { if(servers[n]) { return createPatternservers[n] } else { return /(\-\-|\-d|dolphin)/ } -
zeddash revised this gist
May 20, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,7 +14,7 @@ const servers = { } const createPattern = arr => { return new Regex(`/${arr.join("|")}|dolphin/`) } const getPrefixes = n => { -
zeddash revised this gist
May 20, 2020 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,7 +13,9 @@ const servers = { 1000: ["--"] } const createPattern = arr => { return new Regex()`arr.join("|")` } const getPrefixes = n => { if(servers[n]) { -
zeddash revised this gist
May 20, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -19,7 +19,7 @@ const getPrefixes = n => { if(servers[n]) { return servers[n] } else { return /(\-\-|\-d|dolphin)/ } } -
zeddash revised this gist
May 20, 2020 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,6 +13,8 @@ const servers = { 1000: ["--"] } const createPattern = const getPrefixes = n => { if(servers[n]) { return servers[n] -
zeddash revised this gist
May 20, 2020 . No changes.There are no files selected for viewing
-
zeddash revised this gist
May 20, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -103,7 +103,7 @@ const parseCommands = (command, server) => { const prefixes = getPrefixes(server) if() command.split(';').forEach(x => { x.trim() }); }; -
zeddash revised this gist
May 20, 2020 . 1 changed file with 5 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -97,14 +97,16 @@ const expectedOutput = [ ] ]; const parseCommand = const parseCommands = (command, server) => { const prefixes = getPrefixes(server) if() command.split(';').forEach(x => { }); }; commands.forEach((element) => { parseCommands(element, 0); }); -
zeddash revised this gist
May 20, 2020 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -97,14 +97,14 @@ const expectedOutput = [ ] ]; const parseCommand = (command, server) => { const prefixes = getPrefixes if() command.split(';').forEach(x => { }); }; commands.forEach((element) => { parseCommand(element, 0); }); -
zeddash revised this gist
May 20, 2020 . 1 changed file with 5 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,7 +14,11 @@ const servers = { } const getPrefixes = n => { if(servers[n]) { return servers[n] } else { return ["--", "-d"] } } const commandSchema = { -
zeddash revised this gist
May 20, 2020 . 1 changed file with 4 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,10 +9,12 @@ const commands = [ "--command value; -- secondcommand value2" ]; const servers = { 1000: ["--"] } const getPrefixes = n => { if(servers.) } const commandSchema = { -
zeddash revised this gist
May 20, 2020 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,6 +9,8 @@ const commands = [ "--command value; -- secondcommand value2" ]; const servers const getPrefixes = n => { } -
zeddash revised this gist
May 20, 2020 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,6 +9,10 @@ const commands = [ "--command value; -- secondcommand value2" ]; const getPrefixes = n => { } const commandSchema = { command: { o: "option", -
zeddash revised this gist
May 20, 2020 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -87,6 +87,7 @@ const expectedOutput = [ const parseCommand = (command) => { //const commands = [] if() command.split(';').forEach(x => { }); -
zeddash revised this gist
May 20, 2020 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -87,7 +87,9 @@ const expectedOutput = [ const parseCommand = (command) => { //const commands = [] command.split(';').forEach(x => { }); }; commands.forEach((element) => { -
zeddash revised this gist
May 20, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -86,7 +86,7 @@ const expectedOutput = [ ]; const parseCommand = (command) => { //const commands = [] }; -
zeddash revised this gist
May 20, 2020 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -86,7 +86,8 @@ const expectedOutput = [ ]; const parseCommand = (command) => { const commands = [] }; commands.forEach((element) => { -
zeddash revised this gist
May 20, 2020 . 1 changed file with 5 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -77,7 +77,11 @@ const expectedOutput = [ { command: "command", value: "value", }, { command: "secondcommand", value: "value2", } ] ]; -
zeddash revised this gist
May 20, 2020 . 1 changed file with 8 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,8 @@ const commands = [ "-- command --no-option", "-- command value --option", "-dcommand value --option 5 -v", "dolphin command value --option true -v yes", "--command value; -- secondcommand value2" ]; const commandSchema = { @@ -72,6 +73,12 @@ const expectedOutput = [ }, }, ], [ { command: "command", value: "value", }, ] ]; const parseCommand = (command) => { -
zeddash revised this gist
May 20, 2020 . 1 changed file with 76 additions and 62 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,69 +1,83 @@ const commands = [ "--command", "--command value", "-- command --option", "-- command --no-option", "-- command value --option", "-dcommand value --option 5 -v", "dolphin command value --option true -v yes", ]; const commandSchema = { command: { o: "option", v: "value", }, }; const expectedOutput = [ [ { command: "command", }, ], [ { command: "command", value: "value", }, ], [ { command: "command", flags: { option: true, }, }, ], [ { command: "command", flags: { option: false, }, }, ], [ { command: "command", value: "value", flags: { option: true, }, }, ], [ { command: "command", value: "value", flags: { option: 5, value: true, }, }, ], [ { command: "command", value: "value", flags: { option: true, value: "yes", }, }, ], ]; const parseCommand = (command) => { console.log(command.split(";")); }; commands.forEach((element) => { parseCommand(element); }); -
zeddash revised this gist
May 20, 2020 . 1 changed file with 13 additions and 13 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -16,33 +16,33 @@ const commandSchema = { } const expectedOutput = [ [{ command: "command" }], [{ command: "command", value: "value" }], [{ command: "command", flags: { option:true } }], [{ command: "command", flags: { option:false } }], [{ command: "command", value: "value", flags: { option:true } }], [{ command: "command", value: "value", flags: { @@ -64,6 +64,6 @@ const parseCommand = command => { console.log(command.split(';')) } commands.forEach(element => { parseCommand(element) }); -
zeddash revised this gist
May 20, 2020 . 1 changed file with 6 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -61,5 +61,9 @@ const expectedOutput = [ ] const parseCommand = command => { console.log(command.split(';')) } commands..forEach(element => { }); -
zeddash revised this gist
May 20, 2020 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -33,30 +33,30 @@ const expectedOutput = [ command: "command", flags: { option:false } }, { command: "command", value: "value", flags: { option:true } }, { command: "command", value: "value", flags: { option:5, value: true } }, { command: "command", value: "value", flags: { option:true, value: "yes" } } ] -
zeddash revised this gist
May 20, 2020 . 1 changed file with 6 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -25,35 +25,35 @@ const expectedOutput = [ }, { command: "command", flags: { option:true } }, { command: "command", flags: { option:false ] }, { command: "command", value: "value", flags: { option:true ] }, { command: "command", value: "value", flags: { option:5, value: true ] }, { command: "command", value: "value", flags: { option:true, value: "yes" ] -
zeddash revised this gist
May 20, 2020 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -60,4 +60,6 @@ const expectedOutput = [ } ] const parseCommand = command => { command }
NewerOlder