mirror of
https://github.com/nushell/nushell.git
synced 2025-02-03 03:59:23 +01:00
d9d6cea5a9
* Make json require string and pass around metadata The json deserializer was accepting any inputs by coercing non-strings into strings. As an example, if the input was `[1, 2]` the coercion would turn into `[12]` and deserialize as a list containing number twelve instead of a list of two numbers, one and two. This could lead to silent data corruption. Aside from that pipeline metadata wasn't passed aroud. This commit fixes the type issue by adding a strict conversion function that errors if the input type is not a string or external stream. It then uses this function instead of the original `collect_string()`. In addition, this function returns the pipeline metadata so it can be passed along. * Make other formats require string The problem with json coercing non-string types to string was present in all other text formats. This reuses the `collect_string_strict` function to fix them. * `IntoPipelineData` cleanup The method `into_pipeline_data_with_metadata` can now be conveniently used. |
||
---|---|---|
.. | ||
assets | ||
proptest-regressions/format_conversions | ||
src | ||
tests | ||
build.rs | ||
Cargo.toml | ||
LICENSE |