Socket
Socket
Sign inDemoInstall

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 4.1.0 to 4.2.0

24

CHANGELOG.md

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

----
## [In Git](https://github.com/mattwynne/gosh/compare/v4.1.0...master) (Not released)
## [In Git](https://github.com/mattwynne/gosh/compare/v4.2.0...master) (Not released)

@@ -33,2 +33,24 @@ ### Added

## [In Git](https://github.com/mattwynne/gosh/compare/v4.1.0...v4.2.0) (Not released)
### Added
* `DocumentStore#updateAll` to let you update document(s) matching a query with a function.
### Changed
* N/A
### Deprecated
* N/A
### Removed
* N/A
### Fixed
* N/A
## [4.1.0](https://github.com/mattwynne/gosh/compare/v4.0.0...v4.1.0)

@@ -35,0 +57,0 @@

@@ -49,2 +49,7 @@ 'use strict'

updateAll(query, transform) {
this.all(query).map(transform).forEach(this.put.bind(this))
return this
}
get(query) {

@@ -51,0 +56,0 @@ const results = this.all(query)

@@ -104,2 +104,22 @@ 'use strict'

context('modifying values', () => {
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)
.withIndex(document => document.hair)
.put(dave)
.put(dan)
.put(susan)
it('#updateAll stores the new value returned by the function', () => {
store.updateAll({ hair: 'red' }, doc => ({ ...doc, hair: 'blue' }))
assert.deepEqual(store.values(), [
{ name: 'Dave', hair: 'blue' },
{ name: 'Dan', hair: 'blue' },
susan,
])
})
})
context('with a single one-to-many index', () => {

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

2

package.json
{
"name": "gosh",
"version": "4.1.0",
"version": "4.2.0",
"description": "Great Object Storage Hooray!",

@@ -5,0 +5,0 @@ "main": "lib/gosh.js",

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