REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 3.74 KB
Close
//proc/self/root/opt/alt/alt-nodejs24/root/lib/node_modules/npm/node_modules/diff/libcjs/diff/line.js
Text
Base64
"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); exports.lineDiff = void 0; exports.diffLines = diffLines; exports.diffTrimmedLines = diffTrimmedLines; exports.tokenize = tokenize; var base_js_1 = require("./base.js"); var params_js_1 = require("../util/params.js"); var LineDiff = /** @class */ (function (_super) { __extends(LineDiff, _super); function LineDiff() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.tokenize = tokenize; return _this; } LineDiff.prototype.equals = function (left, right, options) { // If we're ignoring whitespace, we need to normalise lines by stripping // whitespace before checking equality. (This has an annoying interaction // with newlineIsToken that requires special handling: if newlines get their // own token, then we DON'T want to trim the *newline* tokens down to empty // strings, since this would cause us to treat whitespace-only line content // as equal to a separator between lines, which would be weird and // inconsistent with the documented behavior of the options.) if (options.ignoreWhitespace) { if (!options.newlineIsToken || !left.includes('\n')) { left = left.trim(); } if (!options.newlineIsToken || !right.includes('\n')) { right = right.trim(); } } else if (options.ignoreNewlineAtEof && !options.newlineIsToken) { if (left.endsWith('\n')) { left = left.slice(0, -1); } if (right.endsWith('\n')) { right = right.slice(0, -1); } } return _super.prototype.equals.call(this, left, right, options); }; return LineDiff; }(base_js_1.default)); exports.lineDiff = new LineDiff(); function diffLines(oldStr, newStr, options) { return exports.lineDiff.diff(oldStr, newStr, options); } function diffTrimmedLines(oldStr, newStr, options) { options = (0, params_js_1.generateOptions)(options, { ignoreWhitespace: true }); return exports.lineDiff.diff(oldStr, newStr, options); } // Exported standalone so it can be used from jsonDiff too. function tokenize(value, options) { if (options.stripTrailingCr) { // remove one \r before \n to match GNU diff's --strip-trailing-cr behavior value = value.replace(/\r\n/g, '\n'); } var retLines = [], linesAndNewlines = value.split(/(\n|\r\n)/); // Ignore the final empty token that occurs if the string ends with a new line if (!linesAndNewlines[linesAndNewlines.length - 1]) { linesAndNewlines.pop(); } // Merge the content and line separators into single tokens for (var i = 0; i < linesAndNewlines.length; i++) { var line = linesAndNewlines[i]; if (i % 2 && !options.newlineIsToken) { retLines[retLines.length - 1] += line; } else { retLines.push(line); } } return retLines; }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 8
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
array.js
1.54 KB
lrw-r--r--
2026-02-23 07:38:44
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
base.js
12.37 KB
lrw-r--r--
2026-02-23 07:38:44
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
character.js
1.32 KB
lrw-r--r--
2026-02-23 07:38:44
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
css.js
1.37 KB
lrw-r--r--
2026-02-23 07:38:44
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
json.js
4.26 KB
lrw-r--r--
2026-02-23 07:38:44
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
line.js
3.74 KB
lrw-r--r--
2026-02-23 07:38:44
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
sentence.js
2.99 KB
lrw-r--r--
2026-02-23 07:38:44
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
word.js
15.05 KB
lrw-r--r--
2026-02-23 07:38:44
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).