mirror of
https://github.com/nushell/nushell
synced 2025-01-09 03:39:03 +00: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())
|
||
|
}
|