Skip to content

Commit 42f2887

Browse files
committed
Export getNewLineChar function.
Turn off validation, consider user may validate separately.
1 parent 6007a1d commit 42f2887

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const { lines, words, chars, spaces } = textics(str);
1515
### Example
1616

1717
```js
18-
const textics = require("textics");
18+
const { textics } = require("textics");
1919

2020
const result = textics("you got the power");
2121

src/textics.js

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
/**
2-
* validates string
3-
*
4-
* @param {string} str
5-
* @returns {boolean}
6-
*/
7-
function isValid(str) {
8-
return str && typeof str === "string" && str.length > 0;
9-
}
1+
// /**
2+
// * validates string
3+
// *
4+
// * @param {string} str
5+
// * @returns {boolean}
6+
// */
7+
// function isValid(str) {
8+
// return str && typeof str === "string" && str.length > 0;
9+
// }
1010

1111
/**
1212
* Extracts new line used char in a given string.
@@ -42,14 +42,14 @@ function textics(str) {
4242
let chars = 0;
4343
let spaces = 0;
4444

45-
if (!isValid(str)) {
46-
return {
47-
lines,
48-
words,
49-
chars,
50-
spaces
51-
};
52-
}
45+
// if (!isValid(str)) {
46+
// return {
47+
// lines,
48+
// words,
49+
// chars,
50+
// spaces
51+
// };
52+
// }
5353

5454
const regNewLine = getNewLineChar(str);
5555

@@ -118,4 +118,4 @@ function textics(str) {
118118
};
119119
}
120120

121-
module.exports = textics;
121+
module.exports = { textics, getNewLineChar };

0 commit comments

Comments
 (0)