🚨 Active Supply Chain Attack:node-ipc Package Compromised.Learn More
Socket
Book a DemoSign in
Socket

@rg-dev/stdlib

Package Overview
Dependencies
Maintainers
1
Versions
64
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rg-dev/stdlib - npm Package Compare versions

Comparing version
1.0.59
to
1.0.60
+50
-11
lib/common-env.cjs

@@ -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);
}
+2
-2

@@ -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 };

@@ -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,

{
"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",