Title: add_multi_constructor equivalent / unknown tag handler · Issue #385 · nodeca/js-yaml · GitHub
Open Graph Title: add_multi_constructor equivalent / unknown tag handler · Issue #385 · nodeca/js-yaml
X Title: add_multi_constructor equivalent / unknown tag handler · Issue #385 · nodeca/js-yaml
Description: In PyYAML, I can use the add_multi_constructor feature to allow me to define a constructor for multiple tags. I am using it to handle any unknown tags. For example, I could use this to deserialize the document thing1: !someTag asdf thing...
Open Graph Description: In PyYAML, I can use the add_multi_constructor feature to allow me to define a constructor for multiple tags. I am using it to handle any unknown tags. For example, I could use this to deserialize ...
X Description: In PyYAML, I can use the add_multi_constructor feature to allow me to define a constructor for multiple tags. I am using it to handle any unknown tags. For example, I could use this to deserialize ...
Opengraph URL: https://github.com/nodeca/js-yaml/issues/385
X: @github
Domain: redirect.github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"add_multi_constructor equivalent / unknown tag handler","articleBody":"In PyYAML, I can use the `add_multi_constructor` feature to allow me to define a constructor for multiple tags. I am using it to handle any unknown tags. For example, I could use this to deserialize the document\r\n```yaml\r\nthing1: !someTag asdf\r\nthing2: !someOtherTag fdsa\r\n```\r\n\r\ninto the JS structure\r\n```js\r\n{\r\n thing1: UnknownTag { tag: 'someTag', value: 'asdf' },\r\n thing2: UnknownTag { tag: 'someOtherTag', value: 'fdsa' }\r\n}\r\n```\r\n\r\nand be able to re-serialize that structure back into equivalent yaml.\r\n\r\nMy use case is to read and modify a tiny part of a big yaml file that has a bunch of domain-specific tags in it. I don't care how the tags are resolved as I'm not reading that part of the file, but currently with js-yaml I can't read it at all because to parse the file in the first place results in an unknown tag error. Even if I set it to skip unknown tags, I can't re-serialize the modified docjument.\r\n\r\nThis is fine with PyYAML as I can use `add_multi_constructor` as defined above to handle any unknown tags, but as far as I can tell this behvaiour is impossible to achieve with js-yaml.","author":{"url":"https://github.com/akdor1154","@type":"Person","name":"akdor1154"},"datePublished":"2017-12-06T02:03:21Z","url":"https://github.com/nodeca/js-yaml/issues/385"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:f60855e3-af59-5345-07ae-b3b0fa633598 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C7EE:2E466E:3819C2:4DD074:6AEDB5FC |
| html-safe-nonce | e7932b910cfbb1172f0eaee522efe66481de71e5c3b5f2d9a3cb8d9229aa1855 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDN0VFOjJFNDY2RTozODE5QzI6NEREMDc0OjZBRURCNUZDIiwidmlzaXRvcl9pZCI6IjgzNzAzMzE1MDcyMDAyMTA0MjgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 84601667038d1cbbe5689e22705e5be886aeefe670901e144c56a267a4b44e46 |
| hovercard-subject-tag | issue:279598914 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodeca/js-yaml/385/issue_layout |
| twitter:image | https://opengraph.githubassets.com/583e02b4818123b2f060b551390ac7a66df69c79a8915fa437bfefb9a367e69d/nodeca/js-yaml/issues/385 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/583e02b4818123b2f060b551390ac7a66df69c79a8915fa437bfefb9a367e69d/nodeca/js-yaml/issues/385 |
| og:image:alt | In PyYAML, I can use the add_multi_constructor feature to allow me to define a constructor for multiple tags. I am using it to handle any unknown tags. For example, I could use this to deserialize ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | akdor1154 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 1eb5f7cedbc707472687eab1a30e6c4619c00791815622ceaba9694eb161930f |
| turbo-cache-control | no-preview |
| go-import | github.com/nodeca/js-yaml git https://github.com/nodeca/js-yaml.git |
| octolytics-dimension-user_id | 723678 |
| octolytics-dimension-user_login | nodeca |
| octolytics-dimension-repository_id | 2504175 |
| octolytics-dimension-repository_nwo | nodeca/js-yaml |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 2504175 |
| octolytics-dimension-repository_network_root_nwo | nodeca/js-yaml |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f31f9c89203c022acdb651c34ae048cf41764208 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width