mirror of
https://github.com/bendtherules/repro-typedoc-issue-jsdoc.git
synced 2026-08-18 13:53:33 +00:00
Basic files
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
# EditorConfig is awesome: http://EditorConfig.org
|
||||
|
||||
root = true;
|
||||
|
||||
[*]
|
||||
# Ensure there's no lingering whitespace
|
||||
trim_trailing_whitespace = true
|
||||
# Ensure a newline at the end of each file
|
||||
insert_final_newline = true
|
||||
|
||||
[*.js]
|
||||
# Unix-style newlines
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
|
||||
# Runtime data
|
||||
pids
|
||||
*.pid
|
||||
*.seed
|
||||
|
||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
||||
lib-cov
|
||||
|
||||
# Coverage directory used by tools like istanbul
|
||||
coverage
|
||||
|
||||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
|
||||
.grunt
|
||||
|
||||
# Compiled binary addons (http://nodejs.org/api/addons.html)
|
||||
build/Release
|
||||
|
||||
# Dependency directory
|
||||
# Commenting this out is preferred by some people, see
|
||||
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git-
|
||||
node_modules
|
||||
bower_components
|
||||
.nyc_output
|
||||
coverage
|
||||
tmp
|
||||
docs
|
||||
|
||||
# Users Environment Variables
|
||||
.lock-wscript
|
||||
|
||||
# Editors
|
||||
.idea
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"name": "demo",
|
||||
"version": "0.0.1",
|
||||
"main": "src/index.js",
|
||||
"scripts": {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
const SIPCalculations = require('./sip');
|
||||
|
||||
module.exports = SIPCalculations;
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
// @ts-check
|
||||
|
||||
const Calculations = {
|
||||
|
||||
/**
|
||||
* @description Get minimum SIP amount
|
||||
* @returns {number} - Returns here
|
||||
* @param {Array<number>} priceArray - Input here
|
||||
*/
|
||||
getMaxAmount(priceArray) {
|
||||
const maxPrice = Math.max(...priceArray);
|
||||
return maxPrice;
|
||||
},
|
||||
|
||||
/**
|
||||
* Get total value of the order from order config
|
||||
* @returns {number} - Output A
|
||||
* @param {import('./types').OrderConfig} orderConfig - Input A
|
||||
* @param {import('./types').SidPriceMap} sidPriceMap - Input B
|
||||
*/
|
||||
calculateOrderTotalValue: function calculateOrderTotalValue(orderConfig, sidPriceMap) {
|
||||
const totalValue = orderConfig.reduce((prevValue, eachSidConfig) => {
|
||||
const sidPrice = sidPriceMap[eachSidConfig.sid];
|
||||
const currentConfigValue = sidPrice * eachSidConfig.shares;
|
||||
return (prevValue + currentConfigValue);
|
||||
}, 0);
|
||||
|
||||
return totalValue;
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = Calculations;
|
||||
@@ -0,0 +1,12 @@
|
||||
export type sid = string;
|
||||
|
||||
export interface OrderConfigElement {
|
||||
sid: sid;
|
||||
shares: number,
|
||||
}
|
||||
|
||||
export type OrderConfig = Array<OrderConfigElement>;
|
||||
|
||||
export interface SidPriceMap {
|
||||
[sid: string]: number;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"allowJs": true
|
||||
},
|
||||
"include": [
|
||||
"src/**/*"
|
||||
],
|
||||
"exclude": [
|
||||
"node_modules"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user