Skip to content

Commit

Permalink
Update to change-case-bundled 1.0.3 / change-case 4.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
nitro404 committed Mar 17, 2020
1 parent 53082ec commit 391970e
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 19 deletions.
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ bower_components
src
test
coverage
docs
.sass-cache
.coveralls.yml
.travis.yml
Expand Down
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ sudo: false
language: node_js

node_js:
- "12"
- "10"
- "8"
- "6"
Expand Down
6 changes: 5 additions & 1 deletion dist/extra-utilities.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/extra-utilities.js.map

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion dist/extra-utilities.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/extra-utilities.min.js.map

Large diffs are not rendered by default.

22 changes: 15 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
{
"name": "extra-utilities",
"version": "1.3.2",
"version": "1.3.3",
"description": "A collection of useful helper functions.",
"main": "dist/extra-utilities.js",
"scripts": {
"build": "gulp build",
"lint": "gulp lint",
"test": "mocha",
"coverage": "gulp coverage",
"coveralls": "npm run coverage -- --report lcovonly && cat ./coverage/lcov.info | coveralls",
"security": "gulp security"
"coverage": "istanbul cover node_modules/mocha/bin/_mocha --require test/*.js",
"coveralls": "npm run coverage -- --report lcovonly && cat ./coverage/lcov.info | coveralls"
},
"repository": {
"type": "git",
Expand All @@ -31,8 +30,8 @@
},
"homepage": "https://github.com/nitro404/extra-utilities#readme",
"dependencies": {
"change-case-bundled": "^1.0.1",
"validator": "^9.4.1"
"change-case-bundled": "^1.0.3",
"validator": "^12.2.0"
},
"devDependencies": {
"chai": "^4.1.2",
Expand Down
4 changes: 3 additions & 1 deletion src/extra-utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ var formatTypes = ["boolean", "bool", "integer", "int", "float", "number", "stri

var stringCaseFunctions = {
camel: changeCase.camelCase,
capital: changeCase.capitalCase,
constant: changeCase.constantCase,
dot: changeCase.dotCase,
header: changeCase.headerCase,
Expand All @@ -33,6 +34,7 @@ var stringCaseFunctions = {
path: changeCase.pathCase,
sentence: changeCase.sentenceCase,
snake: changeCase.snakeCase,
sponge: changeCase.spongeCase,
swap: changeCase.swapCase,
title: changeCase.titleCase,
upper: changeCase.upperCase,
Expand Down Expand Up @@ -707,7 +709,7 @@ utilities.formatValue = function formatValue(value, format, options) {
else {
var originalCase = format.case;

format.case = changeCase.camel(format.case.trim());
format.case = changeCase.camelCase(format.case.trim());

if(!utilities.isFunction(stringCaseFunctions[format.case])) {
errorMessage = "Invalid optional case format value - expected one of " + Object.keys(stringCaseFunctions).join(", ") + ", received \"" + utilities.toString(originalCase) + "\".";
Expand Down
6 changes: 3 additions & 3 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1331,7 +1331,7 @@ describe("Utilities", function() {

it("should correctly transform the case of a string value using each of the available case functions", function() {
var modifiedCaseFunctionNames = ["Camel", "CONSTANT", "Dot", "HEADER", "Lower", "LOWER_FIRST", "No", "PARAM", "Pascal", "PATH", "Sentence", "SNAKE", "Swap", "TITLE", "Upper", "upper-first"];
var changeCaseData = ["CAMEL_CASE", "constantCase", "DotCase", "header-case", "LOWER CASE", "LOWER_FIRST", "No case", "param/case", "pascal_case", "Path-Case", "SENTENCE_CASE", "snakeCase", "SwapCase", "TITLE.CASE", "upper-case", "upper first"];
var changeCaseData = ["CAMEL_CASE", "constantCase", "DotCase", "header-case", "LOWER CASE", "LOWER_FIRST", "No case", "param/case", "pascal_case", "Path-Case", "SENTENCE_CASE", "snakeCase", "SwapCase", "title case", "upper-case", "upper first"];
var changeCaseResults = ["camelCase", "CONSTANT_CASE", "dot.case", "Header-Case", "lower case", "lOWER_FIRST", "no case", "param-case", "PascalCase", "path/case", "Sentence case", "snake_case", "sWAPcASE", "Title Case", "UPPER-CASE", "Upper first"];

for(var i = 0; i < changeCaseData.length; i++) {
Expand Down Expand Up @@ -2511,7 +2511,7 @@ describe("Utilities", function() {
isAlive: "Yes",
error: errorFunc,
exception: null,
movies: ["Alien 3", " The boondock saints", "FIGHT CLUB\t", 9 ],
movies: ["Alien 3", " The boondock saints", "fight club\t", 9 ],
albums: [
{
artist: "IN FLAMES",
Expand Down Expand Up @@ -2539,7 +2539,7 @@ describe("Utilities", function() {
codeNames: {
p: "how THE solar SYSTEM was WON",
o: "rick sanchez",
n: "VICTOR CHARLIE",
n: "victor charlie",
m: "mAX dAMAGE",
l: "Operation Desert Storm",
k: "FROG FOOT",
Expand Down

0 comments on commit 391970e

Please sign in to comment.