mirror of
https://github.com/nushell/nushell
synced 2025-01-08 11:18:58 +00:00
9 lines
302 B
Rust
9 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())
|
|
}
|