use directories for structure
This commit is contained in:
41
node_modules/eol/eol.js
generated
vendored
Normal file
41
node_modules/eol/eol.js
generated
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
!function(root, name, make) {
|
||||
if (typeof module != 'undefined' && module.exports) module.exports = make()
|
||||
else root[name] = make()
|
||||
}(this, 'eol', function() {
|
||||
|
||||
var api = {}
|
||||
var isWindows = typeof process != 'undefined' && 'win32' === process.platform
|
||||
var linebreak = isWindows ? '\r\n' : '\n'
|
||||
var newline = /\r\n|\r|\n/g
|
||||
|
||||
function before(text) {
|
||||
return linebreak + text
|
||||
}
|
||||
|
||||
function after(text) {
|
||||
return text + linebreak
|
||||
}
|
||||
|
||||
function converts(to) {
|
||||
function convert(text) {
|
||||
return text.replace(newline, to)
|
||||
}
|
||||
convert.toString = function() {
|
||||
return to
|
||||
}
|
||||
return convert
|
||||
}
|
||||
|
||||
function split(text) {
|
||||
return text.split(newline)
|
||||
}
|
||||
|
||||
api['lf'] = converts('\n')
|
||||
api['cr'] = converts('\r')
|
||||
api['crlf'] = converts('\r\n')
|
||||
api['auto'] = converts(linebreak)
|
||||
api['before'] = before
|
||||
api['after'] = after
|
||||
api['split'] = split
|
||||
return api
|
||||
});
|
Reference in New Issue
Block a user