Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing examples for fix functions and additional some old workshop examples as use cases #180

Merged
merged 7 commits into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions resources/examples/Fixes/all_contain
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-yaml%0A%7Cprint%0A%3B&transformation=if+all_contain%28%22animal%5B%5D%22%2C%22o%22%29%0A++add_field%28%22note%22%2C%22All+listed+animals+have+an+o%22%29%0Aelse%0A++add_field%28%22note%22%2C%22Not+all+listed+animals+have+an+o%22%29%0Aend%0A&data=%7B%0A++%22animal%22%3A+%5B%0A++++%22dog%22%2C%22monkey%22%2C%22parrot%22%0A++%5D%0A%7D%0A%7B%0A++%22animal%22%3A+%5B%0A++++%22dog%22%2C%22cat%22%2C%22bird%22%2C%22butterfly%22%0A++%5D%0A%7D%0A%7B%0A++%22animal%22%3A+%5B%0A++++%22human%22%2C+%22turkey%22%2C+%22bear%22%0A++%5D%0A%7D
1 change: 1 addition & 0 deletions resources/examples/Fixes/all_equal
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-yaml%0A%7Cprint%0A%3B&transformation=if+all_equal%28%22animal%5B%5D%22%2C%22human%22%29%0A++add_field%28%22note%22%2C%22Only+humans%21%22%29%0Aelse%0A++add_field%28%22note%22%2C%22None+or+not+only+humans%21%22%29%0Aend&data=%7B%0A++%22animal%22%3A+%5B%0A++++%22dog%22%2C%22cat%22%2C%22bird%22%2C%22human%22%0A++%5D%0A%7D%0A%7B%0A++%22animal%22%3A+%5B%0A++++%22human%22%0A++%5D%0A%7D%0A%7B%0A++%22animal%22%3A+%5B%0A++++%22dog%22%2C%22cat%22%2C%22bird%22%2C%22butterfly%22%0A++%5D%0A%7D
1 change: 1 addition & 0 deletions resources/examples/Fixes/all_match
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-yaml%0A%7Cprint%0A%3B&transformation=if+all_match%28%22animal%5B%5D%22%2C%22.%2Ao.%2A%22%29%0A++add_field%28%22note%22%2C%22All+of+the+listed+matched+the+pattern%22%29%0Aelse%0A++add_field%28%22note%22%2C%22At+least+one+of+the+listed+did+not+match+the+pattern%22%29%0Aend%0A&data=%7B%0A++%22animal%22%3A+%5B%0A++++%22dog%22%2C%22monkey%22%2C%22parrot%22%0A++%5D%0A%7D%0A%7B%0A++%22animal%22%3A+%5B%0A++++%22dog%22%2C%22cat%22%2C%22bird%22%2C%22butterfly%22%0A++%5D%0A%7D%0A%7B%0A++%22animal%22%3A+%5B%0A++++%22human%22%2C+%22turkey%22%2C+%22bear%22%0A++%5D%0A%7D
1 change: 1 addition & 0 deletions resources/examples/Fixes/any_contain
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-yaml%0A%7Cprint%0A%3B&transformation=if+any_contain%28%22animal%5B%5D%22%2C%22o%22%29%0A++add_field%28%22note%22%2C%22At+least+one+listed+animal+has+an+o%22%29%0Aelse%0A++add_field%28%22note%22%2C%22Not+one+of+the+listed+animals+has+an+o%22%29%0Aend%0A&data=%7B%0A++%22animal%22%3A+%5B%0A++++%22dog%22%2C%22monkey%22%2C%22parrot%22%0A++%5D%0A%7D%0A%7B%0A++%22animal%22%3A+%5B%0A++++%22dog%22%2C%22cat%22%2C%22bird%22%2C%22butterfly%22%0A++%5D%0A%7D%0A%7B%0A++%22animal%22%3A+%5B%0A++++%22human%22%2C+%22turkey%22%2C+%22bear%22%0A++%5D%0A%7D
1 change: 1 addition & 0 deletions resources/examples/Fixes/any_equal
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-yaml%0A%7Cprint%0A%3B&transformation=if+any_equal%28%22animal%5B%5D%22%2C%22human%22%29%0A++add_field%28%22note%22%2C%22At+least+one+human%21%22%29%0Aelse%0A++add_field%28%22note%22%2C%22No+humans%21%22%29%0Aend&data=%7B%0A++%22animal%22%3A+%5B%0A++++%22dog%22%2C%22cat%22%2C%22bird%22%2C%22human%22%0A++%5D%0A%7D%0A%7B%0A++%22animal%22%3A+%5B%0A++++%22human%22%0A++%5D%0A%7D%0A%7B%0A++%22animal%22%3A+%5B%0A++++%22dog%22%2C%22cat%22%2C%22bird%22%2C%22butterfly%22%0A++%5D%0A%7D
1 change: 1 addition & 0 deletions resources/examples/Fixes/any_match
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-yaml%0A%7Cprint%0A%3B&transformation=if+any_match%28%22animal%5B%5D%22%2C%22.%2Ao.%2A%22%29%0A++add_field%28%22note%22%2C%22At+least+one+of+the+listed+matched+the+pattern%22%29%0Aelse%0A++add_field%28%22note%22%2C%22None+of+the+listed+did+match+the+pattern%22%29%0Aend%0A&data=%7B%0A++%22animal%22%3A+%5B%0A++++%22dog%22%2C%22monkey%22%2C%22parrot%22%0A++%5D%0A%7D%0A%7B%0A++%22animal%22%3A+%5B%0A++++%22dog%22%2C%22cat%22%2C%22bird%22%2C%22butterfly%22%0A++%5D%0A%7D%0A%7B%0A++%22animal%22%3A+%5B%0A++++%22human%22%2C+%22turkey%22%2C+%22bear%22%0A++%5D%0A%7D
1 change: 1 addition & 0 deletions resources/examples/Fixes/array
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-json%28prettyPrinting%3D%22true%22%29%0A%7Cprint%0A%3B%0A&transformation=%23+Turns+all+keys+and+values+of+an+object+into+a+list/array%0Aarray%28%22example1%22%29%0Acopy_field%28%22example1%22%2C%22example2%5B%5D%22%29%0A&data=%7B%0A++%22example1%22+%3A+%7B%0A++++%22key%22+%3A+%22word%22%2C%0A++++%22test%22+%3A+%22case%22%0A++%7D%0A%7D%0A
1 change: 1 addition & 0 deletions resources/examples/Fixes/count
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-json%28prettyPrinting%3D%22true%22%29%0A%7Cprint%0A%3B%0A&transformation=%23+Counts+array%0Acount%28%22keyword%5B%5D%22%29%0A&data=%7B%0A++%22keyword%22+%3A+%5B%0A++++%22I%22%2C%0A++++%22describe%22%2C%0A++++%22something%21%22%0A++%5D%0A%7D%0A
1 change: 1 addition & 0 deletions resources/examples/Fixes/do list_as
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-yaml%0A%7Cprint%0A%3B&transformation=%23+Iterates+over+different+arrays+and+one+can%0A%23+manipulate+the+same+index+pos+of+each+array%0A%23+at+the+same+time.%0A%0Ado+list_as%28aut%3A+%22author%5B%5D%22%2C+aff%3A+%22affiliation%5B%5D%22%29%0A++copy_field%28%22aff%22%2C%22aut.affiliation%22%29%0Aend%0A%0Aretain%28%22author%5B%5D%22%29&data=%7B%0A++%22author%22%3A+%5B%0A++++%7B%0A++++++%22name%22%3A+%22Test+Team%22%2C%0A++++++%22@type%22%3A+%22Organization%22%0A++++%7D%2C%0A++++%7B%0A++++++%22name%22%3A+%22Maxi+Muster%22%2C%0A++++++%22@type%22%3A+%22Person%22%0A++++%7D%2C%0A++++%7B%0A++++++%22name%22%3A+%22Sally+Sample%22%2C%0A++++++%22@type%22%3A+%22Person%22%0A++++%7D%0A++%5D%2C%0A++%22affiliation%22%3A+%5B%0A++++%22Org1%22%2C%22City2%22%2C%22Uni3%22%0A++%5D%0A%7D%0A
1 change: 1 addition & 0 deletions resources/examples/Fixes/exists
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-yaml%0A%7Cprint%0A%3B&transformation=do+list%28path%3A%22author%5B%5D%22%29%0A++%23+Checks+if+element+exists%0A++unless+exists%28%22@type%22%29%0A++++add_field%28%22@type%22%2C%22undefined%22%29%0A++end%0Aend%0A%0A&data=%7B%0A++%22author%22%3A+%5B%0A++++%7B%0A++++++%22name%22%3A+%22Test+Team%22%0A++++%7D%2C%0A++++%7B%0A++++++%22name%22%3A+%22Maxi+Muster%22%2C%0A++++++%22@type%22%3A+%22Person%22%0A++++%7D%2C%0A++++%7B%0A++++++%22name%22%3A+%22Sally+Sample%22%2C%0A++++++%22@type%22%3A+%22Person%22%0A++++%7D%0A++%5D%0A%7D%0A%7B%0A++%22author%22%3A+%5B%0A++++%7B%0A++++++%22@type%22%3A+%22Person%22%2C%0A++++++%22name%22%3A+%22J%C3%BCrgen+Meta%22%0A++++%7D%0A++%5D%0A%7D%0A
1 change: 1 addition & 0 deletions resources/examples/Fixes/hash
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-json%28prettyPrinting%3D%22true%22%29%0A%7Cprint%0A%3B%0A&transformation=%23+Turns+array+into+hash/object+with+keys+and+values+depending+on+the+incoming+order%2C+first+key+second+value.%0Ahash%28%22example1%22%29%0Ahash%28%22example2%5B%5D%22%29%0Acopy_field%28%22example2%5B%5D%22%2C%22example3%22%29&data=%7B%0A++%22example1%22+%3A+%22key%22%2C%0A++%22example1%22+%3A+%22word%22%2C%0A++%22example1%22+%3A+%22test%22%2C%0A++%22example1%22+%3A+%22case%22%2C%0A++%22example2%22+%3A+%5B+%22key%22%2C+%22word%22%2C+%22test%22%2C+%22case%22+%5D%0A%7D%0A
1 change: 1 addition & 0 deletions resources/examples/Fixes/if-elsif-else-conditionals
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-yaml%0A%7Cprint%0A%3B&transformation=if+any_contain%28%22animal%5B%5D%22%2C%22butterfly%22%29%0A++add_field%28%22note%22%2C%22Nice%22%29%0Aelsif+all_equal%28%22animal%5B%5D%22%2C%22human%22%29%0A++add_field%28%22note%22%2C%22We+are+doomed%21%22%29%0Aelse%0A++add_field%28%22note%22%2C%22Lets+try%21%22%29%0Aend&data=%7B%0A++%22animal%22%3A+%5B%0A++++%22dog%22%2C%22cat%22%2C%22bird%22%2C%22human%22%0A++%5D%0A%7D%0A%7B%0A++%22animal%22%3A+%5B%0A++++%22human%22%0A++%5D%0A%7D%0A%7B%0A++%22animal%22%3A+%5B%0A++++%22dog%22%2C%22cat%22%2C%22bird%22%2C%22butterfly%22%0A++%5D%0A%7D
1 change: 1 addition & 0 deletions resources/examples/Fixes/in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-yaml%0A%7Cprint%0A%3B&transformation=do+list%28path%3A%22concept%5B%5D%22%2C%22var%22%3A%22%24i%22%29%0A++%23+Checks+if+value+of+element+is+equal+to+value+in+target+element%28s%29%0A++unless+in%28%22%24i%22%2C%22keyword%5B%5D%22%29%0A++++copy_field%28%22%24i%22%2C%22keyword%5B%5D.%24append%22%29%0A++end%0Aend%0A%0A&data=%7B%0A++%22keyword%22%3A+%5B%0A++++%22Key1%22%2C%22Key2%22%0A++%5D%2C%0A++%22concept%22%3A+%5B%0A++++%22Key1%22%2C%22Con1%22%2C%22Con2%22%0A++%5D%0A%7D%0A%0A
1 change: 1 addition & 0 deletions resources/examples/Fixes/is_array
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://metafacture.org/playground/?flux=inputFile%0A%7C+open-file%0A%7Cdecode-xml%0A%7Chandle-generic-xml%0A%7C+fix%28transformationFile%29%0A%7Cencode-yaml%0A%7Cprint%0A%3B&transformation=%23+Useful+to+test+elements+of+formats+without+arrays+if+an+element+is+repeated+or+not.+Since+MF+turns+them+into+arrays%0A%0Aif+is_array%28%22field1%22%29%0A++++add_field%28%22note1%22%2C%22Field1+is+an+array/list%21%22%29%0Aelse%0A++++add_field%28%22note1%22%2C%22Field1+is+not+an+array/list%21%22%29%0Aend%0A%0Aif+is_array%28%22field2%22%29%0A++++add_field%28%22note2%22%2C%22Field2+is+an+array/list%21%22%29%0Aelse%0A++++add_field%28%22note2%22%2C%22Field2+is+not+an+array/list%21%22%29%0Aend&data=%3C%3Fxml+version%3D%221.0%22%3F%3E%0A%3Crecord%3E%0A++++%3Cfield1%3Ea%3C/field1%3E%0A++++%3Cfield1%3Eb%3C/field1%3E%0A++++%3Cfield2%3Ea%3C/field2%3E%0A%3C/record%3E
1 change: 1 addition & 0 deletions resources/examples/Fixes/is_empty
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://metafacture.org/playground/?flux=inputFile%0A%7C+open-file%0A%7Cdecode-xml%0A%7Chandle-generic-xml%0A%7C+fix%28transformationFile%29%0A%7Cencode-yaml%0A%7Cprint%0A%3B&transformation=if+is_empty%28%22field1%22%29%0A++++add_field%28%22note1%22%2C%22Field1+is+empty%22%29%0Aelse%0A++++add_field%28%22note1%22%2C%22Field1+is+not+empty%22%29%0Aend%0A%0Aif+is_empty%28%22field2%22%29%0A++++add_field%28%22note2%22%2C%22Field2+is+empty%22%29%0Aelse%0A++++add_field%28%22note2%22%2C%22Field2+is+not+empty%22%29%0Aend&data=%3C%3Fxml+version%3D%221.0%22%3F%3E%0A%3Crecord%3E%0A++++%3Cfield1%3Ea%3C/field1%3E%0A++++%3Cfield1%3Eb%3C/field1%3E%0A++++%3Cfield2+/%3E%0A%3C/record%3E
1 change: 1 addition & 0 deletions resources/examples/Fixes/is_false
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-yaml%0A%7Cprint%0A%3B&transformation=if+is_false%28%22test%22%29%0A++add_field%28%22note%22%2C%22Test+is+true+%28because+value+is+false+or+0%29%21%22%29%0Aelse%0A++add_field%28%22note%22%2C%22Test+is+not+true+%28because+value+is+not+false+or+0%29%21%22%29%0Aend&data=%7B%0A++%22test%22%3A+%22true%22%0A%7D%0A%7B%0A++%22test%22%3A+%221%22%0A%7D%0A%7B%0A++%22test%22%3A+%22false%22%0A%7D%0A%7B%0A++%22test%22%3A+%22other%22%0A%7D%0A%7B%0A++%22test%22%3A+%220%22%0A%7D
1 change: 1 addition & 0 deletions resources/examples/Fixes/is_string
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-yaml%0A%7Cprint%0A%3B&transformation=if+is_string%28%22test%22%29%0A++add_field%28%22note%22%2C%22Test+value+is+a+string+%28and+not+a+number%29%21%22%29%0Aelse%0A++add_field%28%22note%22%2C%22Test+value+is+not+a+string%22%29%0Aend&data=%7B%0A++%22test%22%3A+%2299%22%0A%7D%0A%7B%0A++%22test%22%3A+%22string%22%0A%7D%0A%7B%0A++%22test%22%3A+%7B%0A++++%22subfield%22+%3A+%22value%22%0A++%7D%0A%7D%0A
1 change: 1 addition & 0 deletions resources/examples/Fixes/is_true
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-yaml%0A%7Cprint%0A%3B&transformation=if+is_true%28%22test%22%29%0A++add_field%28%22note%22%2C%22Test+is+true%21%22%29%0Aelse%0A++add_field%28%22note%22%2C%22Test+is+not+true%21%22%29%0Aend&data=%7B%0A++%22test%22%3A+%22true%22%0A%7D%0A%7B%0A++%22test%22%3A+%221%22%0A%7D%0A%7B%0A++%22test%22%3A+%22false%22%0A%7D%0A%7B%0A++%22test%22%3A+%22other%22%0A%7D
1 change: 1 addition & 0 deletions resources/examples/Fixes/none_contain
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-yaml%0A%7Cprint%0A%3B&transformation=if+none_contain%28%22animal%5B%5D%22%2C%22o%22%29%0A++add_field%28%22note%22%2C%22None+of+the+listed+animals+has+an+o%22%29%0Aelse%0A++add_field%28%22note%22%2C%22At+least+one+of+the+listed+animals+has+an+o%22%29%0Aend%0A&data=%7B%0A++%22animal%22%3A+%5B%0A++++%22dog%22%2C%22monkey%22%2C%22parrot%22%0A++%5D%0A%7D%0A%7B%0A++%22animal%22%3A+%5B%0A++++%22dog%22%2C%22cat%22%2C%22bird%22%2C%22butterfly%22%0A++%5D%0A%7D%0A%7B%0A++%22animal%22%3A+%5B%0A++++%22human%22%2C+%22turkey%22%2C+%22bear%22%0A++%5D%0A%7D
1 change: 1 addition & 0 deletions resources/examples/Fixes/none_equal
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-yaml%0A%7Cprint%0A%3B&transformation=if+none_equal%28%22animal%5B%5D%22%2C%22human%22%29%0A++add_field%28%22note%22%2C%22No+humans%21%22%29%0Aelse%0A++add_field%28%22note%22%2C%22At+least+one+human%21%22%29%0Aend&data=%7B%0A++%22animal%22%3A+%5B%0A++++%22dog%22%2C%22cat%22%2C%22bird%22%2C%22human%22%0A++%5D%0A%7D%0A%7B%0A++%22animal%22%3A+%5B%0A++++%22human%22%0A++%5D%0A%7D%0A%7B%0A++%22animal%22%3A+%5B%0A++++%22dog%22%2C%22cat%22%2C%22bird%22%2C%22butterfly%22%0A++%5D%0A%7D
1 change: 1 addition & 0 deletions resources/examples/Fixes/none_match
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-yaml%0A%7Cprint%0A%3B&transformation=if+none_match%28%22animal%5B%5D%22%2C%22.%2Ao.%2A%22%29%0A++add_field%28%22note%22%2C+%22None+of+the+listed+did+match+the+pattern%22%29%0Aelse%0A++add_field%28%22note%22%2C%22At+least+one+of+the+listed+matched+the+pattern%22%29%0Aend%0A&data=%7B%0A++%22animal%22%3A+%5B%0A++++%22dog%22%2C%22monkey%22%2C%22parrot%22%0A++%5D%0A%7D%0A%7B%0A++%22animal%22%3A+%5B%0A++++%22dog%22%2C%22cat%22%2C%22bird%22%2C%22butterfly%22%0A++%5D%0A%7D%0A%7B%0A++%22animal%22%3A+%5B%0A++++%22human%22%2C+%22turkey%22%2C+%22bear%22%0A++%5D%0A%7D
1 change: 1 addition & 0 deletions resources/examples/Fixes/parse_text
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-json%28prettyPrinting%3D%22true%22%29%0A%7Cprint%0A%3B%0A&transformation=%23+Parses+a+text+into+an+array/list+or+hash+of+values.%0A%0Aparse_text%28%22date1%22%2C%22%28\\d%7B4%7D%29-%28\\d%7B2%7D%29-%28\\d%7B2%7D%29%22%29%0Acopy_field%28%22date1%22%2C%22date3%5B%5D%22%29%0A%0A%23+Parses+a+text+into+an+hash+of+values.%0Aparse_text%28%22date2%22%2C%22%28%3F%3Cyear%3E\\d%7B4%7D%29-%28%3F%3Cmonth%3E\\d%7B2%7D%29-%28%3F%3Cday%3E\\d%7B2%7D%29%22%29&data=%7B%0A++%22date1%22+%3A+%221918-11-11%22%2C%0A++%22date2%22+%3A+%222024-03-19%22+%0A%7D%0A
1 change: 1 addition & 0 deletions resources/examples/Fixes/paste
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-json%28prettyPrinting%3D%22true%22%29%0A%7Cprint%0A%3B%0A&transformation=paste%28%22test%22%2C%22a%22%2C+%22~+%22%2C%22b%22%2C%22~%21%22%2C+join_char%3A%22%22%29%0A&data=%7B%0A++%22a%22+%3A+%22Hello%22%2C%0A++%22b%22+%3A+%22World%22%0A%7D%0A
1 change: 1 addition & 0 deletions resources/examples/Fixes/random
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-json%28prettyPrinting%3D%22true%22%29%0A%7Cprint%0A%3B%0A&transformation=%23+Add+a+new+field%0Arandom%28%22randomValue%22%2C%22100%22%29%0A&data=%7B%0A++%22key%22+%3A+%22word%22%0A%7D%0A
1 change: 1 addition & 0 deletions resources/examples/Fixes/reverse
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-json%28prettyPrinting%3D%22true%22%29%0A%7Cprint%0A%3B%0A&transformation=%23+Add+a+new+field%0Areverse%28%22key%22%29%0A&data=%7B%0A++%22key%22+%3A+%22word%22%0A%7D%0A
1 change: 1 addition & 0 deletions resources/examples/Fixes/set_hash
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-json%28prettyPrinting%3D%22true%22%29%0A%7Cprint%0A%3B%0A&transformation=%23+Add+a+new+hash+and+a+hash+with+certain+subfields%0Aset_hash%28%22object1%22%29%0Aset_hash%28%22object2%22%2C+%22subfieldName1%22%3A+%22value1%22+%2C+%22subfieldName2%22%3A+%22value2%22%29%0A&data=%7B%0A++%22key%22+%3A+%22word%22%0A%7D%0A
1 change: 1 addition & 0 deletions resources/examples/Fixes/str_contain
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-yaml%0A%7Cprint%0A%3B&transformation=put_var%28%22test%22%2C%22alue%22%29%0A%0A%23+Useful+when+testing+variables+and+if+the+variable+is+dynamic+either+due+to+changes+in+the+fix+or+configuration+in+the+flus+workflow.%0Aif+str_contain%28%22testValue%22%2C%22%24%5Btest%5D%22%29+%0A++add_field%28%22note%22%2C%22Test+true%22%29%0Aend%0A&data=%7B%0A++%22animal%22%3A+%5B%0A++++%22dog%22%2C%22monkey%22%2C%22parrot%22%0A++%5D%0A%7D
1 change: 1 addition & 0 deletions resources/examples/Fixes/str_equal
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-yaml%0A%7Cprint%0A%3B&transformation=put_var%28%22test%22%2C%22testValue%22%29%0A%0A%23+Useful+when+testing+variables+and+if+the+variable+is+dynamic+either+due+to+changes+in+the+fix+or+configuration+in+the+flus+workflow.%0Aif+str_equal%28%22testValue%22%2C%22%24%5Btest%5D%22%29+%0A++add_field%28%22note1%22%2C%22Test+true%22%29%0Aend%0A%0A%23+Useful+when+testing+variables+and+if+the+variable+is+dynamic+either+due+to+changes+in+the+fix+or+configuration+in+the+flus+workflow.%0Aif+str_equal%28%22notestValue%22%2C%22%24%5Btest%5D%22%29+%0A++add_field%28%22note2%22%2C%22Test+true%22%29%0Aend%0A&data=%7B%0A++%22animal%22%3A+%5B%0A++++%22dog%22%2C%22monkey%22%2C%22parrot%22%0A++%5D%0A%7D
1 change: 1 addition & 0 deletions resources/examples/Fixes/str_match
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-yaml%0A%7Cprint%0A%3B&transformation=put_var%28%22test%22%2C%22testValue%22%29%0A%0A%23+Useful+when+testing+variables+and+if+the+variable+is+dynamic+either+due+to+changes+in+the+fix+or+configuration+in+the+flus+workflow.%0Aif+str_match%28%22%24%5Btest%5D%22%2C%22.%2AVal.%2A%22%29+%0A++add_field%28%22note%22%2C%22Test+true%22%29%0Aend%0A&data=%7B%0A++%22animal%22%3A+%5B%0A++++%22dog%22%2C%22monkey%22%2C%22parrot%22%0A++%5D%0A%7D
1 change: 1 addition & 0 deletions resources/examples/Fixes/substring
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-json%28prettyPrinting%3D%22true%22%29%0A%7Cprint%0A%3B%0A&transformation=substring%28%22test%22%2C%220%22%2C%223%22%29&data=%7B%0A++%22test%22+%3A+%22keyword%22%0A%7D%0A
1 change: 1 addition & 0 deletions resources/examples/Fixes/sum
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-json%28prettyPrinting%3D%22true%22%29%0A%7Cprint%0A%3B%0A&transformation=sum%28%22numbers%5B%5D%22%29%0A&data=%7B%0A++%22numbers%22+%3A+%5B+%2241%22%2C+%2242%22%2C+%226%22%2C+%226%22+%5D%0A%7D%0A
1 change: 1 addition & 0 deletions resources/examples/Fixes/timestamp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-json%28prettyPrinting%3D%22true%22%29%0A%7Cprint%0A%3B%0A&transformation=%23+Add+a+new+field%0Atimestamp%28%22date%22%2Cformat%3A+%22yyyy.MM.dd+G+%27at%27+HH%3Amm%3Ass+z%22%2C+language%3A%22de%22%29%0A&data=%7B%0A++%22key%22+%3A+%22word%22%0A%7D%0A
Loading
Loading