MCPcopy Index your code
hub / github.com/di-sukharev/opencommit / stripFinalNewline

Function stripFinalNewline

out/cli.cjs:65894–65904  ·  view source on GitHub ↗
(input)

Source from the content-addressed store, hash-verified

65892// node_modules/execa/index.js
65893var import_node_buffer2 = require("node:buffer");
65894var import_node_path2 = __toESM(require("node:path"), 1);
65895var import_node_child_process3 = __toESM(require("node:child_process"), 1);
65896var import_node_process7 = __toESM(require("node:process"), 1);
65897var import_cross_spawn = __toESM(require_cross_spawn(), 1);
65898
65899// node_modules/execa/node_modules/strip-final-newline/index.js
65900function stripFinalNewline(input) {
65901 const LF = typeof input === "string" ? "\n" : "\n".charCodeAt();
65902 const CR = typeof input === "string" ? "\r" : "\r".charCodeAt();
65903 if (input[input.length - 1] === LF) {
65904 input = input.slice(0, -1);
65905 }
65906 if (input[input.length - 1] === CR) {
65907 input = input.slice(0, -1);

Callers 1

handleOutputFunction · 0.85

Calls 1

sliceMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…