car-tax-calculations
Advanced tools
Comparing version 1.0.0 to 1.1.0
module.exports = { | ||
preset: 'ts-jest', | ||
testEnvironment: 'node', | ||
verbose: true, | ||
testPathIgnorePatterns: [ | ||
".history", | ||
"node_modules", | ||
], | ||
coverageDirectory: "./coverage" | ||
testPathIgnorePatterns: ['.history', 'node_modules'], | ||
coverageDirectory: './coverage' | ||
}; |
{ | ||
"name": "car-tax-calculations", | ||
"version": "1.0.0", | ||
"description": "", | ||
"version": "1.1.0", | ||
"description": "Little util to calculate claimable cost of car mileage for different jurisdictions.", | ||
"main": "index.js", | ||
"types": "index.d.ts", | ||
"scripts": { | ||
"test": "jest", | ||
"test-ci": "CI=true jest" | ||
"test-ci": "CI=true jest", | ||
"prepublish": "tsc" | ||
}, | ||
@@ -13,4 +15,26 @@ "author": "GOFAR", | ||
"devDependencies": { | ||
"jest": "^24.9.0" | ||
"@types/jest": "^24.0.23", | ||
"@typescript-eslint/eslint-plugin": "^2.9.0", | ||
"eslint": "^6.1.0", | ||
"eslint-config-airbnb": "^18.0.1", | ||
"eslint-config-prettier": "^6.7.0", | ||
"eslint-plugin-import": "^2.18.2", | ||
"eslint-plugin-jest": "^23.0.5", | ||
"eslint-plugin-jsx-a11y": "^6.2.3", | ||
"eslint-plugin-prettier": "^3.1.1", | ||
"eslint-plugin-react": "^7.16.0", | ||
"eslint-plugin-react-hooks": "^1.7.0", | ||
"husky": "^3.1.0", | ||
"jest": "^24.9.0", | ||
"prettier": "^1.19.1", | ||
"prettier-eslint": "^9.0.1", | ||
"pretty-quick": "^2.0.1", | ||
"ts-jest": "^24.2.0", | ||
"typescript": "^3.7.2" | ||
}, | ||
"husky": { | ||
"hooks": { | ||
"pre-commit": "make pre-commit" | ||
} | ||
} | ||
} |
@@ -37,5 +37,48 @@ # Car Tax Calculations | ||
| UK_HMRC | UK Her Majesty's Revenue Service | | ||
| custom | Custom calculation method (see custom) | | ||
### Custom calculations | ||
If none of the existing options meet your needs, you can do a custom calculation. | ||
``` | ||
// Calculate claimable tax for the lambo you're driving in the Libertarian utopia you paid citizenship for with BTC | ||
const rateTiers = [ | ||
{ | ||
maxDistanceForThisTier: 8000, | ||
ratePerDistanceUnit: 0.42 | ||
}, | ||
{ | ||
maxDistanceForThisTier: Infinity, | ||
ratePerDistanceUnit: 0.52 | ||
} | ||
]; | ||
const { | ||
claimableAmount, | ||
claimableDistance, | ||
currency, | ||
distanceUnit | ||
} = getTaxClaimableMileage({ | ||
taxType: "custom", | ||
kmTravelled: 15122, | ||
currency: "BTC", | ||
distanceUnit: "earth to moon hops", | ||
rateTiers | ||
}); | ||
/* Output: | ||
{ | ||
claimableAmount: 7063.4, | ||
claimableDistance: 15122, | ||
currency: 'BTC', | ||
distanceUnit: 'earth to moon hops' | ||
} | ||
*/ | ||
``` | ||
## kmTravelled | ||
We always use km as the base unit. Sorry fans of miles - we're Australian and that's how we roll. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14509
12
298
84
18
1