Skip to content

Commit

Permalink
Merge pull request #40 from Psychopoulet/develop
Browse files Browse the repository at this point in the history
add value to doc
  • Loading branch information
Psychopoulet committed Oct 6, 2020
2 parents 09f585d + aeddddc commit e062d6b
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 12 deletions.
6 changes: 6 additions & 0 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,12 @@ module.exports = class NodeContainerPattern extends Map {

}

else if ("function" !== result[key].type) {

result[key].value = value;

}

});

return result;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-containerpattern",
"version": "1.1.0",
"version": "1.2.0",
"description": "A 'Container pattern' object for a clean global use of data.",
"main": "lib/main.js",
"typings": "lib/index.d.ts",
Expand Down
33 changes: 22 additions & 11 deletions test/7_documentation.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ describe("documentation", () => {

.set("teststring", "string")
.set("testboolean", false)
.set("testnumber", 1)
.set("testnumber", 1.2)
.set("testinteger", 1)
.set("testbase16", 0xA5)
.set("testfloat", 1.1)
Expand Down Expand Up @@ -145,15 +145,17 @@ describe("documentation", () => {
"limits": null,
"min": null,
"max": null,
"type": "string"
"type": "string",
"value": "test"
},
"1": {
"documentation": "",
"fullkey": "testnotemptyarray.1",
"limits": null,
"min": null,
"max": null,
"type": "string"
"type": "string",
"value": "test"
}
},
"normal running has invalid content for \"testnotemptyarray\""
Expand All @@ -167,6 +169,7 @@ describe("documentation", () => {
"limits": null,
"min": null,
"max": null,
"value": "test",
"type": "string"
},
"1": {
Expand All @@ -175,7 +178,8 @@ describe("documentation", () => {
"limits": null,
"min": null,
"max": null,
"type": "string"
"type": "string",
"value": "test"
}
},
"documentation": "",
Expand Down Expand Up @@ -221,7 +225,8 @@ describe("documentation", () => {
"limits": null,
"min": null,
"max": null,
"type": "string"
"type": "string",
"value": "test"
}, "normal running has invalid return for \"testnotemptyobject\"");

deepStrictEqual(container.documentation().testnotinstanciedobject, {
Expand Down Expand Up @@ -251,7 +256,8 @@ describe("documentation", () => {
"limits": null,
"min": null,
"max": null,
"type": "string"
"type": "string",
"value": "string"
}, "normal running has invalid return for \"teststring\"");

deepStrictEqual(container.documentation().testboolean, {
Expand All @@ -260,7 +266,8 @@ describe("documentation", () => {
"limits": null,
"min": null,
"max": null,
"type": "boolean"
"type": "boolean",
"value": false
}, "normal running has invalid return for \"testboolean\"");

deepStrictEqual(container.documentation().testnumber, {
Expand All @@ -269,7 +276,8 @@ describe("documentation", () => {
"limits": null,
"min": null,
"max": null,
"type": "integer"
"type": "float",
"value": 1.2
}, "normal running has invalid return for \"testnumber\"");

deepStrictEqual(container.documentation().testinteger, {
Expand All @@ -278,7 +286,8 @@ describe("documentation", () => {
"limits": null,
"min": null,
"max": null,
"type": "integer"
"type": "integer",
"value": 1
}, "normal running has invalid return for \"testinteger\"");

deepStrictEqual(container.documentation().testbase16, {
Expand All @@ -287,7 +296,8 @@ describe("documentation", () => {
"limits": null,
"min": null,
"max": null,
"type": "integer"
"type": "integer",
"value": 165
}, "normal running has invalid return for \"testbase16\"");

deepStrictEqual(container.documentation().testfloat, {
Expand All @@ -296,7 +306,8 @@ describe("documentation", () => {
"limits": null,
"min": null,
"max": null,
"type": "float"
"type": "float",
"value": 1.1
}, "normal running has invalid return for \"testfloat\"");

});
Expand Down

0 comments on commit e062d6b

Please sign in to comment.