console-log-it
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -0,1 +1,5 @@ | ||
## [0.0.3] - 2021-01-14 | ||
- Changed logBox to accept rest args for lines instead of string or array | ||
- Updated documentation | ||
## [0.0.2] - 2021-01-14 | ||
@@ -2,0 +6,0 @@ - Cleaned up logBox code to make it more concise |
@@ -7,10 +7,19 @@ import { LogBoxConfig, LogBoxLine } from '../types'; | ||
* @param {LogBoxConfig} [config] - The configuration for the box | ||
* @returns {(message: string[] | string | LogBoxLine[]) => void} | ||
* @returns {(...lines: Array<string | LogBoxLine>) => void} | ||
* @example | ||
* logBox()('Box Message Goes Here'); | ||
* | ||
* ╭─────────────────────────╮ | ||
* │ Box Message Goes Here │ | ||
* ╰─────────────────────────╯ | ||
* logBox()('I\'m in a box!'); | ||
* @example | ||
* logBox({ color: 'magenta' })('I\'m in a magenta box!'); | ||
* @example | ||
* logBox({ padding: 10, symbol: '-' })('I\'ve got 10 spaces of padding in a box with a symbol override!'); | ||
* @example | ||
* // More complex | ||
* logBox({ color: 'green', indent: 4, bufferLines: true })( | ||
* 'This box is indented 4 spaces.', | ||
* 'It also has buffer lines above and below the content.', | ||
* '', | ||
* { color: 'red', message: 'I\'m red in a green box!' }, | ||
* { color: 'cyan', message: '...and I\'m cyan! '}, | ||
* ); | ||
*/ | ||
export declare const logBox: (config?: LogBoxConfig) => (message: string[] | string | LogBoxLine[]) => void; | ||
export declare const logBox: (config?: LogBoxConfig) => (...lines: Array<string | LogBoxLine>) => void; |
@@ -17,9 +17,18 @@ "use strict"; | ||
* @param {LogBoxConfig} [config] - The configuration for the box | ||
* @returns {(message: string[] | string | LogBoxLine[]) => void} | ||
* @returns {(...lines: Array<string | LogBoxLine>) => void} | ||
* @example | ||
* logBox()('Box Message Goes Here'); | ||
* | ||
* ╭─────────────────────────╮ | ||
* │ Box Message Goes Here │ | ||
* ╰─────────────────────────╯ | ||
* logBox()('I\'m in a box!'); | ||
* @example | ||
* logBox({ color: 'magenta' })('I\'m in a magenta box!'); | ||
* @example | ||
* logBox({ padding: 10, symbol: '-' })('I\'ve got 10 spaces of padding in a box with a symbol override!'); | ||
* @example | ||
* // More complex | ||
* logBox({ color: 'green', indent: 4, bufferLines: true })( | ||
* 'This box is indented 4 spaces.', | ||
* 'It also has buffer lines above and below the content.', | ||
* '', | ||
* { color: 'red', message: 'I\'m red in a green box!' }, | ||
* { color: 'cyan', message: '...and I\'m cyan! '}, | ||
* ); | ||
* @docgen_types | ||
@@ -43,4 +52,7 @@ * export type LogBoxConfig = { | ||
*/ | ||
var logBox = function (config) { return function (message) { | ||
var lines = typeof message === 'string' ? [message] : message; | ||
var logBox = function (config) { return function () { | ||
var lines = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
lines[_i] = arguments[_i]; | ||
} | ||
var indent = typeof (config === null || config === void 0 ? void 0 : config.indent) === 'number' ? ' '.repeat(config.indent) : ''; | ||
@@ -55,4 +67,4 @@ var padding = (config === null || config === void 0 ? void 0 : config.padding) !== undefined ? config.padding : 2; | ||
} | ||
for (var _i = 0, lines_1 = lines; _i < lines_1.length; _i++) { | ||
var line = lines_1[_i]; | ||
for (var _a = 0, lines_1 = lines; _a < lines_1.length; _a++) { | ||
var line = lines_1[_a]; | ||
output = __spreadArrays(output, [getLine(color, indent, padding, width, line, symbol)]); | ||
@@ -59,0 +71,0 @@ } |
@@ -11,3 +11,4 @@ import { CustomStatusConfig } from '../types'; | ||
* tagColor: 'magenta', | ||
* tagMessage: 'Deprecated' }); | ||
* tagMessage: 'Deprecated', | ||
* }); | ||
* | ||
@@ -14,0 +15,0 @@ * deprecated('This is a custom status tag to tell you something is deprecated'); |
@@ -21,3 +21,4 @@ "use strict"; | ||
* tagColor: 'magenta', | ||
* tagMessage: 'Deprecated' }); | ||
* tagMessage: 'Deprecated', | ||
* }); | ||
* | ||
@@ -24,0 +25,0 @@ * deprecated('This is a custom status tag to tell you something is deprecated'); |
@@ -7,10 +7,19 @@ import { LogBoxConfig, LogBoxLine } from '../types'; | ||
* @param {LogBoxConfig} [config] - The configuration for the box | ||
* @returns {(message: string[] | string | LogBoxLine[]) => void} | ||
* @returns {(...lines: Array<string | LogBoxLine>) => void} | ||
* @example | ||
* logBox()('Box Message Goes Here'); | ||
* | ||
* ╭─────────────────────────╮ | ||
* │ Box Message Goes Here │ | ||
* ╰─────────────────────────╯ | ||
* logBox()('I\'m in a box!'); | ||
* @example | ||
* logBox({ color: 'magenta' })('I\'m in a magenta box!'); | ||
* @example | ||
* logBox({ padding: 10, symbol: '-' })('I\'ve got 10 spaces of padding in a box with a symbol override!'); | ||
* @example | ||
* // More complex | ||
* logBox({ color: 'green', indent: 4, bufferLines: true })( | ||
* 'This box is indented 4 spaces.', | ||
* 'It also has buffer lines above and below the content.', | ||
* '', | ||
* { color: 'red', message: 'I\'m red in a green box!' }, | ||
* { color: 'cyan', message: '...and I\'m cyan! '}, | ||
* ); | ||
*/ | ||
export declare const logBox: (config?: LogBoxConfig) => (message: string[] | string | LogBoxLine[]) => void; | ||
export declare const logBox: (config?: LogBoxConfig) => (...lines: Array<string | LogBoxLine>) => void; |
@@ -14,9 +14,18 @@ var __spreadArrays = (this && this.__spreadArrays) || function () { | ||
* @param {LogBoxConfig} [config] - The configuration for the box | ||
* @returns {(message: string[] | string | LogBoxLine[]) => void} | ||
* @returns {(...lines: Array<string | LogBoxLine>) => void} | ||
* @example | ||
* logBox()('Box Message Goes Here'); | ||
* | ||
* ╭─────────────────────────╮ | ||
* │ Box Message Goes Here │ | ||
* ╰─────────────────────────╯ | ||
* logBox()('I\'m in a box!'); | ||
* @example | ||
* logBox({ color: 'magenta' })('I\'m in a magenta box!'); | ||
* @example | ||
* logBox({ padding: 10, symbol: '-' })('I\'ve got 10 spaces of padding in a box with a symbol override!'); | ||
* @example | ||
* // More complex | ||
* logBox({ color: 'green', indent: 4, bufferLines: true })( | ||
* 'This box is indented 4 spaces.', | ||
* 'It also has buffer lines above and below the content.', | ||
* '', | ||
* { color: 'red', message: 'I\'m red in a green box!' }, | ||
* { color: 'cyan', message: '...and I\'m cyan! '}, | ||
* ); | ||
* @docgen_types | ||
@@ -40,4 +49,7 @@ * export type LogBoxConfig = { | ||
*/ | ||
export var logBox = function (config) { return function (message) { | ||
var lines = typeof message === 'string' ? [message] : message; | ||
export var logBox = function (config) { return function () { | ||
var lines = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
lines[_i] = arguments[_i]; | ||
} | ||
var indent = typeof (config === null || config === void 0 ? void 0 : config.indent) === 'number' ? ' '.repeat(config.indent) : ''; | ||
@@ -52,4 +64,4 @@ var padding = (config === null || config === void 0 ? void 0 : config.padding) !== undefined ? config.padding : 2; | ||
} | ||
for (var _i = 0, lines_1 = lines; _i < lines_1.length; _i++) { | ||
var line = lines_1[_i]; | ||
for (var _a = 0, lines_1 = lines; _a < lines_1.length; _a++) { | ||
var line = lines_1[_a]; | ||
output = __spreadArrays(output, [getLine(color, indent, padding, width, line, symbol)]); | ||
@@ -56,0 +68,0 @@ } |
@@ -11,3 +11,4 @@ import { CustomStatusConfig } from '../types'; | ||
* tagColor: 'magenta', | ||
* tagMessage: 'Deprecated' }); | ||
* tagMessage: 'Deprecated', | ||
* }); | ||
* | ||
@@ -14,0 +15,0 @@ * deprecated('This is a custom status tag to tell you something is deprecated'); |
@@ -18,3 +18,4 @@ var __spreadArrays = (this && this.__spreadArrays) || function () { | ||
* tagColor: 'magenta', | ||
* tagMessage: 'Deprecated' }); | ||
* tagMessage: 'Deprecated', | ||
* }); | ||
* | ||
@@ -21,0 +22,0 @@ * deprecated('This is a custom status tag to tell you something is deprecated'); |
{ | ||
"name": "console-log-it", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Console log colors, boxes, and more for the browser and terminal", | ||
@@ -5,0 +5,0 @@ "main": "lib/es5/index.js", |
@@ -10,3 +10,3 @@ [![Build Status](https://travis-ci.com/TheSpicyMeatball/console-log-it.svg?branch=main)](https://travis-ci.com/TheSpicyMeatball/console-log-it) | ||
<p><b>Version:</b> 0.0.2</p> | ||
<p><b>Version:</b> 0.0.3</p> | ||
@@ -92,4 +92,4 @@ <h2>Summary of Utils</h2> | ||
└───/logBox | ||
└───index.d.ts - 1.04 KB | ||
└───index.js - 4.53 KB | ||
└───index.d.ts - 1.33 KB | ||
└───index.js - 4.87 KB | ||
└───/logDebug | ||
@@ -105,3 +105,3 @@ └───index.d.ts - 519 Bytes | ||
└───/logStatus | ||
└───index.d.ts - 755 Bytes | ||
└───index.d.ts - 760 Bytes | ||
└───index.js - 1.61 KB | ||
@@ -127,4 +127,4 @@ └───/logStyle | ||
└───/logBox | ||
└───index.d.ts - 1.04 KB | ||
└───index.js - 4.39 KB | ||
└───index.d.ts - 1.33 KB | ||
└───index.js - 4.73 KB | ||
└───/logDebug | ||
@@ -140,3 +140,3 @@ └───index.d.ts - 519 Bytes | ||
└───/logStatus | ||
└───index.d.ts - 755 Bytes | ||
└───index.d.ts - 760 Bytes | ||
└───index.js - 1.47 KB | ||
@@ -143,0 +143,0 @@ └───/logStyle |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
134500
1131