translate commands on error
This commit is contained in:
@ -1,11 +1,28 @@
|
||||
/* eslint-disable line-comment-position */
|
||||
/* eslint-disable no-inline-comments */
|
||||
export type GraphStreamCommand =
|
||||
'cn'| // create node
|
||||
'en'| // end node
|
||||
'cug'| // create unordered graph
|
||||
'cdg'| // create directional graph
|
||||
'csg'| // create subgraph
|
||||
'eg'| // end graph
|
||||
'at'| // add attributes
|
||||
'ce' // create edge
|
||||
type GraphStreamCommand =
|
||||
'cn'|
|
||||
'en'|
|
||||
'cug'|
|
||||
'cdg'|
|
||||
'csg'|
|
||||
'eg'|
|
||||
'at'|
|
||||
'ce'
|
||||
|
||||
function translate_command (cmd: GraphStreamCommand|''): string {
|
||||
const translations = {
|
||||
cn: 'create node',
|
||||
en: 'end node',
|
||||
cug: 'create unordered graph',
|
||||
cdg: 'create directional graph',
|
||||
csg: 'create subgraph',
|
||||
eg: 'end graph',
|
||||
at: 'attributes',
|
||||
ce: 'create edge',
|
||||
'': 'start'
|
||||
};
|
||||
return translations[cmd];
|
||||
}
|
||||
|
||||
export { GraphStreamCommand, translate_command };
|
||||
|
Reference in New Issue
Block a user