Skip to content

Broken formatting on UMD files  #13

@coderaiser

Description

@coderaiser

I have example.js:

const fs = require('fs');
const indent = require('indent.js');

const data = fs.readFileSync('./index.js', 'utf8');
console.log(data);
console.log(indent.js(data, {tabString: 4}));             

When I run it, I see:

(function(mod) {
    'use strict';

    if (typeof exports === 'object' && typeof module === 'object') // CommonJS
        mod(require('../../lib/codemirror'));
    else if (typeof define === 'function' && define.amd) // AMD
        define(['../../lib/codemirror'], mod);
    else // Plain browser env
        mod(CodeMirror);
})(function(CodeMirror) {
});


(function(mod) {
    'use strict';

    if (typeof exports === 'object' && typeof module === 'object') // CommonJS
    mod(require('../../lib/codemirror'));
    else if (typeof define === 'function' && define.amd) // AMD
    define(['../../lib/codemirror'], mod);
    else // Plain browser env
    mod(CodeMirror);
})(function(CodeMirror) {
    });

Would be great to have ability not add windows line endings:
screen shot 2019-01-16 at 6 05 51 pm

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions