Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,11 @@ module.exports.init = function() {
};

exports.camelCaseToUnderscore = function(s) {
return s.replace(/(?:^|\.?)([A-Z])/g, function(x,y) {
// Regex will also insert an underscore before a digit if that digit is preceded by a lowercase letter and followed
// by one or more additional digits, so it will insert an underscore before the "8" and the "1" in
// "windows80Ie10Tile" (yielding "windows_80_ie_10_tile", but NOT before the "6" in "ios6AndPriorIcons" (yielding
// "ios6_and_prior_icons").
return s.replace(/(?:^|\.?)([A-Z]|(?<=[a-z])\d(?=\d+))/g, function(x,y) {
return "_" + y.toLowerCase()
}).replace(/^_/, "");
}
Expand Down Expand Up @@ -150,7 +154,10 @@ module.exports.init = function() {
'app_description',
'developer_name',
'app_name',
'existing_manifest'];
'existing_manifest',
'background_color',
'theme_color'
];
var newContent = (keysToIgnore.indexOf(uKey) >= 0)
? request[key]
: exports.camelCaseToUnderscoreRequest(request[key]);
Expand Down