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

@nearform/sql

Package Overview
Dependencies
Maintainers
8
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nearform/sql - npm Package Compare versions

Comparing version 1.10.4 to 1.10.5

2

package.json
{
"name": "@nearform/sql",
"version": "1.10.4",
"version": "1.10.5",
"description": "SQL injection protection module",

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

@@ -47,2 +47,26 @@ /** A tagged template containing strings and values */

/**
* A function that accepts an array of objects and a mapper function
* It returns a clean SQL format using the object properties defined in the mapper function
* @param array the items to be mapped over
* @param mapFunc a function to transform the items in `array` before being added to the SqlStatement
* @example
* SQL`SELECT ${SQL.map([1,2,3])}`
* @example
* SQL`SELECT ${SQL.map([1,2,3], x => x ** 2)}`
*/
map<T>(array: T[], mapFunc?: (item: T) => unknown): SqlStatement
/**
* A function that accepts an array of objects and a mapper function
* It returns a clean SQL format using the object properties defined in the mapper function
* @param array the items to be mapped over
* @param mapFunc a function to transform the items in `array` before being added to the SqlStatement
* @example
* SQL`SELECT ${SQL.map([1,2,3])}`
* @example
* SQL`SELECT ${SQL.map([1,2,3], x => x ** 2)}`
*/
static map<T>(array: T[], mapFunc?: (item: T) => unknown): SqlStatement
/** Returns a formatted but unsafe statement of strings and values, useful for debugging */

@@ -89,2 +113,14 @@ get debug(): string

/**
* A function that accepts an array of objects and a mapper function
* It returns a clean SQL format using the object properties defined in the mapper function
* @param array the items to be mapped over
* @param mapFunc a function to transform the items in `array` before being added to the SqlStatement
* @example
* SQL`SELECT ${SQL.map([1,2,3])}`
* @example
* SQL`SELECT ${SQL.map([1,2,3], x => x ** 2)}`
*/
export function map<T>(array: T[], mapFunc?: (item: T) => unknown): SqlStatement
export function unsafe<T>(value: T): { value: T }

@@ -91,0 +127,0 @@ export function quoteIdent(value: string): { value: string }

import SQL from '.'
import { glue, SqlStatement } from '.'
import { glue, map, SqlStatement } from '.'
import { expectType, expectError } from 'tsd'

@@ -11,2 +11,6 @@

expectType<SQL.SqlStatement>(SQL.glue([SQL`SELECT`, SQL`1`], ' '))
expectType<SQL.SqlStatement>(SQL.map([1,2,3]))
expectType<SQL.SqlStatement>(SQL.map([1,2,3], x => x**2))
expectType<SQL.SqlStatement>(map([1,2,3]))
expectType<SQL.SqlStatement>(map([1,2,3], x => x**2))
expectType<string>(SQL`SELECT 1`.debug)

@@ -13,0 +17,0 @@ expectType<string>(SQL`SELECT 1`.sql)

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