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
14 changes: 7 additions & 7 deletions examples/jsm/loaders/obj2/utils/CodeSerializer.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ const CodeSerializer = {
part = serializationTarget[ name ];
if ( typeof ( part ) === 'string' || part instanceof String ) {

part = part.replace( '\n', '\\n' );
part = part.replace( '\r', '\\r' );
part = part.replace( /\n/g, '\\n' );
part = part.replace( /\r/g, '\\r' );
objectString += '\t' + name + ': "' + part + '",\n';

} else if ( part instanceof Array ) {
Expand All @@ -31,7 +31,7 @@ const CodeSerializer = {

} else if ( typeof part === 'object' ) {

console.log( 'Omitting object "' + name + '" and replace it with empty object.');
console.log( 'Omitting object "' + name + '" and replace it with empty object.' );
objectString += '\t' + name + ': {},\n';

} else {
Expand Down Expand Up @@ -75,7 +75,7 @@ const CodeSerializer = {

if ( name === 'constructor' ) {

if ( !funcInstructions.isRemoveCode() ) {
if ( ! funcInstructions.isRemoveCode() ) {

constructorString = fullObjectName + ' = ' + funcInstructions.getCode() + ';\n\n';

Expand All @@ -89,7 +89,7 @@ const CodeSerializer = {
funcInstructions = funcTemp;

}
if ( !funcInstructions.isRemoveCode() ) {
if ( ! funcInstructions.isRemoveCode() ) {

if ( isExtended ) {

Expand Down Expand Up @@ -136,7 +136,7 @@ const CodeSerializer = {

} else if ( typeof objectPart === 'object' ) {

console.log( 'Omitting object "' + funcInstructions.getName() + '" and replace it with empty object.');
console.log( 'Omitting object "' + funcInstructions.getName() + '" and replace it with empty object.' );
funcInstructions.setCode( "{}" );

} else {
Expand Down Expand Up @@ -257,7 +257,7 @@ CodeSerializationInstruction.prototype = {
* Returns the serialized function code
* @return {String}
*/
getCode: function() {
getCode: function () {

return this.code;

Expand Down