Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

car-tax-calculations

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

car-tax-calculations - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

__tests__/index.test.ts

9

jest.config.js
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.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc