Socket
Socket
Sign inDemoInstall

record-cache

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

record-cache - npm Package Compare versions

Comparing version 0.0.0 to 1.0.0

.travis.yml

18

index.js

@@ -86,3 +86,3 @@ var EMPTY = []

this._interval = setInterval(this._gc.bind(this), tick)
if (this._interval) this._interval.unref()
if (this._interval.unref) this._interval.unref()
}

@@ -112,4 +112,5 @@ }

var b = this._stale.get(name)
var offset = 0
var len = a.length + b.length
var aLen = a.length
var bLen = b.length
var len = aLen + bLen

@@ -120,12 +121,11 @@ if (n > len || !n) n = len

for (var i = 0; i < n; i++) {
var j = offset + Math.floor(Math.random() * (len - offset))
if (j < a.length) {
var j = Math.floor(Math.random() * (aLen + bLen))
if (j < aLen) {
result[i] = a[j].record
swap(a, j, offset)
swap(a, j, --aLen)
} else {
j -= a.length
j -= aLen
result[i] = b[j].record
swap(b, j, offset)
swap(b, j, --bLen)
}
offset++
}

@@ -132,0 +132,0 @@

{
"name": "record-cache",
"version": "0.0.0",
"description": "WIP - nothing to see here",
"version": "1.0.0",
"description": "Cache optimised for record like things",
"main": "index.js",
"dependencies": {},
"devDependencies": {
"standard": "^10.0.3"
"standard": "^10.0.3",
"tape": "^4.8.0"
},
"scripts": {
"test": "standard"
"test": "standard && tape test.js"
},

@@ -13,0 +14,0 @@ "repository": {

# record-cache
A cache optimised for record like things (`host:port`)
Cache optimised for record like things like `host:port` or `domain.names`.

@@ -9,2 +9,4 @@ ```

[![build status](https://travis-ci.org/mafintosh/record-cache.svg?branch=master)](https://travis-ci.org/mafintosh/record-cache)
## Usage

@@ -11,0 +13,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc