Comparing version 3.1.1 to 3.2.0
@@ -0,1 +1,13 @@ | ||
# [3.2.0](https://github.com/TinkoffCreditSystems/cachalot/compare/v3.1.1...v3.2.0) (2021-06-10) | ||
### Bug Fixes | ||
* undefined into resolved ([e68a642](https://github.com/TinkoffCreditSystems/cachalot/commit/e68a642af56a757ceaa713ef36e6e584d8028cac)) | ||
### Features | ||
* update typescript version, added logo, updated core dev dependencies ([81480a5](https://github.com/TinkoffCreditSystems/cachalot/commit/81480a5b2c6a4c97b3f1ce91500e32e01f2fcdd6)) | ||
## [3.1.1](https://github.com/TinkoffCreditSystems/cachalot/compare/v3.1.0...v3.1.1) (2020-11-17) | ||
@@ -2,0 +14,0 @@ |
@@ -94,3 +94,3 @@ "use strict"; | ||
} | ||
resolve(keys.map(key => { | ||
resolve(keys.map((key) => { | ||
if (result[key] === undefined) { | ||
@@ -97,0 +97,0 @@ return null; |
@@ -57,3 +57,3 @@ "use strict"; | ||
this.checkConnection(); | ||
return keys.map(key => this.internalStorage[key] || null); | ||
return keys.map((key) => this.internalStorage[key] || null); | ||
} | ||
@@ -60,0 +60,0 @@ setOptions() { |
@@ -11,4 +11,6 @@ "use strict"; | ||
const BaseStorage_1 = require("./storage/BaseStorage"); | ||
exports.isCustomStorageOptions = (options) => Object.prototype.hasOwnProperty.call(options, "storage"); | ||
exports.isBaseStorageOptions = (options) => Object.prototype.hasOwnProperty.call(options, "adapter"); | ||
const isCustomStorageOptions = (options) => Object.prototype.hasOwnProperty.call(options, "storage"); | ||
exports.isCustomStorageOptions = isCustomStorageOptions; | ||
const isBaseStorageOptions = (options) => Object.prototype.hasOwnProperty.call(options, "adapter"); | ||
exports.isBaseStorageOptions = isBaseStorageOptions; | ||
exports.EXPIRES_IN = { | ||
@@ -15,0 +17,0 @@ minute: 60000, |
@@ -17,3 +17,3 @@ "use strict"; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
@@ -20,0 +20,0 @@ return result; |
@@ -10,3 +10,3 @@ "use strict"; | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
@@ -13,0 +13,0 @@ var __importDefault = (this && this.__importDefault) || function (mod) { |
@@ -17,3 +17,3 @@ "use strict"; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
@@ -20,0 +20,0 @@ return result; |
@@ -40,3 +40,3 @@ "use strict"; | ||
if (this.isRecordExpireSoon(record)) { | ||
this.refresh(key, executorContext, options).catch(err => this.logger.error(err)); | ||
this.refresh(key, executorContext, options).catch((err) => this.logger.error(err)); | ||
} | ||
@@ -43,0 +43,0 @@ return result; |
@@ -62,3 +62,3 @@ "use strict"; | ||
async setTagVersions(tags) { | ||
const values = new Map(tags.map(tag => [this.createTagKey(tag.name), `${tag.version}`])); | ||
const values = new Map(tags.map((tag) => [this.createTagKey(tag.name), `${tag.version}`])); | ||
return this.tagsAdapter.mset(values); | ||
@@ -106,3 +106,3 @@ } | ||
} | ||
const existingTags = await this.tagsAdapter.mget(tagNames.map(tagName => this.createTagKey(tagName))); | ||
const existingTags = await this.tagsAdapter.mget(tagNames.map((tagName) => this.createTagKey(tagName))); | ||
return tagNames.map((tagName, index) => ({ | ||
@@ -142,3 +142,3 @@ name: tagName, | ||
try { | ||
actualTags = await this.getTags(record.tags.map(tag => tag.name)); | ||
actualTags = await this.getTags(record.tags.map((tag) => tag.name)); | ||
} | ||
@@ -154,3 +154,3 @@ catch (err) { | ||
// at least one actualTag should have greater version | ||
return actualTags.some(actualTag => actualTag.version > recordTags[actualTag.name]); | ||
return actualTags.some((actualTag) => actualTag.version > recordTags[actualTag.name]); | ||
} | ||
@@ -172,7 +172,3 @@ return false; | ||
const rawKey = this.prefix ? `${this.prefix}-${key}` : key; | ||
return this.hashKeys | ||
? crypto_1.createHash("md5") | ||
.update(rawKey) | ||
.digest("hex") | ||
: rawKey; | ||
return this.hashKeys ? crypto_1.createHash("md5").update(rawKey).digest("hex") : rawKey; | ||
} | ||
@@ -179,0 +175,0 @@ createTagKey(tagName) { |
@@ -5,3 +5,3 @@ "use strict"; | ||
const errors_1 = require("./errors/errors"); | ||
exports.withTimeout = async (promise, timeout) => { | ||
const withTimeout = async (promise, timeout) => { | ||
const timeoutPromise = new Promise((resolveTimeout, rejectTimeout) => { | ||
@@ -14,2 +14,3 @@ setTimeout(() => { | ||
}; | ||
exports.withTimeout = withTimeout; | ||
//# sourceMappingURL=with-timeout.js.map |
{ | ||
"name": "cachalot", | ||
"version": "3.1.1", | ||
"version": "3.2.0", | ||
"description": "Cache manager for nodejs with support different cache strategies", | ||
@@ -23,3 +23,3 @@ "keywords": [ | ||
"engines": { | ||
"node": ">=8.0.0" | ||
"node": ">=10.0.0" | ||
}, | ||
@@ -41,25 +41,24 @@ "scripts": { | ||
}, | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"@semantic-release/changelog": "^3.0.4", | ||
"@semantic-release/git": "^7.0.16", | ||
"@types/ioredis": "^4.16.7", | ||
"@types/jest": "^25.2.3", | ||
"@types/ioredis": "^4.26.4", | ||
"@types/jest": "^26.0.23", | ||
"@types/memcached": "^2.2.6", | ||
"@types/node": "^8.10.61", | ||
"@types/uuid": "^8.0.0", | ||
"@typescript-eslint/eslint-plugin": "^3.4.0", | ||
"@typescript-eslint/parser": "^3.4.0", | ||
"@types/uuid": "^8.3.0", | ||
"@typescript-eslint/eslint-plugin": "^4.26.1", | ||
"@typescript-eslint/parser": "^4.26.1", | ||
"coveralls": "^3.1.0", | ||
"cz-conventional-changelog": "^3.2.0", | ||
"eslint": "^6.8.0", | ||
"eslint-config-prettier": "^6.11.0", | ||
"ioredis": "^4.17.3", | ||
"jest": "^25.5.4", | ||
"eslint": "^7.28.0", | ||
"eslint-config-prettier": "^8.3.0", | ||
"ioredis": "^4.27.5", | ||
"jest": "^27.0.4", | ||
"memcached": "^2.2.2", | ||
"prettier": "^1.19.1", | ||
"semantic-release": "^15.13.24", | ||
"ts-jest": "^25.5.1", | ||
"typescript": "^3.9.7", | ||
"uuid": "^8.2.0" | ||
"prettier": "^2.3.1", | ||
"semantic-release": "^17.2.3", | ||
"ts-jest": "^27.0.3", | ||
"typescript": "^4.3.2", | ||
"uuid": "^8.3.2" | ||
}, | ||
@@ -66,0 +65,0 @@ "config": { |
@@ -1,2 +0,2 @@ | ||
# Cachalot | ||
# <img src="assets/logo.svg" alt="cachalot logo" height="100px"> | ||
@@ -8,3 +8,3 @@ [![Build status](https://img.shields.io/github/workflow/status/TinkoffCreditSystems/cachalot/CI?style=flat-square)](https://github.com/TinkoffCreditSystems/cachalot/actions?query=branch%3Amaster+workflow%3ACI) | ||
The library is designed to cache query results. Features: | ||
Zero-dependency library designed to cache query results. Features: | ||
* Implements popular caching strategies (Read-Through, Write-Through, Refresh-Ahead), and also allows them to be combined | ||
@@ -11,0 +11,0 @@ * Defines an adapter interface that allows you to use it with any key-value storage for which the corresponding adapter is written |
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
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
140355
1994