-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: move stringify function to block-store-actions-functions
- Loading branch information
Thomas Timmer
committed
Jul 12, 2024
1 parent
ee04b43
commit 37584bc
Showing
3 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import stringify from '../../../functions/stringify/1.0'; | ||
|
||
describe('stringify', () => { | ||
test('It returns the given string value', async () => { | ||
const { result } = await stringify({ value: { test: [1, 2, 3] } }); | ||
expect(JSON.parse(result)).toEqual({ test: [1, 2, 3] }); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"description": "Stringify a value", | ||
"label": "Stringify", | ||
"category": "Misc", | ||
"icon": { | ||
"name": "TextIcon", | ||
"color": "Purple" | ||
}, | ||
"options": [{ | ||
"meta": { | ||
"type": "Value", | ||
"allowedKinds": [] | ||
}, | ||
"name": "value", | ||
"label": "Value", | ||
"advanced": false | ||
}, | ||
{ | ||
"meta": { | ||
"type": "Output", | ||
"output": { | ||
"type": "Text" | ||
} | ||
}, | ||
"name": "result", | ||
"label": "Result" | ||
}], | ||
"yields": "NONE" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
const stringify = async ({ value }) => { | ||
return { | ||
result: JSON.stringify(value), | ||
}; | ||
}; | ||
|
||
export default stringify; |