Skip to content

Commit

Permalink
use titleCase function
Browse files Browse the repository at this point in the history
  • Loading branch information
archmoj committed Jul 17, 2021
1 parent 693ebd7 commit 1efc41e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/components/rangeselector/get_update_object.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

var d3Time = require('d3-time');
var beginCap = require('../../lib').beginCap;
var titleCase = require('../../lib').titleCase;

module.exports = function getUpdateObject(axisLayout, buttonLayout) {
var axName = axisLayout._name;
Expand All @@ -24,7 +24,7 @@ function getXRange(axisLayout, buttonLayout) {
var base = new Date(axisLayout.r2l(currentRange[1]));
var step = buttonLayout.step;

var utcStep = d3Time['utc' + beginCap(step)];
var utcStep = d3Time['utc' + titleCase(step)];

var count = buttonLayout.count;
var range0;
Expand Down
4 changes: 0 additions & 4 deletions src/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1347,10 +1347,6 @@ lib.bigFont = function(size) {
return Math.round(1.2 * size);
};

lib.beginCap = function(str) {
return str.charAt(0).toUpperCase() + str.slice(1);
};

var firefoxVersion = lib.getFirefoxVersion();
// see https://bugzilla.mozilla.org/show_bug.cgi?id=1684973
var isProblematicFirefox = firefoxVersion !== null && firefoxVersion < 86;
Expand Down
2 changes: 1 addition & 1 deletion src/plots/geo/geo.js
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ function getProjection(geoLayout) {

var projName = constants.projNames[projType];
// uppercase the first letter and add geo to the start of method name
projName = 'geo' + Lib.beginCap(projName);
projName = 'geo' + Lib.titleCase(projName);
var projFn = geo[projName] || geoProjection[projName];
var projection = projFn();

Expand Down

0 comments on commit 1efc41e

Please sign in to comment.