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

@instantdb/core

Package Overview
Dependencies
Maintainers
4
Versions
206
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@instantdb/core - npm Package Compare versions

Comparing version 0.10.7 to 0.10.8

8

dist/module/queryTypes.d.ts

@@ -0,3 +1,9 @@

declare type NonEmpty<T> = {
[K in keyof T]-?: Required<Pick<T, K>>;
}[keyof T];
declare type WhereArgs = {
in?: (string | number | boolean)[];
};
declare type WhereClause = {
[key: string]: string | number | boolean;
[key: string]: string | number | boolean | NonEmpty<WhereArgs>;
};

@@ -4,0 +10,0 @@ declare type $Option = {

@@ -36,2 +36,5 @@ // Query

const r7 = dummyQuery({ users: { $: { where: { "foo.bar.baz": 1 } } } });
const s1 = dummyQuery({
users: { $: { where: { foo: { in: [1, 2, 3] } } } },
});
// ------------------

@@ -45,2 +48,6 @@ // Bad $ clauses fail

const r10 = dummyQuery({ users: { $: { where2: 1 } } });
const s2 = dummyQuery({
// @ts-expect-error
users: { $: { where: { foo: { ini: [1, 2, 3] } } } },
});
// ----------------

@@ -47,0 +54,0 @@ // Good Nested queries succeed

@@ -0,3 +1,9 @@

declare type NonEmpty<T> = {
[K in keyof T]-?: Required<Pick<T, K>>;
}[keyof T];
declare type WhereArgs = {
in?: (string | number | boolean)[];
};
declare type WhereClause = {
[key: string]: string | number | boolean;
[key: string]: string | number | boolean | NonEmpty<WhereArgs>;
};

@@ -4,0 +10,0 @@ declare type $Option = {

@@ -38,2 +38,5 @@ "use strict";

const r7 = dummyQuery({ users: { $: { where: { "foo.bar.baz": 1 } } } });
const s1 = dummyQuery({
users: { $: { where: { foo: { in: [1, 2, 3] } } } },
});
// ------------------

@@ -47,2 +50,6 @@ // Bad $ clauses fail

const r10 = dummyQuery({ users: { $: { where2: 1 } } });
const s2 = dummyQuery({
// @ts-expect-error
users: { $: { where: { foo: { ini: [1, 2, 3] } } } },
});
// ----------------

@@ -49,0 +56,0 @@ // Good Nested queries succeed

2

package.json
{
"name": "@instantdb/core",
"version": "0.10.7",
"version": "0.10.8",
"description": "Instant's core local abstraction",

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

// Query
// -----
// NonEmpty disallows {}, so that you must provide at least one field
type NonEmpty<T> = {
[K in keyof T]-?: Required<Pick<T, K>>;
}[keyof T];
type WhereArgs = {
in?: (string | number | boolean)[];
};
type WhereClause = {
[key: string]: string | number | boolean;
[key: string]: string | number | boolean | NonEmpty<WhereArgs>;
};

@@ -130,2 +139,5 @@

const r7 = dummyQuery({ users: { $: { where: { "foo.bar.baz": 1 } } } });
const s1 = dummyQuery({
users: { $: { where: { foo: { in: [1, 2, 3] } } } },
});

@@ -141,2 +153,6 @@ // ------------------

const r10 = dummyQuery({ users: { $: { where2: 1 } } });
const s2 = dummyQuery({
// @ts-expect-error
users: { $: { where: { foo: { ini: [1, 2, 3] } } } },
});

@@ -143,0 +159,0 @@ // ----------------

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