@ibm-functions/composer
Advanced tools
Comparing version 0.6.0 to 0.6.1
@@ -350,2 +350,8 @@ /* | ||
constructor(composition) { | ||
if (!isObject(composition) || composer.util.combinators[composition.type] === undefined) throw new ComposerError('Invalid argument', composition) | ||
const combinator = composer.util.combinators[composition.type] | ||
if (combinator.components && composition.components === undefined)throw new ComposerError('Invalid argument', composition) | ||
for (let arg of combinator.args || []) { | ||
if (!arg.optional && composition[arg._] === undefined) throw new ComposerError('Invalid argument', composition) | ||
} | ||
return Object.assign(this, composition) | ||
@@ -375,3 +381,3 @@ } | ||
composer[type] = composer[type] || function () { | ||
const composition = new Composition({ type }) | ||
const composition = { type } | ||
const skip = combinator.args && combinator.args.length || 0 | ||
@@ -403,3 +409,3 @@ if (!combinator.components && (arguments.length > skip)) { | ||
} | ||
return composition | ||
return new Composition(composition) | ||
} | ||
@@ -406,0 +412,0 @@ } |
{ | ||
"name": "@ibm-functions/composer", | ||
"version": "0.6.0", | ||
"version": "0.6.1", | ||
"description": "Composer is an IBM Cloud Functions programming model for composing individual functions into larger applications.", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/ibm-functions/composer", |
Sorry, the diff of this file is not supported yet
146427
1290