Skip to content

Commit 2d2ec73

Browse files
committed
Remove _ from methods names
1 parent 497e2a4 commit 2d2ec73

File tree

7 files changed

+14
-14
lines changed

7 files changed

+14
-14
lines changed

lib/formatColumn.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import objectAssign from 'object-assign';
22
import isString from 'is-string';
33

4-
import _checkCurrencyFormat from './internal/checkCurrencyFormat';
4+
import checkCurrencyFormat from './internal/checkCurrencyFormat';
55
import settings from './settings';
66
import formatNumber from './formatNumber';
77
import unformat from './unformat';
@@ -42,7 +42,7 @@ function formatColumn(list, opts = {}) {
4242
);
4343

4444
// Check format (returns object with pos, neg and zero), only need pos for now
45-
const formats = _checkCurrencyFormat(opts.format);
45+
const formats = checkCurrencyFormat(opts.format);
4646

4747
// Whether to pad at start of string or after currency symbol
4848
const padAfterSymbol = formats.pos.indexOf('%s') < formats.pos.indexOf('%v');

lib/formatMoney.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import objectAssign from 'object-assign';
22

3-
import _checkCurrencyFormat from './internal/checkCurrencyFormat';
3+
import checkCurrencyFormat from './internal/checkCurrencyFormat';
44
import settings from './settings';
55
import formatNumber from './formatNumber';
66

@@ -45,7 +45,7 @@ function formatMoney(number, opts = {}) {
4545
);
4646

4747
// Check format (returns object with pos, neg and zero)
48-
const formats = _checkCurrencyFormat(opts.format);
48+
const formats = checkCurrencyFormat(opts.format);
4949

5050
// Choose which format to use for this value
5151
let useFormat;

lib/formatNumber.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import objectAssign from 'object-assign';
22

3-
import _stripInsignificantZeros from './internal/stripInsignificantZeros';
3+
import stripInsignificantZeros from './internal/stripInsignificantZeros';
44
import settings from './settings';
55
import toFixed from './toFixed';
66

@@ -44,7 +44,7 @@ function formatNumber(number, opts = {}) {
4444
base.substr(mod).replace(/(\d{3})(?=\d)/g, '$1' + opts.thousand) +
4545
(opts.precision > 0 ? opts.decimal + toFixed(Math.abs(number), opts.precision).split('.')[1] : '');
4646

47-
return opts.stripZeros ? _stripInsignificantZeros(formatted, opts.decimal) : formatted;
47+
return opts.stripZeros ? stripInsignificantZeros(formatted, opts.decimal) : formatted;
4848
}
4949

5050
export default formatNumber;

lib/internal/checkCurrencyFormat.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import isString from 'is-string';
1313
* @param {String} [format="%s%v"] String with the format to apply, where %s is the currency symbol and %v is the value
1414
* @return {Object} object represnting format (with pos, neg and zero attributes)
1515
*/
16-
function _checkCurrencyFormat(format) {
16+
function checkCurrencyFormat(format) {
1717
// Format should be a string, in which case `value` ('%v') must be present
1818
if (isString(format) && format.match('%v')) {
1919
// Create and return positive, negative and zero formats
@@ -28,4 +28,4 @@ function _checkCurrencyFormat(format) {
2828
return format;
2929
}
3030

31-
export default _checkCurrencyFormat;
31+
export default checkCurrencyFormat;

lib/internal/checkPrecision.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/**
22
* Check and normalise the value of precision (must be positive integer).
33
*/
4-
function _checkPrecision(val, base) {
4+
function checkPrecision(val, base) {
55
val = Math.round(Math.abs(val));
66
return isNaN(val) ? base : val;
77
}
88

9-
export default _checkPrecision;
9+
export default checkPrecision;

lib/internal/stripInsignificantZeros.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
function _stripInsignificantZeros(str, decimal) {
2+
function stripInsignificantZeros(str, decimal) {
33
const parts = str.split(decimal);
44
const integerPart = parts[0];
55
const decimalPart = parts[1].replace(/0+$/, '');
@@ -11,4 +11,4 @@ function _stripInsignificantZeros(str, decimal) {
1111
return integerPart;
1212
}
1313

14-
export default _stripInsignificantZeros;
14+
export default stripInsignificantZeros;

lib/toFixed.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import _checkPrecision from './internal/checkPrecision';
1+
import checkPrecision from './internal/checkPrecision';
22
import settings from './settings';
33

44
/**
@@ -19,7 +19,7 @@ import settings from './settings';
1919
* @return {String} The given number transformed into a string with the given precission
2020
*/
2121
function toFixed(value, precision) {
22-
precision = _checkPrecision(precision, settings.precision);
22+
precision = checkPrecision(precision, settings.precision);
2323
const power = Math.pow(10, precision);
2424

2525
// Multiply up by precision, round accurately, then divide and use native toFixed()

0 commit comments

Comments
 (0)