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

@furystack/core

Package Overview
Dependencies
Maintainers
1
Versions
214
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@furystack/core - npm Package Compare versions

Comparing version 11.2.0 to 11.2.1

40

dist/in-memory-store.js

@@ -7,23 +7,3 @@ "use strict";

/**
* Creates an InMemoryStore that can be used for testing purposes.
*
* @param options Options for the In Memory Store
* @param options.primaryKey The name of the primary key field
* @param options.model The Entity Model
*/
constructor(options) {
this.cache = new Map();
this.get = async (key, select) => {
const item = this.cache.get(key);
return item && select ? (0, physical_store_1.selectFields)(item, ...select) : item;
};
this.evaluateLike = (value, likeString) => {
const likeRegex = `^${likeString.replace(/%/g, '.*')}$`;
return value.match(new RegExp(likeRegex, 'i'));
};
this.primaryKey = options.primaryKey;
this.model = options.model;
}
/**
*
* @param keys The keys to remove from the store

@@ -189,4 +169,24 @@ */

}
/**
* Creates an InMemoryStore that can be used for testing purposes.
*
* @param options Options for the In Memory Store
* @param options.primaryKey The name of the primary key field
* @param options.model The Entity Model
*/
constructor(options) {
this.cache = new Map();
this.get = async (key, select) => {
const item = this.cache.get(key);
return item && select ? (0, physical_store_1.selectFields)(item, ...select) : item;
};
this.evaluateLike = (value, likeString) => {
const likeRegex = `^${likeString.replace(/%/g, '.*')}$`;
return value.match(new RegExp(likeRegex, 'i'));
};
this.primaryKey = options.primaryKey;
this.model = options.model;
}
}
exports.InMemoryStore = InMemoryStore;
//# sourceMappingURL=in-memory-store.js.map
{
"name": "@furystack/core",
"version": "11.2.0",
"version": "11.2.1",
"description": "Core FuryStack package",

@@ -29,8 +29,8 @@ "main": "dist/index.js",

"devDependencies": {
"@types/jest": "^29.2.2",
"@types/jest": "^29.2.3",
"@types/node": "^18.11.9"
},
"dependencies": {
"@furystack/inject": "^7.1.2",
"@furystack/utils": "^3.1.2",
"@furystack/inject": "^7.1.3",
"@furystack/utils": "^3.1.3",
"semaphore-async-await": "^1.5.1"

@@ -37,0 +37,0 @@ },

@@ -9,3 +9,3 @@ import type { Constructable } from '@furystack/inject';

export declare const allOperators: readonly ["$eq", "$ne", "$gt", "$gte", "$lt", "$lte", "$in", "$nin", "$and", "$not", "$nor", "$or", "$startsWith", "$endsWith", "$like", "$regex"];
export declare type FilterType<T> = {
export type FilterType<T> = {
[K in keyof T]?: (T[K] extends string ? {

@@ -33,3 +33,3 @@ [SCO in typeof StringComparisonOperators[number]]?: T[K];

}
export declare type WithOptionalId<T, TPrimaryKey extends keyof T> = Omit<T, TPrimaryKey> & {
export type WithOptionalId<T, TPrimaryKey extends keyof T> = Omit<T, TPrimaryKey> & {
[K in TPrimaryKey]?: T[K];

@@ -64,3 +64,3 @@ };

}
export declare type PartialResult<T, TFields extends Array<keyof T>> = Pick<T, TFields[number]>;
export type PartialResult<T, TFields extends Array<keyof T>> = Pick<T, TFields[number]>;
export declare const selectFields: <T extends object, TField extends (keyof T)[]>(entry: T, ...fields: TField) => PartialResult<T, TField>;

@@ -67,0 +67,0 @@ /**

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