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

typeorm-cache

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

typeorm-cache - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

6

lib/index.d.ts

@@ -5,5 +5,9 @@ import Keyv from 'keyv';

import { QueryResultCacheOptions } from 'typeorm/cache/QueryResultCacheOptions';
export interface KeyvCacheProviderOptions extends Keyv.Options<any> {
keyPrefix?: string;
}
export declare class KeyvCacheProvider implements QueryResultCache {
cache: Keyv;
constructor(opts?: Keyv.Options<any>);
keyPrefix: string;
constructor(opts?: KeyvCacheProviderOptions);
private generateIdentifier;

@@ -10,0 +14,0 @@ connect(): Promise<void>;

4

lib/index.js

@@ -20,6 +20,8 @@ "use strict";

constructor(opts) {
const { keyPrefix } = opts || {};
this.cache = new keyv_1.default(opts);
this.keyPrefix = keyPrefix || 'typeorm:cache:';
}
generateIdentifier(query) {
return query && crypto_1.createHash('md5').update(query).digest('hex');
return query && `${this.keyPrefix}${crypto_1.createHash('md5').update(query).digest('hex')}`;
}

@@ -26,0 +28,0 @@ connect() {

{
"name": "typeorm-cache",
"version": "1.0.1",
"version": "1.0.2",
"description": "A typeorm cache provider based on keyv.",

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

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