@koopjs/cache-memory
Advanced tools
Comparing version 2.0.3 to 3.0.0
{ | ||
"name": "@koopjs/cache-memory", | ||
"version": "2.0.3", | ||
"version": "3.0.0", | ||
"description": "An in-memory cache for KOop", | ||
"main": "src/index.js", | ||
"scripts": { | ||
"test": "standard src && tape test/*.js | tap-spec" | ||
"test": "tape src/**/*.spec.js | tap-spec", | ||
"test:cov": "nyc --reporter=text-summary --reporter=html tape './src/**/*.spec.js' | tap-spec", | ||
"test:cov:unit": "nyc --reporter=text-summary --reporter=html tape 'src/**/*.spec.js' | tap-spec" | ||
}, | ||
@@ -28,8 +30,12 @@ "repository": { | ||
"license": "Apache-2.0", | ||
"files": [ | ||
"src/**/*.js", | ||
"index.d.ts", | ||
"!**/*.spec.js" | ||
], | ||
"bugs": { | ||
"url": "https://github.com/koopjs/koop-cache-memory/issues" | ||
"url": "https://github.com/koopjs/koop/issues" | ||
}, | ||
"homepage": "https://github.com/koopjs/koop-cache-memory#readme", | ||
"homepage": "https://github.com/koopjs/koop#readme", | ||
"devDependencies": { | ||
"standard": "^14.0.0", | ||
"tap-spec": "^5.0.0", | ||
@@ -36,0 +42,0 @@ "tape": "^5.0.0" |
@@ -1,2 +0,1 @@ | ||
const Util = require('util'); | ||
const EventEmitter = require('events'); | ||
@@ -11,7 +10,7 @@ const _ = require('lodash'); | ||
class Cache extends EventEmitter { | ||
static name = 'Memory Cache'; | ||
static pluginName = 'Memory Cache'; | ||
static type = 'cache'; | ||
static version = require('../package.json').version; | ||
constructor(options = {}) { | ||
constructor() { | ||
super(); | ||
@@ -32,3 +31,3 @@ this.featuresStore = new Map(); | ||
update(key, geojson, options = {}, callback = noop) { | ||
update(key, geojson, options = {}, callback = noop) { // eslint-disable-line | ||
if (!this.featuresStore.has(key)) { | ||
@@ -56,3 +55,3 @@ return callback(new Error('Resource not found')); | ||
append(key, geojson, options = {}, callback = noop) { | ||
append(key, geojson, options = {}, callback = noop) { // eslint-disable-line | ||
const { features } = asCachableGeojson(geojson); | ||
@@ -85,3 +84,3 @@ const existingFeatures = this.featuresStore.get(key); | ||
createStream(key, options = {}) { | ||
createStream(key, options = {}) { // eslint-disable-line | ||
const features = this.featuresStore.get(key); | ||
@@ -124,3 +123,3 @@ return Readable.from(features); | ||
catalogUpdate = function (key, update, options = {}, callback = noop) { | ||
catalogUpdate = function (key, update, options = {}, callback = noop) { // eslint-disable-line | ||
if (!this.catalogStore.has(key)) { | ||
@@ -127,0 +126,0 @@ return callback(new Error('Resource not found')); |
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
2
11447
5
143