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

selectstar

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

selectstar - npm Package Compare versions

Comparing version 0.1.2 to 1.0.0

22

dist/index.d.ts

@@ -1,4 +0,4 @@

export interface SqlQueryObject {
export interface SqlQueryObject<I extends any = any> {
text: string;
values: unknown[];
values: I[];
}

@@ -41,3 +41,3 @@ declare const $$BOX$$: unique symbol;

type: "list";
items: readonly SqlTemplateStringParams[];
items: readonly SqlLiteralParams[];
separator: string;

@@ -88,3 +88,3 @@ }>;

*/
export declare function list(items: readonly SqlTemplateStringParams[], separator?: string): List;
export declare function list(items: readonly SqlLiteralParams[], separator?: string): List;
declare type Unsafe = Box<{

@@ -120,5 +120,11 @@ type: "unsafe";

export declare function unsafe(value: unknown): Unsafe;
/**
* Does a very cheap "best attempt" at reformatting multiple lines of SQL into
* something that has as little leading space as possible.
*
* @param sql
*/
export declare function format(sql: string): string;
export declare type Template = (subsql: typeof sql) => SqlQueryObject;
declare type SqlTemplateStringParams = string | number | Identifier | List | Unsafe | Template;
export declare type Template<I extends any = any> = (subsql: typeof sql) => SqlQueryObject<I>;
export declare type SqlLiteralParams = Identifier | List | Unsafe | Template;
/**

@@ -132,3 +138,3 @@ * Using a template literal, generate a query with arguments that can be passed

*/
export declare function sql(fragments: TemplateStringsArray, ...args: SqlTemplateStringParams[]): SqlQueryObject;
export declare function sql<I extends any = any>(fragments: TemplateStringsArray, ...args: (I | SqlLiteralParams)[]): SqlQueryObject<I>;
/**

@@ -141,3 +147,3 @@ * Generate a template that can be used in a query generated by the sql function

*/
export declare function template(fragments: TemplateStringsArray, ...args: SqlTemplateStringParams[]): Template;
export declare function template<I extends any = any>(fragments: TemplateStringsArray, ...args: (I | SqlLiteralParams)[]): Template<I>;
export {};

@@ -211,2 +211,8 @@ "use strict";

}
/**
* Does a very cheap "best attempt" at reformatting multiple lines of SQL into
* something that has as little leading space as possible.
*
* @param sql
*/
function format(sql) {

@@ -213,0 +219,0 @@ const pieces = sql.split("\n").filter((p) => !p.match(/^\s*$/));

{
"name": "selectstar",
"version": "0.1.2",
"version": "1.0.0",
"description": "Generate safe SQL statements with tagged literals",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

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