@yaasl/utils 0.10.1 → 0.11.0-alpha.0

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.
@@ -3,7 +3,7 @@ export declare class Thenable<T = undefined> implements PromiseLike<T> {
3
3
  private value?;
4
4
  constructor(value?: T | undefined);
5
5
  then<Result = T, Reject = never>(onfulfilled?: Executor<T, Result>, onrejected?: Executor<any, Reject>): PromiseLike<Result | Reject>;
6
- static isThenable(item: unknown): boolean;
6
+ static isThenable(item: unknown): item is Thenable<any>;
7
7
  static all(items: PromiseLike<any>[]): Promise<any[]> | Thenable<unknown[]>;
8
8
  }
9
9
  export {};
@@ -1,4 +1,6 @@
1
- export declare const consoleMessage: (text: string) => string;
1
+ export declare const consoleMessage: (text: string, { scope }?: {
2
+ scope?: string;
3
+ }) => string;
2
4
  export declare const log: {
3
5
  warn: (text: string, value?: unknown) => void;
4
6
  error: (text: string, value?: unknown) => void;
package/dist/cjs/log.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.log = exports.consoleMessage = void 0;
4
- const consoleMessage = (text) => `${text} (yaasl)`;
4
+ const consoleMessage = (text, { scope } = {}) => (scope ? `[yaasl][${scope}]: ${text}` : `[yaasl]: ${text}`);
5
5
  exports.consoleMessage = consoleMessage;
6
6
  const logger = (type, text, value) => console[type]((0, exports.consoleMessage)(text), ...(!value ? [] : ["\n\n", value]));
7
7
  exports.log = {
package/dist/mjs/log.js CHANGED
@@ -1,4 +1,4 @@
1
- export const consoleMessage = (text) => `${text} (yaasl)`;
1
+ export const consoleMessage = (text, { scope } = {}) => (scope ? `[yaasl][${scope}]: ${text}` : `[yaasl]: ${text}`);
2
2
  const logger = (type, text, value) => console[type](consoleMessage(text), ...(!value ? [] : ["\n\n", value]));
3
3
  export const log = {
4
4
  warn: (text, value) => logger("warn", text, value),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yaasl/utils",
3
- "version": "0.10.1",
3
+ "version": "0.11.0-alpha.0",
4
4
  "description": "Utilities for @yaasl packages",
5
5
  "author": "PrettyCoffee",
6
6
  "license": "MIT",