A suite to track Project Diva score statistics and ratings / D4DJ event data.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
projectdivar/server/node_modules/image-pixels/lib/cache.js

23 lines
460 B

'use strict'
var p = require('primitive-pool')
var WeakMap = require('weak-map')
// cache of data without clipping, depending on source
var cache = new WeakMap()
module.exports = {
get: function (key) {
return cache.get(p(key))
},
set: function (key, value) {
if (!Array.isArray(key)) key = [key]
key.forEach(function (key) {
if (!key) return
if (!cache.get(p(key))) cache.set(p(key), value)
})
return value
}
}