Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gosh

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gosh - npm Package Compare versions

Comparing version 3.0.0 to 3.1.0

4

CHANGELOG.md

@@ -10,7 +10,7 @@ # CHANGE LOG

----
## [In Git - targetting v2.1.0](https://github.com/mattwynne/gosh/compare/v2.0.0...master) (Not released)
## [In Git - targetting v3.1.0](https://github.com/mattwynne/gosh/compare/v3.0.0...master) (Not released)
### Added
* N/A
* DocumentStore#forQueries returns a read-only interface onto the store

@@ -17,0 +17,0 @@ ### Changed

@@ -58,2 +58,10 @@ 'use strict'

forQueries() {
return {
get: this.get.bind(this),
all: this.all.bind(this),
values: this.values.bind(this)
}
}
withUniqueIndex(makeKey) {

@@ -60,0 +68,0 @@ const makeId = this._makeId

{
"name": "gosh",
"version": "3.0.0",
"version": "3.1.0",
"description": "Great Object Storage Hooray!",

@@ -12,2 +12,3 @@ "main": "lib/gosh.js",

"devDependencies": {
"eslint": "^4.9.0",
"eslint-config-prettier": "^2.6.0",

@@ -17,4 +18,3 @@ "eslint-plugin-mocha": "^4.11.0",

"mocha": "^4.1.0",
"prettier": "^1.7.4",
"eslint": "^4.9.0"
"prettier": "^1.7.4"
},

@@ -21,0 +21,0 @@ "dependencies": {

@@ -79,2 +79,30 @@ 'use strict'

context('converting to a query interface', () => {
const dave = { name: 'Dave', hair: 'red' }
const dan = { name: 'Dan', hair: 'red' }
const susan = { name: 'Susan', hair: 'grey' }
const store = new DocumentStore(document => document.name)
.withOneToManyIndex(document => document.hair)
.put(dave)
.put(dan)
.put(susan)
const people = store.forQueries()
it('offers all the query methods', () => {
people.get({ name: 'Dave' })
people.all({ hair: 'red' })
})
it('does not offer any methods that update the store', () => {
assert.throws(() => people.put({ name: 'Matt', hair: 'thin' }), TypeError)
assert.throws(() => people.delete({ name: 'Dave' }), TypeError)
})
it('continues to read updated state', () => {
const matt = { name: 'Matt', hair: 'thin' }
store.put(matt)
assert.deepEqual(people.get({ name: 'Matt' }), matt)
})
})
context('with a single one-to-many index', () => {

@@ -81,0 +109,0 @@ it('#all finds all documents matching a query', () => {

Sorry, the diff of this file is not supported yet

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