30s
Version:
A command-line application for 30 seconds of code snippets
16 lines (10 loc) • 557 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.enforceSingleNewLine = exports.startsOrEndsWith = void 0;
var _ramda = require("ramda");
const startsOrEndsWith = (val, query) => (0, _ramda.anyPass)([_ramda.startsWith, _ramda.endsWith])(query, val);
exports.startsOrEndsWith = startsOrEndsWith;
const enforceSingleNewLine = x => (0, _ramda.is)(String, x) ? (0, _ramda.compose)((0, _ramda.replace)(/[\r\n]+/g, '\n'), (0, _ramda.replace)(/[\r\n]*$/, ''))(x) : x;
exports.enforceSingleNewLine = enforceSingleNewLine;