Comparing version 1.1.0 to 1.1.1
import { Field } from "./Field"; | ||
import { State } from "../states/State"; | ||
export declare type SupportedValueType = object | string | boolean | number | null; | ||
export declare type ResultType = { | ||
[k: string]: SupportedValueType; | ||
}; | ||
export declare class ResultField<T extends State> extends Field<T> { | ||
@@ -8,4 +11,6 @@ required: boolean; | ||
constructor(state: T); | ||
set(value: SupportedValueType): T; | ||
get(): SupportedValueType; | ||
set(name: string, value: SupportedValueType): T; | ||
setAll(value: ResultType): T; | ||
get(name: string): SupportedValueType; | ||
getAll(): ResultType; | ||
} |
@@ -19,15 +19,22 @@ "use strict"; | ||
_this.required = false; | ||
_this.result = null; | ||
_this.result = {}; | ||
return _this; | ||
} | ||
ResultField.prototype.set = function (value) { | ||
this.result = value; | ||
ResultField.prototype.set = function (name, value) { | ||
this.receiveConfiguration(); | ||
this.result[name] = value; | ||
return this.getParentState(); | ||
}; | ||
ResultField.prototype.get = function () { | ||
return this.result; | ||
ResultField.prototype.setAll = function (value) { | ||
this.result = value; | ||
return this.getParentState(); | ||
}; | ||
ResultField.prototype.get = function (name) { | ||
return this.result[name]; | ||
}; | ||
ResultField.prototype.getAll = function () { | ||
return JSON.parse(JSON.stringify(this.result)); | ||
}; | ||
return ResultField; | ||
}(Field_1.Field)); | ||
exports.ResultField = ResultField; |
@@ -86,3 +86,3 @@ "use strict"; | ||
StepFunctionsGenerator.prototype.generateResultField = function (field) { | ||
return { Result: field.get() }; | ||
return { Result: field.getAll() }; | ||
}; | ||
@@ -89,0 +89,0 @@ StepFunctionsGenerator.prototype.generateResultPathField = function (field) { |
import { State } from './State'; | ||
import { NextField } from '../fields/index'; | ||
import { PathField, NextField } from '../fields/index'; | ||
export declare class ParallelBranch { | ||
@@ -16,2 +16,3 @@ private startAt; | ||
private branches; | ||
path: PathField<Parallel>; | ||
constructor(name: string); | ||
@@ -18,0 +19,0 @@ addBranch(branch?: ParallelBranch): ParallelBranch; |
@@ -49,2 +49,3 @@ "use strict"; | ||
_this.next = new index_1.NextField(_this); | ||
_this.path = new index_1.PathField(_this); | ||
return _this; | ||
@@ -51,0 +52,0 @@ } |
{ | ||
"name": "flowbject", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Flowbject is a library that allows you to describe state machines with objects.", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
69927
48
1800