foodbot-cart-calculations 1.0.58 → 1.0.59

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +17 -17
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  const calculation = require('./calculations');
2
- const fs = require('fs');
3
- const path = require('path')
2
+ // const fs = require('fs');
3
+ // const path = require('path')
4
4
 
5
5
  async function calculateTax(inputJSON) {
6
6
  return new Promise(async (resolve, reject) => {
@@ -75,23 +75,23 @@ async function calculateTax(inputJSON) {
75
75
  })
76
76
  }
77
77
 
78
- let json = JSON.parse(fs.readFileSync('./sample.json', 'utf8'));
79
- calculateTax(json).then(res=>{
80
- // console.log(JSON.stringify(res))
78
+ // let json = JSON.parse(fs.readFileSync('./sample.json', 'utf8'));
79
+ // calculateTax(json).then(res=>{
80
+ // // console.log(JSON.stringify(res))
81
81
 
82
- const jsonResponse = JSON.stringify(res, null, 2); // Format the JSON with indentation
83
- const filePath = path.join(__dirname, 'response.json'); // File path in the same directory
82
+ // const jsonResponse = JSON.stringify(res, null, 2); // Format the JSON with indentation
83
+ // const filePath = path.join(__dirname, 'response.json'); // File path in the same directory
84
84
 
85
- fs.writeFile(filePath, jsonResponse, 'utf8', err => {
86
- if (err) {
87
- console.error('Error writing to file:', err);
88
- } else {
89
- console.log('Response successfully written to response.json');
90
- }
91
- });
85
+ // fs.writeFile(filePath, jsonResponse, 'utf8', err => {
86
+ // if (err) {
87
+ // console.error('Error writing to file:', err);
88
+ // } else {
89
+ // console.log('Response successfully written to response.json');
90
+ // }
91
+ // });
92
92
 
93
- }).catch(err=>{
94
- console.log(err)
95
- })
93
+ // }).catch(err=>{
94
+ // console.log(err)
95
+ // })
96
96
 
97
97
  module.exports = { calculateTax }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foodbot-cart-calculations",
3
- "version": "1.0.58",
3
+ "version": "1.0.59",
4
4
  "description": "Package for cart calculations in which it performs discount distribution and tax distribution on order",
5
5
  "main": "index.js",
6
6
  "scripts": {