Comparing version 0.8.5 to 0.8.6
'use strict'; | ||
var parser = require('./parser'); | ||
var utils = require('./utils'); | ||
@@ -25,2 +26,9 @@ function main(code, options) { | ||
main.getEOL = function (text) { | ||
if (typeof text !== 'string') { | ||
throw new TypeError("Invalid parameter 'text' specified."); | ||
} | ||
return utils.getEOL(text); | ||
}; | ||
module.exports = main; |
{ | ||
"name": "decomment", | ||
"version": "0.8.5", | ||
"description": "Removes comments from JSON, JavaScript, CSS, HTML, etc.", | ||
"version": "0.8.6", | ||
"description": "Removes comments from JSON/JavaScript, CSS/HTML, CPP/H, etc.", | ||
"main": "lib/index.js", | ||
@@ -30,2 +30,4 @@ "scripts": { | ||
"HTML", | ||
"CPP", | ||
"C++", | ||
"Text" | ||
@@ -32,0 +34,0 @@ ], |
decomment | ||
========= | ||
Removes comments from JSON, JavaScript, CSS, HTML, etc. | ||
Removes comments from JSON/JavaScript, CSS/HTML, CPP/H, etc. | ||
@@ -165,2 +165,12 @@ [![Build Status](https://travis-ci.org/vitaly-t/decomment.svg?branch=master)](https://travis-ci.org/vitaly-t/decomment) | ||
### decomment.getEOL(text) ⇒ String | ||
Returns End-of-Line string used within the `text`, based on the occurrence frequency: | ||
* `\n` - for Unix-encoded text | ||
* `\r\n` - for Windows-encoded text | ||
When impossible to conclude (the same or 0 occurrence), it returns the default End-of-Line | ||
for the current OS. | ||
## License | ||
@@ -167,0 +177,0 @@ |
57475
14
1113
183