@varlet/shared 3.7.2 → 3.7.3

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/lib/index.cjs CHANGED
@@ -21,22 +21,34 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
21
21
  // src/index.ts
22
22
  var src_exports = {};
23
23
  __export(src_exports, {
24
- isURL: () => isURL
24
+ assert: () => assert,
25
+ error: () => error,
26
+ isURL: () => isURL,
27
+ warn: () => warn
25
28
  });
26
29
  module.exports = __toCommonJS(src_exports);
27
-
28
- // src/is.ts
30
+ var import_rattail = require("rattail");
31
+ __reExport(src_exports, require("rattail"), module.exports);
32
+ function assert(condition, source, message) {
33
+ return (0, import_rattail.assert)(condition, `Varlet [${source}]: ${message}`);
34
+ }
35
+ function warn(source, message) {
36
+ console.warn(`Varlet [${source}]: ${message}`);
37
+ }
38
+ function error(source, message) {
39
+ console.error(`Varlet [${source}]: ${message}`);
40
+ }
29
41
  var isURL = (val) => {
30
42
  if (!val) {
31
43
  return false;
32
44
  }
33
45
  return /^(http)|(\.*\/)/.test(val);
34
46
  };
35
-
36
- // src/index.ts
37
- __reExport(src_exports, require("rattail"), module.exports);
38
47
  // Annotate the CommonJS export names for ESM import in node:
39
48
  0 && (module.exports = {
49
+ assert,
50
+ error,
40
51
  isURL,
52
+ warn,
41
53
  ...require("rattail")
42
54
  });
package/lib/index.d.cts CHANGED
@@ -1,5 +1,8 @@
1
1
  export * from 'rattail';
2
2
 
3
+ declare function assert(condition: boolean, source: string, message: string): asserts condition;
4
+ declare function warn(source: string, message: string): void;
5
+ declare function error(source: string, message: string): void;
3
6
  declare const isURL: (val: string | undefined | null) => boolean;
4
7
 
5
- export { isURL };
8
+ export { assert, error, isURL, warn };
package/lib/index.d.ts CHANGED
@@ -1,5 +1,8 @@
1
1
  export * from 'rattail';
2
2
 
3
+ declare function assert(condition: boolean, source: string, message: string): asserts condition;
4
+ declare function warn(source: string, message: string): void;
5
+ declare function error(source: string, message: string): void;
3
6
  declare const isURL: (val: string | undefined | null) => boolean;
4
7
 
5
- export { isURL };
8
+ export { assert, error, isURL, warn };
package/lib/index.js CHANGED
@@ -1,13 +1,24 @@
1
- // src/is.ts
1
+ // src/index.ts
2
+ import { assert as _assert } from "rattail";
3
+ export * from "rattail";
4
+ function assert(condition, source, message) {
5
+ return _assert(condition, `Varlet [${source}]: ${message}`);
6
+ }
7
+ function warn(source, message) {
8
+ console.warn(`Varlet [${source}]: ${message}`);
9
+ }
10
+ function error(source, message) {
11
+ console.error(`Varlet [${source}]: ${message}`);
12
+ }
2
13
  var isURL = (val) => {
3
14
  if (!val) {
4
15
  return false;
5
16
  }
6
17
  return /^(http)|(\.*\/)/.test(val);
7
18
  };
8
-
9
- // src/index.ts
10
- export * from "rattail";
11
19
  export {
12
- isURL
20
+ assert,
21
+ error,
22
+ isURL,
23
+ warn
13
24
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@varlet/shared",
3
- "version": "3.7.2",
3
+ "version": "3.7.3",
4
4
  "type": "module",
5
5
  "main": "lib/index.cjs",
6
6
  "module": "lib/index.js",
@@ -33,7 +33,7 @@
33
33
  "url": "https://github.com/varletjs/varlet/issues"
34
34
  },
35
35
  "dependencies": {
36
- "rattail": "1.0.14"
36
+ "rattail": "1.0.17"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@types/node": "^18.7.18",