Comparing version 0.0.3 to 0.0.4
18
index.js
module.exports = function () { | ||
var oneline = function (string, dont_trim) { | ||
// Remove the newline characters, in their various formats. | ||
var onelined = string.replace(/(\r\n|\n|\r)/gm, ''); | ||
module.exports = function (string, dont_trim) { | ||
// Remove the newline characters, in their various formats. | ||
var onelined = string.replace(/(\r\n|\n|\r)/gm, ''); | ||
if (dont_trim) { return onelined; } | ||
if (dont_trim) { return onelined; } | ||
// Trim the extra whitespace on both ends of the string. | ||
var trimmed = onelined.replace(/^\s\s*/, '').replace(/\s\s*$/, ''); | ||
// Trim the extra whitespace on both ends of the string. | ||
var trimmed = onelined.replace(/^\s\s*/, '').replace(/\s\s*$/, ''); | ||
return trimmed; | ||
}; | ||
return oneline; | ||
return trimmed; | ||
}; |
{ | ||
"name": "oneliner", | ||
"description": "Converts a string that contains line feed characters into one that doesn't.", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"keywords": [ | ||
@@ -6,0 +6,0 @@ "strip", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1667
8
1