@rg-dev/stdlib
Advanced tools
| "use strict"; | ||
| var __defProp = Object.defineProperty; | ||
| var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
| var __getOwnPropNames = Object.getOwnPropertyNames; | ||
| var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
| var __export = (target, all) => { | ||
| for (var name in all) | ||
| __defProp(target, name, { get: all[name], enumerable: true }); | ||
| }; | ||
| var __copyProps = (to, from, except, desc) => { | ||
| if (from && typeof from === "object" || typeof from === "function") { | ||
| for (let key of __getOwnPropNames(from)) | ||
| if (!__hasOwnProp.call(to, key) && key !== except) | ||
| __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
| } | ||
| return to; | ||
| }; | ||
| var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
| // src/vite-helpers.ts | ||
| var vite_helpers_exports = {}; | ||
| __export(vite_helpers_exports, { | ||
| VERSION: () => VERSION, | ||
| createViteMiddleware: () => createViteMiddleware | ||
| }); | ||
| module.exports = __toCommonJS(vite_helpers_exports); | ||
| // src/index.ts | ||
| var VERSION = "1"; | ||
| // src/common-env.ts | ||
| function isNonEmptyString(str) { | ||
| return typeof str == "string" && str.trim().length > 0; | ||
| } | ||
| // src/vite-helpers.ts | ||
| async function createViteMiddleware(rootPath, editHtmlFn) { | ||
| if (!isNonEmptyString(rootPath)) { | ||
| throw new Error("invalid rootPath"); | ||
| } | ||
| console.log(`starting vite middleware in ${rootPath}`); | ||
| const vite = await require(Function(`return 'vite'`)()).createServer( | ||
| { | ||
| root: rootPath, | ||
| logLevel: "info", | ||
| server: { | ||
| middlewareMode: true, | ||
| watch: { | ||
| usePolling: true, | ||
| interval: 300 | ||
| } | ||
| }, | ||
| plugins: [ | ||
| { | ||
| name: "html-base-url", | ||
| transformIndexHtml(html) { | ||
| return (editHtmlFn == null ? void 0 : editHtmlFn(html)) || html; | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| ); | ||
| return vite.middlewares; | ||
| } |
| import { Handler } from 'express'; | ||
| export { VERSION } from './index.cjs'; | ||
| declare function createViteMiddleware(rootPath: string, editHtmlFn?: (html: string) => string): Promise<Handler>; | ||
| export { createViteMiddleware }; |
| import { Handler } from 'express'; | ||
| export { VERSION } from './index.js'; | ||
| declare function createViteMiddleware(rootPath: string, editHtmlFn?: (html: string) => string): Promise<Handler>; | ||
| export { createViteMiddleware }; |
| var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { | ||
| get: (a, b) => (typeof require !== "undefined" ? require : a)[b] | ||
| }) : x)(function(x) { | ||
| if (typeof require !== "undefined") return require.apply(this, arguments); | ||
| throw Error('Dynamic require of "' + x + '" is not supported'); | ||
| }); | ||
| // src/index.ts | ||
| var VERSION = "1"; | ||
| // src/common-env.ts | ||
| function isNonEmptyString(str) { | ||
| return typeof str == "string" && str.trim().length > 0; | ||
| } | ||
| // src/vite-helpers.ts | ||
| async function createViteMiddleware(rootPath, editHtmlFn) { | ||
| if (!isNonEmptyString(rootPath)) { | ||
| throw new Error("invalid rootPath"); | ||
| } | ||
| console.log(`starting vite middleware in ${rootPath}`); | ||
| const vite = await __require(Function(`return 'vite'`)()).createServer( | ||
| { | ||
| root: rootPath, | ||
| logLevel: "info", | ||
| server: { | ||
| middlewareMode: true, | ||
| watch: { | ||
| usePolling: true, | ||
| interval: 300 | ||
| } | ||
| }, | ||
| plugins: [ | ||
| { | ||
| name: "html-base-url", | ||
| transformIndexHtml(html) { | ||
| return (editHtmlFn == null ? void 0 : editHtmlFn(html)) || html; | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| ); | ||
| return vite.middlewares; | ||
| } | ||
| export { | ||
| VERSION, | ||
| createViteMiddleware | ||
| }; |
+1
-0
@@ -7,3 +7,4 @@ import './browser-env'; | ||
| import './axios-helpers' | ||
| import './vite-helpers' | ||
| export declare const VERSION:string |
+1
-0
@@ -7,3 +7,4 @@ import './browser-env'; | ||
| import './axios-helpers' | ||
| import './vite-helpers' | ||
| export declare const VERSION:string |
+9
-1
| { | ||
| "name": "@rg-dev/stdlib", | ||
| "version": "1.0.57", | ||
| "version": "1.0.58", | ||
| "description": "", | ||
@@ -34,2 +34,5 @@ "scripts": { | ||
| "lib/axios-helpers.d.ts" | ||
| ], | ||
| "lib/vite-helpers": [ | ||
| "lib/vite-helpers.d.ts" | ||
| ] | ||
@@ -74,2 +77,7 @@ } | ||
| "types": "./lib/node-download.d.ts" | ||
| }, | ||
| "./lib/vite-helpers": { | ||
| "import": "./lib/vite-helpers.js", | ||
| "require": "./lib/vite-helpers.cjs", | ||
| "types": "./lib/vite-helpers.d.ts" | ||
| } | ||
@@ -76,0 +84,0 @@ }, |
Network access
Supply chain riskThis module accesses the network.
Found 4 instances in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 2 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 4 instances in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 2 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
593379
0.67%33
13.79%14769
0.75%68
1.49%130
1.56%