@aeriajs/common 0.0.133 → 0.0.134

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,11 @@
1
+ type EscapeCode = `[${number}m`;
2
+ export declare const AnsiColor: {
3
+ readonly Green: "[32m";
4
+ readonly Yellow: "[33m";
5
+ readonly Blue: "[36m";
6
+ readonly Red: "[31m";
7
+ readonly White: "[37m";
8
+ };
9
+ export declare const METHOD_COLORS: Record<string, typeof AnsiColor[keyof typeof AnsiColor]>;
10
+ export declare const escape: (code: EscapeCode | EscapeCode[], text: string) => string;
11
+ export {};
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.escape = exports.METHOD_COLORS = exports.AnsiColor = void 0;
4
+ exports.AnsiColor = {
5
+ Green: '[32m',
6
+ Yellow: '[33m',
7
+ Blue: '[36m',
8
+ Red: '[31m',
9
+ White: '[37m',
10
+ };
11
+ exports.METHOD_COLORS = {
12
+ GET: exports.AnsiColor.Green,
13
+ PUT: exports.AnsiColor.Blue,
14
+ POST: exports.AnsiColor.White,
15
+ DELETE: exports.AnsiColor.Red,
16
+ };
17
+ const escape = (code, text) => {
18
+ const codeStr = Array.isArray(code)
19
+ ? code.map((c) => `\x1b${c}`).join('')
20
+ : `\x1b${code}`;
21
+ return `${codeStr}${text}\x1b[0m`;
22
+ };
23
+ exports.escape = escape;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ export const AnsiColor = {
3
+ Green: "[32m",
4
+ Yellow: "[33m",
5
+ Blue: "[36m",
6
+ Red: "[31m",
7
+ White: "[37m"
8
+ };
9
+ export const METHOD_COLORS = {
10
+ GET: AnsiColor.Green,
11
+ PUT: AnsiColor.Blue,
12
+ POST: AnsiColor.White,
13
+ DELETE: AnsiColor.Red
14
+ };
15
+ export const escape = (code, text) => {
16
+ const codeStr = Array.isArray(code) ? code.map((c) => `\x1B${c}`).join("") : `\x1B${code}`;
17
+ return `${codeStr}${text}\x1B[0m`;
18
+ };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export * from './arraysIntersect.js';
2
2
  export * from './checkForEmptiness.js';
3
+ export * from './console.js';
3
4
  export * from './deepClone.js';
4
5
  export * from './deepMerge.js';
5
6
  export * from './dynamicImport.js';
package/dist/index.js CHANGED
@@ -16,6 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./arraysIntersect.js"), exports);
18
18
  __exportStar(require("./checkForEmptiness.js"), exports);
19
+ __exportStar(require("./console.js"), exports);
19
20
  __exportStar(require("./deepClone.js"), exports);
20
21
  __exportStar(require("./deepMerge.js"), exports);
21
22
  __exportStar(require("./dynamicImport.js"), exports);
package/dist/index.mjs CHANGED
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  export * from "./arraysIntersect.mjs";
3
3
  export * from "./checkForEmptiness.mjs";
4
+ export * from "./console.mjs";
4
5
  export * from "./deepClone.mjs";
5
6
  export * from "./deepMerge.mjs";
6
7
  export * from "./dynamicImport.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aeriajs/common",
3
- "version": "0.0.133",
3
+ "version": "0.0.134",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -31,7 +31,7 @@
31
31
  "bson": "^6.5.0"
32
32
  },
33
33
  "peerDependencies": {
34
- "@aeriajs/types": "^0.0.115",
34
+ "@aeriajs/types": "^0.0.116",
35
35
  "bson": "^6.5.0"
36
36
  },
37
37
  "scripts": {