PHP 8.2.30
Preview: format.js Size: 1.14 KB
/home/byroehnu/easepaybiz.easetack.com/node_modules/logform/format.js

'use strict';

/*
 * Displays a helpful message and the source of
 * the format when it is invalid.
 */
class InvalidFormatError extends Error {
  constructor(formatFn) {
    super(`Format functions must be synchronous taking a two arguments: (info, opts)
Found: ${formatFn.toString().split('\n')[0]}\n`);

    Error.captureStackTrace(this, InvalidFormatError);
  }
}

/*
 * function format (formatFn)
 * Returns a create function for the `formatFn`.
 */
module.exports = formatFn => {
  if (formatFn.length > 2) {
    throw new InvalidFormatError(formatFn);
  }

  /*
   * function Format (options)
   * Base prototype which calls a `_format`
   * function and pushes the result.
   */
  function Format(options = {}) {
    this.options = options;
  }

  Format.prototype.transform = formatFn;

  //
  // Create a function which returns new instances of
  // FormatWrap for simple syntax like:
  //
  // require('winston').formats.json();
  //
  function createFormatWrap(opts) {
    return new Format(opts);
  }

  //
  // Expose the FormatWrap through the create function
  // for testability.
  //
  createFormatWrap.Format = Format;
  return createFormatWrap;
};

Directory Contents

Dirs: 1 × Files: 31

Name Size Perms Modified Actions
dist DIR
- drwxr-xr-x 2026-03-14 01:49:11
Edit Download
39 B lrw-r--r-- 2026-03-05 00:19:55
Edit Download
105 B lrw-r--r-- 2026-03-05 00:19:55
Edit Download
25 B lrw-r--r-- 2026-03-05 00:19:55
Edit Download
127 B lr--r--r-- 2026-03-14 01:49:11
Edit Download
367 B lrw-r--r-- 2026-03-05 00:19:55
Edit Download
1.72 KB lrw-r--r-- 2026-03-05 00:19:56
Edit Download
10.48 KB lrw-r--r-- 2026-03-05 00:20:10
Edit Download
1.19 KB lrw-r--r-- 2026-03-05 00:19:56
Edit Download
2.97 KB lrw-r--r-- 2026-03-05 00:19:57
Edit Download
1.76 KB lrw-r--r-- 2026-03-05 00:19:58
Edit Download
1.19 KB lrw-r--r-- 2026-03-05 00:19:59
Edit Download
1.14 KB lrw-r--r-- 2026-03-05 00:19:59
Edit Download
6.04 KB lrw-r--r-- 2026-03-05 00:20:10
Edit Download
1.83 KB lrw-r--r-- 2026-03-05 00:20:00
Edit Download
983 B lrw-r--r-- 2026-03-05 00:20:01
Edit Download
469 B lrw-r--r-- 2026-03-05 00:20:02
Edit Download
251 B lrw-r--r-- 2026-03-05 00:20:02
Edit Download
1.07 KB lrw-r--r-- 2026-03-05 00:19:55
Edit Download
759 B lrw-r--r-- 2026-03-05 00:20:03
Edit Download
1.30 KB lrw-r--r-- 2026-03-05 00:20:04
Edit Download
430 B lrw-r--r-- 2026-03-05 00:20:04
Edit Download
1.44 KB lrw-r--r-- 2026-03-05 00:20:10
Edit Download
2.81 KB lrw-r--r-- 2026-03-05 00:20:06
Edit Download
899 B lrw-r--r-- 2026-03-05 00:20:07
Edit Download
515 B lrw-r--r-- 2026-03-05 00:20:08
Edit Download
17.66 KB lrw-r--r-- 2026-03-05 00:20:10
Edit Download
979 B lrw-r--r-- 2026-03-05 00:20:09
Edit Download
4.17 KB lrw-r--r-- 2026-03-05 00:20:09
Edit Download
757 B lrw-r--r-- 2026-03-05 00:20:09
Edit Download
384 B lrw-r--r-- 2026-03-05 00:20:10
Edit Download
705 B lrw-r--r-- 2026-03-05 00:20:10
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).