🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

@supabase/postgrest-js

Package Overview
Dependencies
Maintainers
3
Versions
152
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@supabase/postgrest-js - npm Package Compare versions

Comparing version

to
0.26.1

3

dist/main/lib/PostgrestFilterBuilder.d.ts
import PostgrestTransformBuilder from './PostgrestTransformBuilder';
/**
* Filters
*/
declare type FilterOperator = 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'like' | 'ilike' | 'is' | 'in' | 'cs' | 'cd' | 'sl' | 'sr' | 'nxl' | 'nxr' | 'adj' | 'ov' | 'fts' | 'plfts' | 'phfts' | 'wfts';

@@ -3,0 +6,0 @@ export default class PostgrestFilterBuilder<T> extends PostgrestTransformBuilder<T> {

22

dist/main/lib/PostgrestFilterBuilder.js

@@ -7,6 +7,2 @@ "use strict";

const PostgrestTransformBuilder_1 = __importDefault(require("./PostgrestTransformBuilder"));
/**
* Filters
*/
const cleanFilterArray = (filter) => filter.map((s) => `${s}`).join(',');
class PostgrestFilterBuilder extends PostgrestTransformBuilder_1.default {

@@ -142,3 +138,13 @@ /**

in(column, values) {
this.url.searchParams.append(`${column}`, `in.(${cleanFilterArray(values)})`);
const cleanedValues = values
.map((s) => {
// handle postgrest reserved characters
// https://postgrest.org/en/v7.0.0/api.html#reserved-characters
if (typeof s === 'string' && new RegExp('[,()]').test(s))
return `"${s}"`;
else
return `${s}`;
})
.join(',');
this.url.searchParams.append(`${column}`, `in.(${cleanedValues})`);
return this;

@@ -161,3 +167,3 @@ }

// array
this.url.searchParams.append(`${column}`, `cs.{${cleanFilterArray(value)}}`);
this.url.searchParams.append(`${column}`, `cs.{${value.join(',')}}`);
}

@@ -184,3 +190,3 @@ else {

// array
this.url.searchParams.append(`${column}`, `cd.{${cleanFilterArray(value)}}`);
this.url.searchParams.append(`${column}`, `cd.{${value.join(',')}}`);
}

@@ -262,3 +268,3 @@ else {

// array
this.url.searchParams.append(`${column}`, `ov.{${cleanFilterArray(value)}}`);
this.url.searchParams.append(`${column}`, `ov.{${value.join(',')}}`);
}

@@ -265,0 +271,0 @@ return this;

import PostgrestTransformBuilder from './PostgrestTransformBuilder';
/**
* Filters
*/
declare type FilterOperator = 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'like' | 'ilike' | 'is' | 'in' | 'cs' | 'cd' | 'sl' | 'sr' | 'nxl' | 'nxr' | 'adj' | 'ov' | 'fts' | 'plfts' | 'phfts' | 'wfts';

@@ -3,0 +6,0 @@ export default class PostgrestFilterBuilder<T> extends PostgrestTransformBuilder<T> {

import PostgrestTransformBuilder from './PostgrestTransformBuilder';
/**
* Filters
*/
const cleanFilterArray = (filter) => filter.map((s) => `${s}`).join(',');
export default class PostgrestFilterBuilder extends PostgrestTransformBuilder {

@@ -136,3 +132,13 @@ /**

in(column, values) {
this.url.searchParams.append(`${column}`, `in.(${cleanFilterArray(values)})`);
const cleanedValues = values
.map((s) => {
// handle postgrest reserved characters
// https://postgrest.org/en/v7.0.0/api.html#reserved-characters
if (typeof s === 'string' && new RegExp('[,()]').test(s))
return `"${s}"`;
else
return `${s}`;
})
.join(',');
this.url.searchParams.append(`${column}`, `in.(${cleanedValues})`);
return this;

@@ -155,3 +161,3 @@ }

// array
this.url.searchParams.append(`${column}`, `cs.{${cleanFilterArray(value)}}`);
this.url.searchParams.append(`${column}`, `cs.{${value.join(',')}}`);
}

@@ -178,3 +184,3 @@ else {

// array
this.url.searchParams.append(`${column}`, `cd.{${cleanFilterArray(value)}}`);
this.url.searchParams.append(`${column}`, `cd.{${value.join(',')}}`);
}

@@ -256,3 +262,3 @@ else {

// array
this.url.searchParams.append(`${column}`, `ov.{${cleanFilterArray(value)}}`);
this.url.searchParams.append(`${column}`, `ov.{${value.join(',')}}`);
}

@@ -259,0 +265,0 @@ return this;

{
"name": "@supabase/postgrest-js",
"version": "0.26.0",
"version": "0.26.1",
"description": "Isomorphic PostgREST client",

@@ -5,0 +5,0 @@ "keywords": [

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