Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@groqfmt/wasm

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@groqfmt/wasm - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

34

dist/index.js

@@ -6,2 +6,35 @@ 'use strict';

});
function getQueryDetails(url) {
return {
projectId: getProjectId(url),
dataset: getDataset(url),
cdn: getCdn(url),
apiVersion: getApiVersion(url),
perspective: getPerspective(url)
};
}
function getProjectId(url) {
return getHostnameSegment(url, 0);
}
function getDataset(url) {
return getPathnameSegment(url, 3);
}
function getCdn(url) {
return getHostnameSegment(url, 1) === "apicdn";
}
function getApiVersion(url) {
return getPathnameSegment(url, 0);
}
function getPerspective(url) {
var _a;
return (_a = url.searchParams.get("perspective")) != null ? _a : void 0;
}
function getPathnameSegment(url, segmentIndex) {
const separator = "/";
return url.pathname.split(separator)[segmentIndex + 1];
}
function getHostnameSegment(url, segmentIndex) {
const separator = ".";
return url.hostname.split(separator)[segmentIndex];
}
function getQueryParams(url) {

@@ -35,2 +68,3 @@ return [...url.searchParams.entries()].reduce((params, _ref) => {

...groqfmt(query),
...getQueryDetails(url),
params: getQueryParams(url)

@@ -37,0 +71,0 @@ };

13

dist/types.d.ts

@@ -0,2 +1,13 @@

/// <reference types="bun-types" />
/** @public */
export declare interface Details {
projectId: string
dataset: string
cdn: boolean
apiVersion: string
perspective?: string
}
/** @public */
export declare function format({

@@ -42,4 +53,4 @@ input,

params?: Record<string, string>
}
} & Partial<Details>
export {}

4

package.json
{
"name": "@groqfmt/wasm",
"author": "Ash",
"version": "1.0.0",
"version": "1.1.0",
"license": "MIT",

@@ -30,4 +30,4 @@ "repository": "github:juice49/groqfmt-wasm",

"prettier": "^3.0.3",
"typescript": "^5.0.0"
"typescript": "^5.2.2"
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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