Skip to content

Commit

Permalink
fix(payments): PAYMENTS-2590 Review Feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
bc-biren committed Mar 16, 2018
1 parent 07f544f commit 689b572
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion src/common/utils/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export { default as includes } from './includes';
export { default as isNil } from './is-nil';
export { default as isObject } from './is-object';
export { default as omitEmptyAndNil } from './omit-empty-and-nil';
export { default as omitEmptyStringAndNil } from './omit-emptystring-and-nil';
export { default as omitNil } from './omit-nil';
export { default as omitProperty } from './omit-property';
export { default as toNumber } from './to-number';
Expand Down
10 changes: 0 additions & 10 deletions src/common/utils/is-empty-or-nil.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
* @param {*} value
* @returns {boolean}
*/
export default function isEmpty(value) {
export default function isEmptyString(value) {
return value === '';
}
10 changes: 10 additions & 0 deletions src/common/utils/is-emptystring-or-nil.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import isEmptyString from './is-empty-string';
import isNil from './is-nil';

/**
* @param {*} value
* @returns {boolean}
*/
export default function isEmptyStringOrNil(value) {
return isEmptyString(value) || isNil(value);
}
10 changes: 0 additions & 10 deletions src/common/utils/omit-empty-and-nil.js

This file was deleted.

10 changes: 10 additions & 0 deletions src/common/utils/omit-emptystring-and-nil.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import isEmptyStringOrNil from './is-emptystring-or-nil';
import omitProperty from './omit-property';

/**
* @param {Object} object
* @returns {Object}
*/
export default function omitEmptyStringAndNil(object) {
return omitProperty(object, isEmptyStringOrNil);
}
4 changes: 2 additions & 2 deletions src/payment/v1/payment-mappers/order-mapper.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { omitEmptyAndNil, omitNil, toString } from '../../../common/utils';
import { omitEmptyStringAndNil, omitNil, toString } from '../../../common/utils';

export default class OrderMapper {
/**
Expand Down Expand Up @@ -92,7 +92,7 @@ export default class OrderMapper {
mapToAddress(data, addressKey) {
const address = data[addressKey] || {};

return omitEmptyAndNil({
return omitEmptyStringAndNil({
city: address.city,
company: address.company,
country_code: address.countryCode,
Expand Down

0 comments on commit 689b572

Please sign in to comment.