This repository has been archived by the owner on Jan 27, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
201 additions
and
0 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
...d/fromJson/toJson/replace_allInSubfieldOfArrayOfObjectsWithAsterisk_complex/expected.json
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,27 @@ | ||
{ | ||
"dateModified" : "2020-01-01T13:05:29+00:00", | ||
"datePublished" : "2018-12-21T12:05:29+00:00", | ||
"test" : [ { | ||
"id" : "test", | ||
"dateModified" : "2020-01-01", | ||
"dateCreated" : "2018-12-21" | ||
} ] | ||
} | ||
{ | ||
"dateModified" : "2016-08-10T22:05:29+00:00", | ||
"datePublished" : "2013-12-21T12:05:29+00:00", | ||
"test" : [ { | ||
"id" : "test", | ||
"dateModified" : "2016-08-10", | ||
"dateCreated" : "2013-12-21" | ||
} ] | ||
} | ||
{ | ||
"dateModified" : "2010-08-29T12:05:29+00:00", | ||
"datePublished" : "2000-01-21T12:05:29+00:00", | ||
"test" : [ { | ||
"id" : "test", | ||
"dateModified" : "2010-08-29", | ||
"dateCreated" : "2000-01-21" | ||
} ] | ||
} |
29 changes: 29 additions & 0 deletions
29
...thod/fromJson/toJson/replace_allInSubfieldOfArrayOfObjectsWithAsterisk_complex/input.json
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 @@ | ||
{ | ||
"dateModified": "2020-01-01T13:05:29+00:00", | ||
"datePublished": "2018-12-21T12:05:29+00:00", | ||
"test" : [ | ||
{ | ||
"id" : "test" | ||
} | ||
] | ||
} | ||
{ | ||
"dateModified": "2016-08-10T22:05:29+00:00", | ||
"datePublished": "2013-12-21T12:05:29+00:00", | ||
"test" : [ | ||
{ | ||
"id" : "test" | ||
} | ||
] | ||
} | ||
{ | ||
"dateModified": "2010-08-29T12:05:29+00:00", | ||
"datePublished": "2000-01-21T12:05:29+00:00", | ||
"test" : [ | ||
{ | ||
"id" : "test" | ||
} | ||
] | ||
} | ||
|
||
|
5 changes: 5 additions & 0 deletions
5
...method/fromJson/toJson/replace_allInSubfieldOfArrayOfObjectsWithAsterisk_complex/test.fix
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,5 @@ | ||
copy_field("dateModified", "test[].$last.dateModified") | ||
replace_all("test[].*.dateModified", 'T.*', '') | ||
|
||
copy_field("datePublished", "test[].$last.dateCreated") | ||
replace_all("test[].*.dateCreated", 'T.*', '') |
8 changes: 8 additions & 0 deletions
8
...ethod/fromJson/toJson/replace_allInSubfieldOfArrayOfObjectsWithAsterisk_complex/test.flux
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 @@ | ||
FLUX_DIR + "input.json" | ||
|open-file | ||
|as-records | ||
|decode-json | ||
|fix(FLUX_DIR + "test.fix") | ||
|encode-json(prettyPrinting="true") | ||
|write(FLUX_DIR + "output-metafix.json") | ||
; |
30 changes: 30 additions & 0 deletions
30
...fromJson/toJson/replace_allInSubfieldOfArrayOfObjectsWithAsterisk_complex_2/expected.json
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,30 @@ | ||
{ | ||
"id" : "test", | ||
"dateModified" : "2020-01-01T13:05:29+00:00", | ||
"datePublished" : "2018-12-21T12:05:29+00:00", | ||
"test" : [ { | ||
"id" : "test", | ||
"dateModified" : "2020-01-01", | ||
"dateCreated" : "2018-12-21" | ||
} ] | ||
} | ||
{ | ||
"id" : "test", | ||
"dateModified" : "2016-08-10T22:05:29+00:00", | ||
"datePublished" : "2013-12-21T12:05:29+00:00", | ||
"test" : [ { | ||
"id" : "test", | ||
"dateModified" : "2016-08-10", | ||
"dateCreated" : "2013-12-21" | ||
} ] | ||
} | ||
{ | ||
"id" : "test", | ||
"dateModified" : "2010-08-29T12:05:29+00:00", | ||
"datePublished" : "2000-01-21T12:05:29+00:00", | ||
"test" : [ { | ||
"id" : "test", | ||
"dateModified" : "2010-08-29", | ||
"dateCreated" : "2000-01-21" | ||
} ] | ||
} |
17 changes: 17 additions & 0 deletions
17
...od/fromJson/toJson/replace_allInSubfieldOfArrayOfObjectsWithAsterisk_complex_2/input.json
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,17 @@ | ||
{ | ||
"id" : "test", | ||
"dateModified": "2020-01-01T13:05:29+00:00", | ||
"datePublished": "2018-12-21T12:05:29+00:00" | ||
} | ||
{ | ||
"id" : "test", | ||
"dateModified": "2016-08-10T22:05:29+00:00", | ||
"datePublished": "2013-12-21T12:05:29+00:00" | ||
} | ||
{ | ||
"id" : "test", | ||
"dateModified": "2010-08-29T12:05:29+00:00", | ||
"datePublished": "2000-01-21T12:05:29+00:00" | ||
} | ||
|
||
|
8 changes: 8 additions & 0 deletions
8
...thod/fromJson/toJson/replace_allInSubfieldOfArrayOfObjectsWithAsterisk_complex_2/test.fix
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 @@ | ||
set_array("test[]") | ||
copy_field("id", "test[].$append.id") | ||
|
||
copy_field("dateModified", "test[].$last.dateModified") | ||
replace_all("test[].*.dateModified", 'T.*', '') | ||
|
||
copy_field("datePublished", "test[].$last.dateCreated") | ||
replace_all("test[].*.dateCreated", 'T.*', '') |
8 changes: 8 additions & 0 deletions
8
...hod/fromJson/toJson/replace_allInSubfieldOfArrayOfObjectsWithAsterisk_complex_2/test.flux
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 @@ | ||
FLUX_DIR + "input.json" | ||
|open-file | ||
|as-records | ||
|decode-json | ||
|fix(FLUX_DIR + "test.fix") | ||
|encode-json(prettyPrinting="true") | ||
|write(FLUX_DIR + "output-metafix.json") | ||
; |
33 changes: 33 additions & 0 deletions
33
...fromJson/toJson/replace_allInSubfieldOfArrayOfObjectsWithAsterisk_complex_3/expected.json
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,33 @@ | ||
{ | ||
"id" : "test", | ||
"dateModified" : "2020-01-01T13:05:29+00:00", | ||
"datePublished" : "2018-12-21T12:05:29+00:00", | ||
"dateCreated" : "2018-12-21", | ||
"test" : [ { | ||
"id" : "test", | ||
"dateModified" : "2020-01-01", | ||
"dateCreated" : "2018-12-21" | ||
} ] | ||
} | ||
{ | ||
"id" : "test", | ||
"dateModified" : "2016-08-10T22:05:29+00:00", | ||
"datePublished" : "2013-12-21T12:05:29+00:00", | ||
"dateCreated" : "2013-12-21", | ||
"test" : [ { | ||
"id" : "test", | ||
"dateModified" : "2016-08-10", | ||
"dateCreated" : "2013-12-21" | ||
} ] | ||
} | ||
{ | ||
"id" : "test", | ||
"dateModified" : "2010-08-29T12:05:29+00:00", | ||
"datePublished" : "2000-01-21T12:05:29+00:00", | ||
"dateCreated" : "2000-01-21", | ||
"test" : [ { | ||
"id" : "test", | ||
"dateModified" : "2010-08-29", | ||
"dateCreated" : "2000-01-21" | ||
} ] | ||
} |
17 changes: 17 additions & 0 deletions
17
...od/fromJson/toJson/replace_allInSubfieldOfArrayOfObjectsWithAsterisk_complex_3/input.json
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,17 @@ | ||
{ | ||
"id" : "test", | ||
"dateModified": "2020-01-01T13:05:29+00:00", | ||
"datePublished": "2018-12-21T12:05:29+00:00" | ||
} | ||
{ | ||
"id" : "test", | ||
"dateModified": "2016-08-10T22:05:29+00:00", | ||
"datePublished": "2013-12-21T12:05:29+00:00" | ||
} | ||
{ | ||
"id" : "test", | ||
"dateModified": "2010-08-29T12:05:29+00:00", | ||
"datePublished": "2000-01-21T12:05:29+00:00" | ||
} | ||
|
||
|
11 changes: 11 additions & 0 deletions
11
...thod/fromJson/toJson/replace_allInSubfieldOfArrayOfObjectsWithAsterisk_complex_3/test.fix
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,11 @@ | ||
copy_field("datePublished", "dateCreated") | ||
replace_all("dateCreated", 'T.*', '') | ||
|
||
set_array("test[]") | ||
copy_field("id", "test[].$append.id") | ||
|
||
copy_field("dateModified", "test[].$last.dateModified") | ||
replace_all("test[].*.dateModified", 'T.*', '') | ||
|
||
copy_field("datePublished", "test[].$last.dateCreated") | ||
replace_all("test[].*.dateCreated", 'T.*', '') |
8 changes: 8 additions & 0 deletions
8
...hod/fromJson/toJson/replace_allInSubfieldOfArrayOfObjectsWithAsterisk_complex_3/test.flux
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 @@ | ||
FLUX_DIR + "input.json" | ||
|open-file | ||
|as-records | ||
|decode-json | ||
|fix(FLUX_DIR + "test.fix") | ||
|encode-json(prettyPrinting="true") | ||
|write(FLUX_DIR + "output-metafix.json") | ||
; |