mirror of
https://github.com/nushell/nushell.git
synced 2024-12-15 11:42:45 +01:00
10 lines
302 B
Rust
10 lines
302 B
Rust
|
use crate::object::{Primitive, Value};
|
||
|
use crate::prelude::*;
|
||
|
|
||
|
pub fn to_json(args: CommandArgs) -> Result<OutputStream, ShellError> {
|
||
|
let out = args.input;
|
||
|
Ok(out
|
||
|
.map(|a| ReturnValue::Value(Value::Primitive(Primitive::String(serde_json::to_string(&a).unwrap()))))
|
||
|
.boxed())
|
||
|
}
|