mirror of
https://github.com/cloudflare/wrangler-action.git
synced 2024-11-22 10:03:24 +01:00
13 lines
377 B
JavaScript
13 lines
377 B
JavaScript
'use strict';
|
|
module.exports = string => string.replace(/^[\r\n]+/, '').replace(/[\r\n]+$/, '');
|
|
module.exports.start = string => string.replace(/^[\r\n]+/, '');
|
|
|
|
module.exports.end = string => {
|
|
let end = string.length;
|
|
|
|
while (end > 0 && (string[end - 1] === '\r' || string[end - 1] === '\n')) {
|
|
end--;
|
|
}
|
|
|
|
return end < string.length ? string.slice(0, end) : string;
|
|
};
|