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

@supercharge/collections

Package Overview
Dependencies
Maintainers
3
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@supercharge/collections - npm Package Compare versions

Comparing version 1.13.0 to 2.0.0

dist/collection-proxy.d.ts

21

CHANGELOG.md
# Changelog
## [2.0.0](https://github.com/supercharge/collections/compare/v1.13.0...v2.0.0) - 2020-05-21
### Added
- TypeScript typings
- collection pipelines are now awaitable: no need to call `.all()` to retrieve the result
- before: `await Collect([1, 2, 3]).map(...).filter().all()`
- now: `await Collect([1, 2, 3]).map(...).filter()`
### Updated
- bump dependencies
- moved code base to TypeScript to automatically generate type definitions
### Breaking Changes
- all `xSeries` methods become the default and were removed
- for example: `mapSeries` becomes `map` and the `mapSeries` method was removed
- the methods running async functions in parallel were removed in favor of the sequence versions
- I found myself defaulting to the `xSeries` methods because I typically don’t want to handle the side-effects of parallel processing on a large collections. That’s why the methods iterating over the items in sequence are the new default.
**Note:** there are no new `xParallel` methods to fill the gap for the missing methods processing async tasks in parallel. If you need the parallel methods, I’m happy to support you on a pull request.
## [1.13.0](https://github.com/supercharge/collections/compare/v1.12.2...v1.13.0) - 2020-03-26

@@ -4,0 +25,0 @@

9

index.js
'use strict'
const CollectionProxy = require('./src/collection-proxy')
const collect = collection => {
return new CollectionProxy(collection)
}
module.exports = collect
module.exports.default = collect
module.exports = require('./dist')
{
"name": "@supercharge/collections",
"description": "Supercharge collections",
"version": "1.13.0",
"version": "2.0.0",
"author": "Marcus Pöhls <marcus@futurestud.io>",

@@ -10,3 +10,3 @@ "bugs": {

"dependencies": {
"@supercharge/queue-datastructure": "~1.1.1"
"@supercharge/queue-datastructure": "~1.3.1"
},

@@ -16,9 +16,13 @@ "devDependencies": {

"@hapi/lab": "~21.0.0",
"@supercharge/tsconfig": "~1.0.0",
"@typescript-eslint/eslint-plugin": "~2.34.0",
"eslint": "~6.8.0",
"eslint-config-standard": "~14.1.0",
"eslint-plugin-import": "~2.20.1",
"eslint-plugin-node": "~11.0.0",
"eslint-config-standard": "~14.1.1",
"eslint-config-standard-with-typescript": "~17.0.0",
"eslint-plugin-import": "~2.20.2",
"eslint-plugin-node": "~11.1.0",
"eslint-plugin-promise": "~4.2.1",
"eslint-plugin-standard": "~4.0.1",
"sinon": "~8.1.1"
"sinon": "~8.1.1",
"typescript": "~3.9.3"
},

@@ -29,4 +33,4 @@ "engines": {

"files": [
"index.js",
"src"
"dist",
"index.js"
],

@@ -59,8 +63,11 @@ "homepage": "https://github.com/supercharge/collections",

"scripts": {
"lint": "eslint .",
"lint-fix": "eslint . --fix",
"list-tests": "lab --assert @hapi/code --dry --verbose",
"test": "lab --assert @hapi/code --leaks --coverage --lint --reporter console --output stdout --reporter html --output ./coverage/coverage.html",
"test-single": "lab --assert @hapi/code --leaks --lint --id"
}
"build": "tsc",
"lint": "eslint src --ext .js,.ts",
"lint:fix": "eslint src --ext .js,.ts --fix",
"test": "npm run build && npm run lint && npm run test:run",
"test:list": "lab --assert @hapi/code --dry --verbose",
"test:run": "lab --assert @hapi/code --leaks --coverage --reporter console --output stdout --reporter html --output ./coverage/coverage.html",
"test:single": "npm run build && lab --assert @hapi/code --leaks --id"
},
"types": "dist"
}

@@ -63,3 +63,2 @@ <div align="center">

})
.all()

@@ -69,4 +68,2 @@ // users = [ <list of newly-subscribed users> ]

**Notice:** when chaining methods like `map` or `filter`, you'll receive a collection instance in return. You must actively end the call chain using the `.all()` method to process the collection pipeline and retrieve the final result.
You can directly await the result for methods returning a definite value. The function returns a new instance of the collection without altering the original input array:

@@ -73,0 +70,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