vite-plugin-qrcode 0.1.0 → 0.1.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/dist/index.cjs CHANGED
@@ -4,33 +4,27 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __getProtoOf = Object.getPrototypeOf;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
7
  var __export = (target, all) => {
9
8
  for (var name in all)
10
9
  __defProp(target, name, { get: all[name], enumerable: true });
11
10
  };
12
- var __reExport = (target, module2, copyDefault, desc) => {
13
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
- for (let key of __getOwnPropNames(module2))
15
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
16
  }
18
- return target;
17
+ return to;
19
18
  };
20
- var __toESM = (module2, isNodeMode) => {
21
- return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
- };
23
- var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
- return (module2, temp) => {
25
- return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
- };
27
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
21
 
29
22
  // src/index.ts
30
23
  var src_exports = {};
31
24
  __export(src_exports, {
32
25
  qrcode: () => qrcode
33
26
  });
27
+ module.exports = __toCommonJS(src_exports);
34
28
  var import_os = __toESM(require("os"), 1);
35
29
  var import_qrcode_terminal = __toESM(require("qrcode-terminal"), 1);
36
30
  function qrcode(options = {}) {
@@ -79,7 +73,7 @@ function getNetworkUrls(server, options) {
79
73
  const protocol = server.config.server.https ? "https" : "http";
80
74
  const port = address.port;
81
75
  const base = server.config.base;
82
- return Object.values(import_os.default.networkInterfaces()).flatMap((nInterface) => nInterface != null ? nInterface : []).filter((detail) => detail && detail.address && detail.family === "IPv4" && !detail.address.includes("127.0.0.1") && (!options.filter || options.filter(detail.address))).map((detail) => `${protocol}://${detail.address}:${port}${base}`);
76
+ return Object.values(import_os.default.networkInterfaces()).flatMap((nInterface) => nInterface != null ? nInterface : []).filter((detail) => detail && detail.address && (detail.family === "IPv4" || detail.family === 4) && !detail.address.includes("127.0.0.1") && (!options.filter || options.filter(detail.address))).map((detail) => `${protocol}://${detail.address}:${port}${base}`);
83
77
  }
84
78
  function isAddressInfo(v) {
85
79
  return v.address;
@@ -96,7 +90,6 @@ function resolveHostname(optionsHost) {
96
90
  const name = optionsHost !== "127.0.0.1" && host === "127.0.0.1" || host === "0.0.0.0" || host === "::" || host === void 0 ? "localhost" : host;
97
91
  return { host, name };
98
92
  }
99
- module.exports = __toCommonJS(src_exports);
100
93
  // Annotate the CommonJS export names for ESM import in node:
101
94
  0 && (module.exports = {
102
95
  qrcode
package/dist/index.js CHANGED
@@ -47,7 +47,7 @@ function getNetworkUrls(server, options) {
47
47
  const protocol = server.config.server.https ? "https" : "http";
48
48
  const port = address.port;
49
49
  const base = server.config.base;
50
- return Object.values(os.networkInterfaces()).flatMap((nInterface) => nInterface != null ? nInterface : []).filter((detail) => detail && detail.address && detail.family === "IPv4" && !detail.address.includes("127.0.0.1") && (!options.filter || options.filter(detail.address))).map((detail) => `${protocol}://${detail.address}:${port}${base}`);
50
+ return Object.values(os.networkInterfaces()).flatMap((nInterface) => nInterface != null ? nInterface : []).filter((detail) => detail && detail.address && (detail.family === "IPv4" || detail.family === 4) && !detail.address.includes("127.0.0.1") && (!options.filter || options.filter(detail.address))).map((detail) => `${protocol}://${detail.address}:${port}${base}`);
51
51
  }
52
52
  function isAddressInfo(v) {
53
53
  return v.address;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vite-plugin-qrcode",
3
3
  "description": "Show QR code on server start",
4
- "version": "0.1.0",
4
+ "version": "0.1.1",
5
5
  "license": "MIT",
6
6
  "author": "bluwy",
7
7
  "type": "module",
@@ -44,9 +44,9 @@
44
44
  },
45
45
  "devDependencies": {
46
46
  "@types/qrcode-terminal": "^0.12.0",
47
- "rollup": "^2.70.0",
47
+ "rollup": "^2.71.1",
48
48
  "uvu": "^0.5.3",
49
- "vite": "^2.8.6"
49
+ "vite": "^2.9.6"
50
50
  },
51
51
  "scripts": {
52
52
  "dev": "tsup-node --sourcemap --watch src",