New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@scalar/oas-utils

Package Overview
Dependencies
Maintainers
0
Versions
120
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@scalar/oas-utils - npm Package Compare versions

Comparing version 0.2.76 to 0.2.77

6

CHANGELOG.md
# @scalar/oas-utils
## 0.2.77
### Patch Changes
- 44a7100: fix: handle no protocol prefix
## 0.2.76

@@ -4,0 +10,0 @@

2

dist/helpers/redirectToProxy.d.ts
/** Redirects the request to a proxy server with a given URL. */
export declare function redirectToProxy(proxy?: string, url?: string): string;
/** Check if the URL is relative, aka doesn't start with http[s] */
/** Check if the URL is relative or if it's a domain without protocol */
export declare const isRelativePath: (url: string) => boolean;

@@ -5,0 +5,0 @@ /** Returns false for requests to localhost, relative URLs, if no proxy is defined … */

@@ -16,4 +16,15 @@ import { isLocalUrl } from './isLocalUrl.js';

}
/** Check if the URL is relative, aka doesn't start with http[s] */
const isRelativePath = (url) => !/^https?:\/\//.test(url);
/** Check if the URL is relative or if it's a domain without protocol */
const isRelativePath = (url) => {
// Absolute URLs start with http:// or https://
if (url.startsWith('http://') || url.startsWith('https://')) {
return false;
}
// Check if it looks like a domain (contains dots and no spaces)
// This catches cases like "galaxy.scalar.com/planets"
if (/^[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+(\/|$)/.test(url)) {
return false;
}
return true;
};
/** Returns false for requests to localhost, relative URLs, if no proxy is defined … */

@@ -20,0 +31,0 @@ function shouldUseProxy(proxy, url) {

export declare const REGEX: {
readonly VARIABLES: RegExp;
readonly PATH: RegExp;
readonly TEMPLATE_VARIABLE: RegExp;
};
//# sourceMappingURL=regexHelpers.d.ts.map
const REGEX = {
VARIABLES: /{{((?:[^{}]|{[^{}]*})*)}}/g,
PATH: /(?:{)([^{}]+)}(?!})/g,
TEMPLATE_VARIABLE: /{{\s*([^}\s]+?)\s*}}|{\s*([^}\s]+?)\s*}|:\b[\w.]+\b/g,
};
export { REGEX };

@@ -19,3 +19,3 @@ {

],
"version": "0.2.76",
"version": "0.2.77",
"engines": {

@@ -111,4 +111,4 @@ "node": ">=18"

"@scalar/openapi-types": "0.1.5",
"@scalar/object-utils": "1.1.12",
"@scalar/themes": "0.9.48",
"@scalar/object-utils": "1.1.12",
"@scalar/types": "0.0.19"

@@ -118,8 +118,8 @@ },

"type-fest": "^4.20.0",
"vite": "^5.4.9",
"vite": "^5.4.10",
"vitest": "^1.6.0",
"zod-to-ts": "^1.2.0",
"@scalar/build-tooling": "0.1.12",
"@scalar/openapi-types": "0.1.5",
"@scalar/openapi-parser": "0.8.9"
"@scalar/openapi-parser": "0.8.10",
"@scalar/openapi-types": "0.1.5"
},

@@ -126,0 +126,0 @@ "scripts": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc