-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added BAS to currency options. * Added postman.environmentJSON option. * Added server CLI for demos. * Tools: Added highcharts as peer dependency. * Tools: Added more lint rules. * Tools: Fixed runtime bundling.
- Loading branch information
Showing
34 changed files
with
685 additions
and
88 deletions.
There are no files selected for viewing
This file contains 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 characters
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<title>Morningstar Connectors Demos</title> | ||
</head> | ||
<body> | ||
<a href="stock/demo.html">Highcharts Stock demo</a> | ||
</body> | ||
</html> |
This file contains 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 characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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 characters
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
/* * | ||
* | ||
* (c) 2009-2024 Highsoft AS | ||
* | ||
* License: www.highcharts.com/license | ||
* | ||
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!! | ||
* | ||
* Authors: | ||
* - Sophie Bremer | ||
* | ||
* */ | ||
|
||
|
||
'use strict'; | ||
|
||
|
||
/* * | ||
* | ||
* Constants | ||
* | ||
* */ | ||
|
||
|
||
export const SHORTCUTS: Record<string, string> = { | ||
'?': 'help', | ||
h: 'help', | ||
v: 'version' | ||
}; | ||
|
||
|
||
/* * | ||
* | ||
* Interface | ||
* | ||
* */ | ||
|
||
|
||
export type Args = Record<string, ArgValue>; | ||
|
||
|
||
export type ArgValue = (true|string|Array<string>); | ||
|
||
|
||
/* * | ||
* | ||
* Functions | ||
* | ||
* */ | ||
|
||
|
||
/** | ||
* Converts CLI arguments into a flexible dictionary. | ||
* | ||
* @param argv | ||
* Arguments to convert. | ||
* | ||
* @param shortcuts | ||
* Shortcut arguments as a map to their full counterpart. | ||
* | ||
* @return | ||
* Converted CLI arguments. | ||
*/ | ||
function getArgs ( | ||
argv = process.argv, | ||
shortcuts = SHORTCUTS | ||
): Args { | ||
const args: Args = {}; | ||
|
||
let currentKey: string = '_'; | ||
let currentValue: ArgValue; | ||
|
||
for (const arg of argv) { | ||
if ( | ||
currentKey === '_' && | ||
arg.startsWith('/') | ||
) { | ||
continue; | ||
} | ||
if (arg.startsWith('--')) { | ||
currentKey = arg.substring(2); | ||
args[currentKey] = true; | ||
} else if (arg.startsWith('-')) { | ||
currentKey = shortcuts[arg.substring(1)]; | ||
args[currentKey] = true; | ||
} else { | ||
currentValue = args[currentKey]; | ||
if (currentKey === '_') { | ||
args[currentKey] = arg; | ||
} else if (currentValue instanceof Array) { | ||
currentValue.push(arg); | ||
} else if (typeof currentValue === 'string') { | ||
args[currentKey] = [currentValue, arg]; | ||
} else { | ||
args[currentKey] = arg; | ||
} | ||
} | ||
} | ||
|
||
return args; | ||
} | ||
|
||
|
||
/* * | ||
* | ||
* Default Export | ||
* | ||
* */ | ||
|
||
|
||
export default { | ||
getArgs | ||
}; |
Oops, something went wrong.