Skip to content
This repository was archived by the owner on May 28, 2023. It is now read-only.

Commit 66df994

Browse files
author
tkostuch
committed
447 replace require with import
1 parent 698423b commit 66df994

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/platform/magento2/helpers/productChecksum.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
const { sha3_224 } = require('js-sha3')
2-
const get = require('lodash/get')
3-
const flow = require('lodash/flow')
4-
const cloneDeep = require('lodash/cloneDeep')
1+
import { sha3_224 } from 'js-sha3'
2+
import get from 'lodash/get'
3+
import flow from 'lodash/flow'
4+
import cloneDeep from 'lodash/cloneDeep'
55

66
const replaceNumberToString = obj => {
77
Object.keys(obj).forEach(key => {
@@ -46,7 +46,7 @@ const getDataToHash = (product) => {
4646

4747
const productChecksum = (product) => sha3_224(JSON.stringify(getDataToHash(product)))
4848

49-
module.exports = {
49+
export {
5050
getProductOptions,
5151
productChecksum
5252
}

src/platform/magento2/helpers/productsEquals.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { getProductOptions, productChecksum } = require('./productChecksum');
1+
import { getProductOptions, productChecksum } from './productChecksum';
22

33
// 'id' check
44
const getServerItemId = (product) =>
@@ -90,4 +90,4 @@ const productsEquals = (product1, product2) => {
9090
return check(['id', 'sku'])
9191
}
9292

93-
module.exports = productsEquals
93+
export default productsEquals

src/platform/magento2/o2m.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import productsEquals from './helpers/productsEquals'
12

23
const Magento2Client = require('magento2-rest-client').Magento2Client;
34

@@ -15,7 +16,6 @@ if (fs.existsSync('../../models/order.schema.extension.json')) {
1516
orderSchemaExtension = require('../../models/order.schema.extension.json')
1617
}
1718
const validate = ajv.compile(merge(orderSchema, orderSchemaExtension));
18-
const productsEquals = require('./helpers/productsEquals')
1919

2020
function isNumeric (val) {
2121
return Number(parseFloat(val)).toString() === val;

0 commit comments

Comments
 (0)