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

client-ketchup

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

client-ketchup - npm Package Compare versions

Comparing version 0.3.0 to 1.0.0

6

package.json
{
"name": "client-ketchup",
"version": "0.3.0",
"version": "1.0.0",
"description": "A simple interface for keeping remote clients up to date with their authoritative state",

@@ -30,8 +30,6 @@ "main": "src/client-state-update.js",

"devDependencies": {
"minimal-object-diff": "^0.1.0",
"standard": "^7.1.2",
"tape": "^4.6.0"
},
"dependencies": {
"minimal-object-diff": "^0.1.0"
}
}

@@ -36,3 +36,5 @@ client-ketchup [![npm version](https://badge.fury.io/js/client-ketchup.svg)](http://badge.fury.io/js/client-ketchup) [![Build Status](https://travis-ci.org/chinedufn/client-ketchup.svg?branch=master)](https://travis-ci.org/chinedufn/client-ketchup)

// Create a new client state tracker. You'll typically use one of these and add/remove different clients to it
var CST = CreateClientStateTracker()
var CST = CreateClientStateTracker({
differ: require('minimal-object-diff').diff
})

@@ -39,0 +41,0 @@ // Add a new client

@@ -1,6 +0,4 @@

var objectDiff = require('minimal-object-diff')
module.exports = CreateClientStateUpdater
function CreateClientStateUpdater () {
function CreateClientStateUpdater (opts) {
var clientStateMap = {}

@@ -28,3 +26,3 @@

function UpdateKey (key, newState) {
var patches = objectDiff.diff(clientStateMap[key], newState)
var patches = opts.differ(clientStateMap[key], newState)
clientStateMap[key] = newState

@@ -31,0 +29,0 @@

var test = require('tape')
var objectDiffer = require('minimal-object-diff').diff
var CreateClientStateUpdater = require('../')

@@ -6,3 +7,5 @@

t.plan(1)
var CSU = CreateClientStateUpdater()
var CSU = CreateClientStateUpdater({
differ: objectDiffer
})
CSU.add('key', { value: true, value2: true })

@@ -9,0 +12,0 @@

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