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

@allbin/entity-logic

Package Overview
Dependencies
Maintainers
3
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@allbin/entity-logic - npm Package Compare versions

Comparing version 0.2.0 to 0.3.0

2

lib/index.d.ts

@@ -5,3 +5,3 @@ import { Entity, EntitySchema } from './types/schema';

interface EntityLogic {
execute: (entities: Entity[], filter: Filter) => Entity[];
execute: <T>(entities: Entity<T>[], filter: Filter) => Entity<T>[];
validateCondition: (condtion: FilterCondition) => Operator;

@@ -8,0 +8,0 @@ validateFilter: (filter: Filter) => Operator[];

@@ -11,3 +11,3 @@ "use strict";

type: 'boolean',
name: 'Boolean',
name: 'boolean',
},

@@ -17,3 +17,3 @@ {

type: 'number',
name: 'Number',
name: 'number',
},

@@ -23,3 +23,3 @@ {

type: 'string',
name: 'String',
name: 'string',
},

@@ -29,3 +29,3 @@ {

type: 'date',
name: 'Date',
name: 'date',
},

@@ -35,3 +35,3 @@ {

type: 'date',
name: 'DateString',
name: 'datestring',
},

@@ -41,3 +41,3 @@ {

type: 'enum',
name: 'Enum',
name: 'enum',
alternatives: ['alternative1', 'alternative2'],

@@ -48,3 +48,3 @@ },

type: 'photo',
name: 'Photo',
name: 'photo',
},

@@ -54,3 +54,3 @@ {

type: 'array:number',
name: 'ArrayNumber',
name: 'arraynumber',
},

@@ -60,3 +60,3 @@ {

type: 'array:string',
name: 'ArrayString',
name: 'arraystring',
},

@@ -862,2 +862,18 @@ ],

});
it('correctly validates a valid schema', function () {
expect(function () { return (0, index_1.validateSchema)(schema); }).not.toThrow();
});
it('correctly validates an invalid schema', function () {
var invalid_schema = {
groups: [],
properties: [
{
key: 'user.1',
type: 'string',
name: 'Test',
},
],
};
expect(function () { return (0, index_1.validateSchema)(invalid_schema); }).toThrow();
});
});

@@ -62,5 +62,5 @@ import { DateTime } from 'luxon';

};
export declare type Entity = {
export declare type Entity<T = unknown> = T & {
properties: Record<string, EntitySchemaPropValue>;
};
export {};
{
"name": "@allbin/entity-logic",
"version": "0.2.0",
"version": "0.3.0",
"description": "Logic solver for mobilix filters",

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

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