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

aws-collection-stream

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aws-collection-stream - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

38

index.js

@@ -16,11 +16,21 @@ const H = require ( 'highland' );

} )
.errors ( ( error, push ) => error.code === 'ThrottlingException' ? push ( null, 'ThrottlingException' ) : push ( error ) )
.flatMap ( e => {
if ( R.type ( e ) === 'String' && e === 'ThrottlingException' ) {
return H ( ( push, next ) => setTimeout ( () => next (
H.wrapCallback ( R.bind ( serviceObject[serviceMethod], serviceObject ) )( { ...parms, [nextTokenKeyName]: nextToken } )
), 1000 ) );
}
return H ( [ e ] );
} )
.flatMap ( ( { [collectionName]: collection, [nextTokenKeyName]: nextToken } ) => nextToken ? H ( collection )
.concat ( awsCollectionStream ( {
serviceObject,
serviceMethod,
collectionName,
parms,
nextTokenKeyName,
nextToken
} ) ) : H ( collection )
.concat ( awsCollectionStream ( {
serviceObject,
serviceMethod,
collectionName,
parms,
nextTokenKeyName,
nextToken
} ) ) : H ( collection )
);

@@ -47,5 +57,15 @@

return H.wrapCallback ( R.bind ( serviceObject[serviceMethod], serviceObject ) )( parms )
.errors ( ( error, push ) => error.code === 'ThrottlingException' ? push ( null, 'ThrottlingException' ) : push ( error ) )
.flatMap ( e => {
if ( R.type ( e ) === 'String' && e === 'ThrottlingException' ) {
return H ( ( push, next ) => setTimeout ( () => next (
H.wrapCallback ( R.bind ( serviceObject[serviceMethod], serviceObject ) )( parms )
), 1000 ) );
}
return H ( [ e ] );
} )
.flatMap ( result => {
const collectionName = R.find ( key => R.type ( result[key] ) === 'Array', R.keys ( result ) );
const nextTokenKeyName = R.find ( key => key.toLowerCase () === 'nexttoken', R.keys ( result ) );
const nextTokenKeyName = R.find ( key => key.toLowerCase () === 'nexttoken' || key === 'Marker', R.keys ( result ) );

@@ -52,0 +72,0 @@ if ( nextTokenKeyName ) {

{
"name": "aws-collection-stream",
"version": "0.0.2",
"version": "0.0.3",
"description": "Takes care of any paginated AWS SDK call, and return the output as a highland.js stream of objects.",

@@ -5,0 +5,0 @@ "main": "index.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