-
Notifications
You must be signed in to change notification settings - Fork 337
XML and JSON function work #14884
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
base: develop
Are you sure you want to change the base?
XML and JSON function work #14884
Changes from 9 commits
e57b518
0cc47cf
e6e8f64
83b0174
ad83c60
a8c8c7d
c782f8a
69f0028
3c3df66
4ff4ef5
0a3b9b6
fd8201a
3b39ec1
ce3808f
ad3f9bf
77e9834
e1192ef
bb82729
8b55a1b
d1bbd8f
4d0098a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -165,7 +165,33 @@ type Hashset | |
| private: true | ||
| --- | ||
| to_text : Text | ||
| to_text self = self.to_vector.map .pretty . join ", " "Hashset{" "}" | ||
| to_text self = | ||
| inner = self.to_vector.to_text | ||
| "{" + (inner.drop (..First 1) . drop (..Last 1)) + "}" | ||
|
|
||
| ## --- | ||
| private: true | ||
| --- | ||
| to_display_text : Text | ||
| to_display_text self = | ||
| texts = self.underlying_dictionary.keys.take (..First 40) . map _.to_display_text | ||
| suffix = if self.length > 40 then " and " + (self.length - 40).to_text + " more elements}" else "}" | ||
| "{" + (texts.join ", ") + suffix | ||
|
|
||
| ## --- | ||
| private: true | ||
| --- | ||
| pretty : Text | ||
| pretty self = | ||
| "Hashset.from_vector " + self.to_vector.pretty | ||
|
|
||
| ## Convert from a Vector to a Hashset | ||
| Hashset.from (that:Vector) (error_on_duplicates:Boolean=False) = | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Was named a long time ago to avoid some naming clashes at the time - |
||
| Hashset.from_vector that error_on_duplicates | ||
|
|
||
| ## Convert from a Hashset to a Vector | ||
| Vector.from (that:Hashset) = | ||
| that.to_vector | ||
|
|
||
| ## --- | ||
| private: true | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,13 +32,27 @@ from project.Data.Text.Extensions import all | |
| Any.to_json : Text | ||
| Any.to_json self = Json.stringify self | ||
|
|
||
| ## --- | ||
| group: Conversions | ||
| icon: convert | ||
| --- | ||
| Converts the given value to a JSON serialized value. | ||
| Any.json_stringify self -> Text = self.to_json | ||
|
||
|
|
||
| ## --- | ||
| private: true | ||
| --- | ||
| Converts the given value to a JSON serialized value. | ||
| Error.to_json : Text | ||
| Error.to_json self = self.to_js_object.to_text | ||
|
|
||
| ## --- | ||
| group: Conversions | ||
| icon: convert | ||
| --- | ||
| Converts the given value to a JSON serialized value. | ||
| Error.json_stringify self -> Text = self | ||
|
|
||
| ## --- | ||
| private: true | ||
| --- | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.