@rg-dev/stdlib
Advanced tools
+50
-11
@@ -49,3 +49,3 @@ "use strict"; | ||
| isRunningOnServer: () => isRunningOnServer, | ||
| joinUrlParts: () => joinUrlParts, | ||
| joinURL: () => joinURL2, | ||
| lazyValue: () => lazyValue, | ||
@@ -156,2 +156,49 @@ promiseRetry: () => promiseRetry, | ||
| // node_modules/ufo/dist/index.mjs | ||
| var r = String.fromCharCode; | ||
| var TRAILING_SLASH_RE = /\/$|\/\?|\/#/; | ||
| var JOIN_LEADING_SLASH_RE = /^\.?\//; | ||
| function hasTrailingSlash(input = "", respectQueryAndFragment) { | ||
| if (!respectQueryAndFragment) { | ||
| return input.endsWith("/"); | ||
| } | ||
| return TRAILING_SLASH_RE.test(input); | ||
| } | ||
| function withTrailingSlash(input = "", respectQueryAndFragment) { | ||
| if (!respectQueryAndFragment) { | ||
| return input.endsWith("/") ? input : input + "/"; | ||
| } | ||
| if (hasTrailingSlash(input, true)) { | ||
| return input || "/"; | ||
| } | ||
| let path = input; | ||
| let fragment = ""; | ||
| const fragmentIndex = input.indexOf("#"); | ||
| if (fragmentIndex !== -1) { | ||
| path = input.slice(0, fragmentIndex); | ||
| fragment = input.slice(fragmentIndex); | ||
| if (!path) { | ||
| return fragment; | ||
| } | ||
| } | ||
| const [s0, ...s] = path.split("?"); | ||
| return s0 + "/" + (s.length > 0 ? `?${s.join("?")}` : "") + fragment; | ||
| } | ||
| function isNonEmptyURL(url) { | ||
| return url && url !== "/"; | ||
| } | ||
| function joinURL(base, ...input) { | ||
| let url = base || ""; | ||
| for (const segment of input.filter((url2) => isNonEmptyURL(url2))) { | ||
| if (url) { | ||
| const _segment = segment.replace(JOIN_LEADING_SLASH_RE, ""); | ||
| url = withTrailingSlash(url) + _segment; | ||
| } else { | ||
| url = segment; | ||
| } | ||
| } | ||
| return url; | ||
| } | ||
| var protocolRelative = Symbol.for("ufo:protocolRelative"); | ||
| // src/common-env.ts | ||
@@ -280,12 +327,4 @@ var Optional = class _Optional { | ||
| } | ||
| function joinUrlParts(...parts) { | ||
| return parts.filter(Boolean).map( | ||
| (part, i) => { | ||
| part = String(part); | ||
| if (i === 0) { | ||
| return part.replace(/\/+$/g, ""); | ||
| } | ||
| return part.replace(/^\/+|\/+$/g, ""); | ||
| } | ||
| ).join("/").replace(/:\//g, "://"); | ||
| function joinURL2(base, ...input) { | ||
| return joinURL(base, ...input); | ||
| } |
@@ -79,4 +79,4 @@ export { VERSION } from './index.cjs'; | ||
| declare function lazyValue<T = unknown>(function_: () => T): () => T; | ||
| declare function joinUrlParts(...parts: string[]): string; | ||
| declare function joinURL(base: string, ...input: string[]): string; | ||
| export { type AsyncReturnType, type MaybeFunction, type MyFn, Optional, StringBuilder, catchInline, doSafe, fetchHelperJSON, fetchHelperPost, fetchHelperText, isNonEmptyString, isNumber, isRunningOnServer, joinUrlParts, lazyValue, promiseRetry, promiseWithTimeout, sleep, useServer }; | ||
| export { type AsyncReturnType, type MaybeFunction, type MyFn, Optional, StringBuilder, catchInline, doSafe, fetchHelperJSON, fetchHelperPost, fetchHelperText, isNonEmptyString, isNumber, isRunningOnServer, joinURL, lazyValue, promiseRetry, promiseWithTimeout, sleep, useServer }; |
@@ -79,4 +79,4 @@ export { VERSION } from './index.js'; | ||
| declare function lazyValue<T = unknown>(function_: () => T): () => T; | ||
| declare function joinUrlParts(...parts: string[]): string; | ||
| declare function joinURL(base: string, ...input: string[]): string; | ||
| export { type AsyncReturnType, type MaybeFunction, type MyFn, Optional, StringBuilder, catchInline, doSafe, fetchHelperJSON, fetchHelperPost, fetchHelperText, isNonEmptyString, isNumber, isRunningOnServer, joinUrlParts, lazyValue, promiseRetry, promiseWithTimeout, sleep, useServer }; | ||
| export { type AsyncReturnType, type MaybeFunction, type MyFn, Optional, StringBuilder, catchInline, doSafe, fetchHelperJSON, fetchHelperPost, fetchHelperText, isNonEmptyString, isNumber, isRunningOnServer, joinURL, lazyValue, promiseRetry, promiseWithTimeout, sleep, useServer }; |
+50
-11
@@ -116,2 +116,49 @@ var __defProp = Object.defineProperty; | ||
| // node_modules/ufo/dist/index.mjs | ||
| var r = String.fromCharCode; | ||
| var TRAILING_SLASH_RE = /\/$|\/\?|\/#/; | ||
| var JOIN_LEADING_SLASH_RE = /^\.?\//; | ||
| function hasTrailingSlash(input = "", respectQueryAndFragment) { | ||
| if (!respectQueryAndFragment) { | ||
| return input.endsWith("/"); | ||
| } | ||
| return TRAILING_SLASH_RE.test(input); | ||
| } | ||
| function withTrailingSlash(input = "", respectQueryAndFragment) { | ||
| if (!respectQueryAndFragment) { | ||
| return input.endsWith("/") ? input : input + "/"; | ||
| } | ||
| if (hasTrailingSlash(input, true)) { | ||
| return input || "/"; | ||
| } | ||
| let path = input; | ||
| let fragment = ""; | ||
| const fragmentIndex = input.indexOf("#"); | ||
| if (fragmentIndex !== -1) { | ||
| path = input.slice(0, fragmentIndex); | ||
| fragment = input.slice(fragmentIndex); | ||
| if (!path) { | ||
| return fragment; | ||
| } | ||
| } | ||
| const [s0, ...s] = path.split("?"); | ||
| return s0 + "/" + (s.length > 0 ? `?${s.join("?")}` : "") + fragment; | ||
| } | ||
| function isNonEmptyURL(url) { | ||
| return url && url !== "/"; | ||
| } | ||
| function joinURL(base, ...input) { | ||
| let url = base || ""; | ||
| for (const segment of input.filter((url2) => isNonEmptyURL(url2))) { | ||
| if (url) { | ||
| const _segment = segment.replace(JOIN_LEADING_SLASH_RE, ""); | ||
| url = withTrailingSlash(url) + _segment; | ||
| } else { | ||
| url = segment; | ||
| } | ||
| } | ||
| return url; | ||
| } | ||
| var protocolRelative = Symbol.for("ufo:protocolRelative"); | ||
| // src/common-env.ts | ||
@@ -240,12 +287,4 @@ var Optional = class _Optional { | ||
| } | ||
| function joinUrlParts(...parts) { | ||
| return parts.filter(Boolean).map( | ||
| (part, i) => { | ||
| part = String(part); | ||
| if (i === 0) { | ||
| return part.replace(/\/+$/g, ""); | ||
| } | ||
| return part.replace(/^\/+|\/+$/g, ""); | ||
| } | ||
| ).join("/").replace(/:\//g, "://"); | ||
| function joinURL2(base, ...input) { | ||
| return joinURL(base, ...input); | ||
| } | ||
@@ -264,3 +303,3 @@ export { | ||
| isRunningOnServer, | ||
| joinUrlParts, | ||
| joinURL2 as joinURL, | ||
| lazyValue, | ||
@@ -267,0 +306,0 @@ promiseRetry, |
+6
-5
| { | ||
| "name": "@rg-dev/stdlib", | ||
| "version": "1.0.59", | ||
| "version": "1.0.60", | ||
| "description": "", | ||
@@ -32,6 +32,6 @@ "scripts": { | ||
| ], | ||
| "lib/axios-helpers": [ | ||
| "lib/axios-helpers": [ | ||
| "lib/axios-helpers.d.ts" | ||
| ], | ||
| "lib/vite-helpers": [ | ||
| "lib/vite-helpers": [ | ||
| "lib/vite-helpers.d.ts" | ||
@@ -49,3 +49,3 @@ ] | ||
| }, | ||
| "./lib/axios-helpers": { | ||
| "./lib/axios-helpers": { | ||
| "import": "./lib/axios-helpers.js", | ||
@@ -79,3 +79,3 @@ "require": "./lib/axios-helpers.cjs", | ||
| }, | ||
| "./lib/vite-helpers": { | ||
| "./lib/vite-helpers": { | ||
| "import": "./lib/vite-helpers.js", | ||
@@ -93,2 +93,3 @@ "require": "./lib/vite-helpers.cjs", | ||
| "devDependencies": { | ||
| "ufo": "^1.6.3", | ||
| "@trpc/server": "^11.1.1", | ||
@@ -95,0 +96,0 @@ "@types/command-exists": "^1.2.3", |
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
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
596412
0.39%14870
0.51%16
6.67%