REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 5.83 KB
Close
//proc/thread-self/root/home/byroehnu/.trash/node_modules11/logform/dist/pad-levels.js
Text
Base64
/* eslint no-unused-vars: 0 */ 'use strict'; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); } function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); } function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var _require = require('triple-beam'), configs = _require.configs, LEVEL = _require.LEVEL, MESSAGE = _require.MESSAGE; var Padder = /*#__PURE__*/function () { function Padder() { var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { levels: configs.npm.levels }; _classCallCheck(this, Padder); this.paddings = Padder.paddingForLevels(opts.levels, opts.filler); this.options = opts; } /** * Returns the maximum length of keys in the specified `levels` Object. * @param {Object} levels Set of all levels to calculate longest level against. * @returns {Number} Maximum length of the longest level string. */ return _createClass(Padder, [{ key: "transform", value: /** * Prepends the padding onto the `message` based on the `LEVEL` of * the `info`. This is based on the behavior of `winston@2` which also * prepended the level onto the message. * * See: https://github.com/winstonjs/winston/blob/2.x/lib/winston/logger.js#L198-L201 * * @param {Info} info Logform info object * @param {Object} opts Options passed along to this instance. * @returns {Info} Modified logform info object. */ function transform(info, opts) { info.message = "".concat(this.paddings[info[LEVEL]]).concat(info.message); if (info[MESSAGE]) { info[MESSAGE] = "".concat(this.paddings[info[LEVEL]]).concat(info[MESSAGE]); } return info; } }], [{ key: "getLongestLevel", value: function getLongestLevel(levels) { var lvls = Object.keys(levels).map(function (level) { return level.length; }); return Math.max.apply(Math, _toConsumableArray(lvls)); } /** * Returns the padding for the specified `level` assuming that the * maximum length of all levels it's associated with is `maxLength`. * @param {String} level Level to calculate padding for. * @param {String} filler Repeatable text to use for padding. * @param {Number} maxLength Length of the longest level * @returns {String} Padding string for the `level` */ }, { key: "paddingForLevel", value: function paddingForLevel(level, filler, maxLength) { var targetLen = maxLength + 1 - level.length; var rep = Math.floor(targetLen / filler.length); var padding = "".concat(filler).concat(filler.repeat(rep)); return padding.slice(0, targetLen); } /** * Returns an object with the string paddings for the given `levels` * using the specified `filler`. * @param {Object} levels Set of all levels to calculate padding for. * @param {String} filler Repeatable text to use for padding. * @returns {Object} Mapping of level to desired padding. */ }, { key: "paddingForLevels", value: function paddingForLevels(levels) { var filler = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ' '; var maxLength = Padder.getLongestLevel(levels); return Object.keys(levels).reduce(function (acc, level) { acc[level] = Padder.paddingForLevel(level, filler, maxLength); return acc; }, {}); } }]); }(); /* * function padLevels (info) * Returns a new instance of the padLevels Format which pads * levels to be the same length. This was previously exposed as * { padLevels: true } to transports in `winston < 3.0.0`. */ module.exports = function (opts) { return new Padder(opts); }; module.exports.Padder = module.exports.Format = Padder;
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 21
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
align.js
378 B
lrw-r--r--
2026-02-21 00:53:24
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
browser.js
1.68 KB
lrw-r--r--
2026-02-21 00:53:28
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
cli.js
2.78 KB
lrw-r--r--
2026-02-21 00:53:30
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
colorize.js
4.71 KB
lrw-r--r--
2026-02-21 00:53:34
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
combine.js
1.86 KB
lrw-r--r--
2026-02-21 00:53:34
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
errors.js
2.20 KB
lrw-r--r--
2026-02-21 00:53:36
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
format.js
5.30 KB
lrw-r--r--
2026-02-21 00:53:36
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
index.js
1.87 KB
lrw-r--r--
2026-02-21 00:53:38
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
json.js
1003 B
lrw-r--r--
2026-02-21 00:53:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
label.js
487 B
lrw-r--r--
2026-02-21 00:53:42
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
levels.js
285 B
lrw-r--r--
2026-02-21 00:53:44
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
logstash.js
783 B
lrw-r--r--
2026-02-21 00:53:46
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
metadata.js
2.29 KB
lrw-r--r--
2026-02-21 00:53:46
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ms.js
460 B
lrw-r--r--
2026-02-21 00:53:50
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
pad-levels.js
5.83 KB
lrw-r--r--
2026-02-21 00:53:50
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
pretty-print.js
1.01 KB
lrw-r--r--
2026-02-21 00:53:50
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
printf.js
1.93 KB
lrw-r--r--
2026-02-21 00:53:54
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
simple.js
1.04 KB
lrw-r--r--
2026-02-21 00:53:56
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
splat.js
6.83 KB
lrw-r--r--
2026-02-21 00:53:56
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
timestamp.js
817 B
lrw-r--r--
2026-02-21 00:53:58
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
uncolorize.js
727 B
lrw-r--r--
2026-02-21 00:53:58
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).