Skip to content

Commit

Permalink
chore: added more commas to PHP array structure generation (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
G0-DVL authored and StephaneBour committed May 23, 2018
1 parent 7186d6d commit 3777f04
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,11 @@ function copyAsPhp() {
if(type !== '')
php = php + '\'type\' => \'' + type + '\',' + "\n\t";

php = php + '\'body\' => ' + "\n\t\t";
php = php + '\'body\' => ';

if (req.data && req.data.length) {
php += req.data.join("\n").replace(/"/g, '\'').replace(/{/g, '[').replace(/}/g, ']').replace(/:/g, ' =>');
if (req.data.length > 1) php += "\n"; // end with a new line
php += req.data.join("\n").replace(/\n/g, '\n\t').replace(/"/g, '\'').replace(/{/g, '[').replace(/},?/g, '],').replace(/:/g, ' =>')+'\n';
if (req.data.length > 1) php += "\t"; // end with a new line
}
php = php + '];';

Expand Down Expand Up @@ -676,4 +676,4 @@ function init() {
}
}

$(document).ready(init);
$(document).ready(init);

0 comments on commit 3777f04

Please sign in to comment.