@briklab/lib 2.0.0 → 3.0.1
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.
- package/README.md +6 -2
- package/dist/native/load.js +2 -25
- package/dist/stylesheet/index.js +3 -3
- package/dist/stylesheet/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/cli-john/native/cli-john.node +0 -0
- package/dist/cli-john/node/index.d.ts +0 -7
- package/dist/cli-john/node/index.js +0 -15
- package/dist/color/native/color.node +0 -0
- package/dist/color/node/index.d.ts +0 -8
- package/dist/color/node/index.js +0 -19
- package/dist/jstc/native/jstc.node +0 -0
- package/dist/jstc/node/index.d.ts +0 -9
- package/dist/jstc/node/index.js +0 -14
- package/dist/stylesheet/native/stylesheet.node +0 -0
- package/dist/stylesheet/node/index.d.ts +0 -8
- package/dist/stylesheet/node/index.js +0 -14
- package/dist/warner/native/warner.node +0 -0
- package/dist/warner/node/index.d.ts +0 -9
- package/dist/warner/node/index.js +0 -24
package/README.md
CHANGED
|
@@ -2,9 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
### @briklab/lib is the core package for briklab packages
|
|
4
4
|
|
|
5
|
+
[Read Docs](https://briklab-docs.pages.dev/packages/lib/)
|
|
5
6
|
**It Introduces:**
|
|
6
|
-
- **@briklab/cli-john:** Generate a [CLI](https://en.wikipedia.org/wiki/Command-line_interface) with ease.
|
|
7
|
-
- **@briklab/jstc:** Add Type Checking for JavaScript.
|
|
7
|
+
- **@briklab/lib/cli-john:** Generate a [CLI](https://en.wikipedia.org/wiki/Command-line_interface) with ease.
|
|
8
|
+
- **@briklab/lib/jstc:** Add Type Checking for JavaScript.
|
|
9
|
+
- **@briklab/lib/color:** A color manipulation library.
|
|
10
|
+
- **@briklab/lib/stylesheet:** A CSS-in-JS library for styling components.
|
|
11
|
+
- **@briklab/lib/warner:** A set of utilities for creating and managing warnings in your code.
|
|
8
12
|
|
|
9
13
|
## Exports
|
|
10
14
|
|
package/dist/native/load.js
CHANGED
|
@@ -1,28 +1,5 @@
|
|
|
1
|
-
import fs from "node:fs";
|
|
2
|
-
import path from "node:path";
|
|
3
|
-
import { createRequire } from "node:module";
|
|
4
|
-
import { fileURLToPath } from "node:url";
|
|
5
|
-
const require = createRequire(import.meta.url);
|
|
6
1
|
export function loadNativeAddon(moduleUrl, addonName) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const candidates = [
|
|
10
|
-
path.join(moduleDir, "native", addonFile),
|
|
11
|
-
path.join(moduleDir, "..", "native", addonFile),
|
|
12
|
-
path.join(moduleDir, "build", "Release", addonFile),
|
|
13
|
-
path.join(moduleDir, "node", "build", "Release", addonFile),
|
|
14
|
-
path.join(moduleDir, "..", "..", "..", "src", addonName, "node", "build", "Release", addonFile),
|
|
15
|
-
path.join(moduleDir, "..", "..", "src", addonName, "node", "build", "Release", addonFile),
|
|
16
|
-
];
|
|
17
|
-
for (const candidate of candidates) {
|
|
18
|
-
if (!fs.existsSync(candidate))
|
|
19
|
-
continue;
|
|
20
|
-
try {
|
|
21
|
-
return require(candidate);
|
|
22
|
-
}
|
|
23
|
-
catch {
|
|
24
|
-
return null;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
2
|
+
void moduleUrl;
|
|
3
|
+
void addonName;
|
|
27
4
|
return null;
|
|
28
5
|
}
|
package/dist/stylesheet/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var y=function(a,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?a!==e||!i:!e.has(a))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(a,t):i?i.value=t:e.set(a,t),t},l=function(a,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?a!==e||!n:!e.has(a))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(a):n?n.value:e.get(a)},S,u,v,p,I,b,d,g;import f from"../jstc/index.js";import{CSSStyleDeclaration as _}from"cssom";import m from"../color/index.js";import{createWarner as k}from"../warner/index.js";import{loadNativeAddon as
|
|
2
|
-
`)}class ${constructor(e,t){S.add(this),u.set(this,"boundary"),p.set(this,void 0),d.set(this,void 0),t&&["none","boundary","sandbox","hardened"].includes(t)&&y(this,u,t,"f"),f.for([e]).check(["object|undefined"])||(l(this,S,"m",v).call(this,e),e={imeMode:`${e}`}),y(this,d,e,"f"),y(this,p,new _,"f")}generate(){let e=l(this,p,"f"),t=l(this,d,"f"),n=Object.keys(t),i=Object.values(t);for(let s=0;s<n.length;s++){const h=n[s];let c=i[s];if(c==null){o.warn({message:r("InlineStyle.generate",`Skipping property "${h}" with ${JSON.stringify(c)} value.`,"Avoid null or undefined style values.")});continue}typeof c!="string"&&(o.warn({message:r("InlineStyle.generate",`Non-string style value for "${h}" (type=${typeof c}).`,"Provide style values as strings.","Coercing value to string.")}),c=
|
|
3
|
-
`)}return e.trim()}toString(){return this.generate()}}g=new WeakMap;var
|
|
1
|
+
var y=function(a,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?a!==e||!i:!e.has(a))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(a,t):i?i.value=t:e.set(a,t),t},l=function(a,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?a!==e||!n:!e.has(a))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(a):n?n.value:e.get(a)},S,u,v,p,I,b,d,g;import f from"../jstc/index.js";import{CSSStyleDeclaration as _}from"cssom";import m from"../color/index.js";import{createWarner as k}from"../warner/index.js";import{loadNativeAddon as T}from"../native/load.js";const o=k("@briklab/lib/stylesheet"),O=T(import.meta.url,"stylesheet");function r(a,e,t,n){return[`[${a}] @briklab/lib/stylesheet: ${e}`,t?`Hint: ${t}`:void 0,n].filter(i=>!!i).join(`
|
|
2
|
+
`)}class ${constructor(e,t){S.add(this),u.set(this,"boundary"),p.set(this,void 0),d.set(this,void 0),t&&["none","boundary","sandbox","hardened"].includes(t)&&y(this,u,t,"f"),f.for([e]).check(["object|undefined"])||(l(this,S,"m",v).call(this,e),e={imeMode:`${e}`}),y(this,d,e,"f"),y(this,p,new _,"f")}generate(){let e=l(this,p,"f"),t=l(this,d,"f"),n=Object.keys(t),i=Object.values(t);for(let s=0;s<n.length;s++){const h=n[s];let c=i[s];if(c==null){o.warn({message:r("InlineStyle.generate",`Skipping property "${h}" with ${JSON.stringify(c)} value.`,"Avoid null or undefined style values.")});continue}typeof c!="string"&&(o.warn({message:r("InlineStyle.generate",`Non-string style value for "${h}" (type=${typeof c}).`,"Provide style values as strings.","Coercing value to string.")}),c=String(c)),e.setProperty(h,c)}return e.cssText}get text(){return this.generate()}get ansi(){const e=l(this,d,"f")||{};let t=[];(e["font-weight"]==="bold"||e.fontWeight==="bold")&&t.push(m.BOLD),(e["text-decoration"]||e.textDecoration||"").includes("underline")&&t.push(m.UNDERLINE);const n=e.color||e.color;if(n)try{const s=new m(String(n));t.push(s.ansiTruecolor())}catch{o.warn({message:r("InlineStyle.ansi",`Invalid color value "${JSON.stringify(n)}".`,"Use a valid hex, rgb(), hsl(), or named color.","Ignoring this color value.")})}const i=e["background-color"]||e.backgroundColor;if(i)try{const s=new m(String(i));t.push(s.ansiTruecolorBg())}catch{o.warn({message:r("InlineStyle.ansi",`Invalid background-color value "${JSON.stringify(i)}".`,"Use a valid hex, rgb(), hsl(), or named color.","Ignoring this background color value.")})}return t.join("")}addStyleWithObject(e){return f.for([e]).check(["object"])?(y(this,d,{...l(this,d,"f"),...e},"f"),this.generate(),this):(o.warn({message:r("InlineStyle.addStyleWithObject","Invalid first argument.",`Expected a plain object with CSS properties. Received: ${JSON.stringify(e)}.`,"Returning without changes.")}),this)}addStyleWithInlineCSS(e){if(!f.for([e]).check(["string"]))return o.warn({message:r("InlineStyle.addStyleWithInlineCSS","Invalid first argument.","The first argument must be a valid inline CSS string.","Returning without changes.")}),this;let t=new _;t.cssText=l(this,S,"m",b).call(this,e);let n={};for(let i=0;i<t.length;i++){const s=t[i],h=t.getPropertyValue(s);n[s]=h}return this.addStyleWithObject(n),this}removeStyle(e){if(!f.for([e]).check(["string[]|string"]))return o.warn({message:r("InlineStyle.removeStyle","Invalid first argument.",`Expected a string or an array of strings. Received: ${JSON.stringify(e)}.`,"Returning without changes.")}),this;typeof e=="string"&&(e=[e]);for(let t=0;t<e.length;t++){const n=e[t];if(typeof n!="string"){o.warn({message:r("InlineStyle.removeStyle",`Ignoring non-string style name at index ${t}: ${JSON.stringify(n)}.`)});continue}delete l(this,d,"f")[n]}return this}applyTo(e){return f.for([e]).check(["object"])?!e||typeof e.style!="object"?(o.warn({message:r("InlineStyle.applyTo","The given object does not look like an HTMLElement (missing .style).",void 0,"No operation was performed.")}),this):(e.style.cssText=this.generate(),this):(o.warn({message:r("InlineStyle.applyTo","Invalid first argument.","Expected an HTMLElement.","No operation was performed.")}),this)}}u=new WeakMap,p=new WeakMap,d=new WeakMap,S=new WeakSet,v=function(e){if(l(this,u,"f")==="hardened")throw new Error(r("InlineStyle.constructor","Invalid style object.","Expected a plain object with CSS properties."));l(this,u,"f")==="sandbox"?o.warn({message:r("InlineStyle.constructor","Invalid style object.","Expected a plain object with CSS properties.")}):l(this,u,"f")==="boundary"&&o.warn({message:r("InlineStyle.constructor","Invalid style object.","Expected a plain object with CSS properties.","Using a fallback style object.")})},I=function(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)},b=function(e){const t=e.split(";");let n="";for(let i=0;i<t.length;i++){const s=t[i].trim();if(!s)continue;const h=s.split(":");if(h.length<2){o.warn({message:r("InlineStyle.convertKeysToValidCSS",`Skipping malformed rule: "${s}".`,'Expected "property: value" pairs separated by ";".')});continue}const c=h[0].trim(),w=h.slice(1).join(":").trim();if(!c||!w){o.warn({message:r("InlineStyle.convertKeysToValidCSS",`Skipping empty property or value in rule: "${s}".`)});continue}n+=`${l(this,S,"m",I).call(this,c)}:${w};`}return n};class R{constructor(){g.set(this,void 0),y(this,g,{},"f")}set(e,t){return f.for([e,t]).check(["string","object"])?t instanceof $?(l(this,g,"f")[e]=t,this):(o.warn({message:r("StyleSheet.set","The provided style is not an InlineStyle instance.",`Create the style with new InlineStyle({...}). Received: ${JSON.stringify(t)}.`,"Returning without changes.")}),this):(o.warn({message:r("StyleSheet.set","Invalid arguments.",`Call .set("ruleName", new InlineStyle({...})). Received name=${JSON.stringify(e)}, style=${JSON.stringify(t)}.`,"Returning without changes.")}),this)}get(e){if(!f.for([e]).check(["string"])){o.warn({message:r("StyleSheet.get","Invalid argument.",`Name must be a string. Received: ${JSON.stringify(e)}.`,"Returning undefined.")});return}return l(this,g,"f")[e]}remove(e){return f.for([e]).check(["string"])?(delete l(this,g,"f")[e],this):(o.warn({message:r("StyleSheet.remove","Invalid argument.",`Name must be a string. Received: ${JSON.stringify(e)}.`,"No operation was performed.")}),this)}generate(){let e="";for(const t in l(this,g,"f")){const n=l(this,g,"f")[t];n&&(e+=`${t} { ${n.text} }
|
|
3
|
+
`)}return e.trim()}toString(){return this.generate()}}g=new WeakMap;var W=$;export{$ as InlineStyle,R as StyleSheet,W as default,O as native};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["index.js"],
|
|
4
|
-
"mappings": "AAIA,IAAIA,EAAkE,SAAUC,EAAUC,EAAOC,EAAOC,EAAMC,EAAG,CAC7G,GAAID,IAAS,IAAK,MAAM,IAAI,UAAU,gCAAgC,EACtE,GAAIA,IAAS,KAAO,CAACC,EAAG,MAAM,IAAI,UAAU,+CAA+C,EAC3F,GAAI,OAAOH,GAAU,WAAaD,IAAaC,GAAS,CAACG,EAAI,CAACH,EAAM,IAAID,CAAQ,EAAG,MAAM,IAAI,UAAU,yEAAyE,EAChL,OAAQG,IAA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iB,KAAK,CAAE,QAASE,EAAwB,oBAAqB,oBAAqB,oCAAoC,KAAK,UAAUiC,CAAI,CAAC,IAAK,6BAA6B,CAAE,CAAC,EACzL,KAIf,CAIA,UAAW,CACP,IAAIE,EAAM,GACV,UAAWC,KAAOpD,EAAuB,KAAMQ,EAAoB,GAAG,EAAG,CACrE,MAAM0C,EAAQlD,EAAuB,KAAMQ,EAAoB,GAAG,EAAE4C,CAAG,EACnEF,IACAC,GAAO,GAAGC,CAAG,MAAMF,EAAM,IAAI;AAAA,EAErC,CACA,OAAOC,EAAI,KAAK,CACpB,CAIA,UAAW,CACP,OAAO,KAAK,SAAS,CACzB,CACJ,CACA3C,EAAqB,IAAI,QACzB,IAAO6C,EAAQ/B",
|
|
5
5
|
"names": ["__classPrivateFieldSet", "receiver", "state", "value", "kind", "f", "__classPrivateFieldGet", "_InlineStyle_instances", "_InlineStyle_protectionLevel", "_InlineStyle_handleInvalidStyleObject", "_InlineStyle_cssStyleDec", "_InlineStyle_convertFieldToHyphenCase", "_InlineStyle_convertKeysToValidCSS", "_InlineStyle_styleObject", "_StyleSheet_styles", "JSTC", "UUIII", "Color", "createWarner", "loadNativeAddon", "stylesheetWarner", "native", "formatStylesheetMessage", "scope", "message", "hint", "otherMessage", "line", "InlineStyle", "styleObject", "protectionLevel", "a", "b", "c", "d", "i", "prop", "val", "s", "parts", "colorVal", "bgVal", "inlineCSS", "o", "v", "styles", "element", "input", "string", "match", "out", "raw", "kv", "k", "StyleSheet", "name", "style", "css", "key", "index_default"]
|
|
6
6
|
}
|
package/package.json
CHANGED
|
Binary file
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { loadNativeAddon } from "../../native/load.js";
|
|
2
|
-
import { CLI as JsCLI } from "../index.js";
|
|
3
|
-
export const native = loadNativeAddon(import.meta.url, "cli-john");
|
|
4
|
-
export const CLI = native?.CLI ?? JsCLI;
|
|
5
|
-
export default CLI;
|
|
6
|
-
export const parseArgv = (argv) => {
|
|
7
|
-
if (native?.CLI) {
|
|
8
|
-
const cli = new native.CLI();
|
|
9
|
-
return cli.parse(argv);
|
|
10
|
-
}
|
|
11
|
-
const cli = new JsCLI(process);
|
|
12
|
-
if (typeof cli.parse === "function")
|
|
13
|
-
return cli.parse(argv);
|
|
14
|
-
return {};
|
|
15
|
-
};
|
|
Binary file
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import JsColor from "../index.js";
|
|
2
|
-
export declare const native: {
|
|
3
|
-
[x: string]: unknown;
|
|
4
|
-
} | null;
|
|
5
|
-
export declare const Color: typeof JsColor;
|
|
6
|
-
export default Color;
|
|
7
|
-
export declare const hexFromRgb: (r: number, g: number, b: number) => string;
|
|
8
|
-
export declare const ansiTruecolor: (r: number, g: number, b: number) => string;
|
package/dist/color/node/index.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { loadNativeAddon } from "../../native/load.js";
|
|
2
|
-
import JsColor from "../index.js";
|
|
3
|
-
export const native = loadNativeAddon(import.meta.url, "color");
|
|
4
|
-
export const Color = native?.Color ?? JsColor;
|
|
5
|
-
export default Color;
|
|
6
|
-
export const hexFromRgb = (r, g, b) => {
|
|
7
|
-
if (native?.Color) {
|
|
8
|
-
const c = new native.Color({ r, g, b });
|
|
9
|
-
return c.hex();
|
|
10
|
-
}
|
|
11
|
-
return new JsColor({ r, g, b }).hex();
|
|
12
|
-
};
|
|
13
|
-
export const ansiTruecolor = (r, g, b) => {
|
|
14
|
-
if (native?.Color) {
|
|
15
|
-
const c = new native.Color({ r, g, b });
|
|
16
|
-
return c.ansiTruecolor();
|
|
17
|
-
}
|
|
18
|
-
return new JsColor({ r, g, b }).ansiTruecolor();
|
|
19
|
-
};
|
|
Binary file
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { JSTypeChecker as JsJSTypeChecker } from "../index.js";
|
|
2
|
-
export declare const native: {
|
|
3
|
-
[x: string]: unknown;
|
|
4
|
-
} | null;
|
|
5
|
-
export declare const JSTypeChecker: typeof JsJSTypeChecker;
|
|
6
|
-
declare const JSTC: JsJSTypeChecker;
|
|
7
|
-
export default JSTC;
|
|
8
|
-
export declare const getNativeInfo: () => unknown;
|
|
9
|
-
export declare const formatMessage: (scope: string, message: string, hint?: string, otherMessage?: string) => string;
|
package/dist/jstc/node/index.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { JSTypeChecker as JsJSTypeChecker } from "../index.js";
|
|
2
|
-
import { loadNativeAddon } from "../../native/load.js";
|
|
3
|
-
export const native = loadNativeAddon(import.meta.url, "jstc");
|
|
4
|
-
export const JSTypeChecker = native?.JSTypeChecker ?? JsJSTypeChecker;
|
|
5
|
-
const JSTC = new JSTypeChecker();
|
|
6
|
-
export default JSTC;
|
|
7
|
-
export const getNativeInfo = typeof native?.getInfo === "function" ? native.getInfo : () => null;
|
|
8
|
-
export const formatMessage = (scope, message, hint, otherMessage) => {
|
|
9
|
-
const checker = JSTC;
|
|
10
|
-
if (typeof checker.formatMessage === "function") {
|
|
11
|
-
return checker.formatMessage(scope, message, hint, otherMessage);
|
|
12
|
-
}
|
|
13
|
-
return `[${scope}] @briklab/lib/jstc/node: ${message}${hint ? `\nHint: ${hint}` : ""}${otherMessage ? `\n${otherMessage}` : ""}`;
|
|
14
|
-
};
|
|
Binary file
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import JsInlineStyle, { StyleSheet as JsStyleSheet } from "../index.js";
|
|
2
|
-
export declare const native: {
|
|
3
|
-
[x: string]: unknown;
|
|
4
|
-
} | null;
|
|
5
|
-
export declare const InlineStyle: typeof JsInlineStyle;
|
|
6
|
-
export declare const StyleSheet: typeof JsStyleSheet;
|
|
7
|
-
export default InlineStyle;
|
|
8
|
-
export declare const normalizeInlineCss: (css: string) => string;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import JsInlineStyle, { StyleSheet as JsStyleSheet } from "../index.js";
|
|
2
|
-
import { loadNativeAddon } from "../../native/load.js";
|
|
3
|
-
export const native = loadNativeAddon(import.meta.url, "stylesheet");
|
|
4
|
-
export const InlineStyle = native?.InlineStyle ?? JsInlineStyle;
|
|
5
|
-
export const StyleSheet = native?.StyleSheet ?? JsStyleSheet;
|
|
6
|
-
export default InlineStyle;
|
|
7
|
-
export const normalizeInlineCss = (css) => {
|
|
8
|
-
const style = new InlineStyle({});
|
|
9
|
-
if (typeof style.addStyleWithInlineCSS === "function" && typeof style.generate === "function") {
|
|
10
|
-
style.addStyleWithInlineCSS(css);
|
|
11
|
-
return style.generate();
|
|
12
|
-
}
|
|
13
|
-
return css;
|
|
14
|
-
};
|
|
Binary file
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import JsWarner, { type WarnerOptions, type WarningLevel } from "../index.js";
|
|
2
|
-
export declare const native: {
|
|
3
|
-
[x: string]: unknown;
|
|
4
|
-
} | null;
|
|
5
|
-
export declare const Warner: typeof JsWarner;
|
|
6
|
-
export default Warner;
|
|
7
|
-
export declare const warner: JsWarner;
|
|
8
|
-
export declare function createWarner(packageName: string, options?: WarnerOptions | WarningLevel): JsWarner;
|
|
9
|
-
export declare const formatWarning: (message: string, hint?: string, source?: string) => string;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import JsWarner from "../index.js";
|
|
2
|
-
import { loadNativeAddon } from "../../native/load.js";
|
|
3
|
-
export const native = loadNativeAddon(import.meta.url, "warner");
|
|
4
|
-
export const Warner = native?.Warner ?? JsWarner;
|
|
5
|
-
export default Warner;
|
|
6
|
-
const getDefaultLevel = () => {
|
|
7
|
-
if (typeof process !== "undefined" && process.env?.BRIKLAB_WARNING_LEVEL) {
|
|
8
|
-
const level = process.env.BRIKLAB_WARNING_LEVEL.toLowerCase();
|
|
9
|
-
if (["silent", "summary", "full"].includes(level))
|
|
10
|
-
return level;
|
|
11
|
-
}
|
|
12
|
-
return "summary";
|
|
13
|
-
};
|
|
14
|
-
export const warner = new Warner({ level: getDefaultLevel() });
|
|
15
|
-
export function createWarner(packageName, options) {
|
|
16
|
-
const opts = typeof options === "string" ? { packageName, level: options } : { packageName, ...options };
|
|
17
|
-
return new Warner(opts);
|
|
18
|
-
}
|
|
19
|
-
export const formatWarning = (message, hint, source) => {
|
|
20
|
-
const w = new Warner({ level: "silent" });
|
|
21
|
-
if (typeof w.formatWarning === "function")
|
|
22
|
-
return w.formatWarning(message, hint, source);
|
|
23
|
-
return `${source ? `[${source}] ` : ""}${message}${hint ? `\nHint: ${hint}` : ""}`;
|
|
24
|
-
};
|