json-to-any
TypeScript icon, indicating that this package has built-in type declarations

6.0.1 • Public • Published

json-to-any

支持json转换任意代码格式,支持层级嵌套生成

安装

npm install json-to-any --save

使用

参考 在线演示项目

import { parse } from "json-to-any";

// 支持js对象
// 支持json数据
const jsonCode = {
  name: "Jack",
  age: 20,
  car: {
    brand: "BMW",
  }
};

const options = {
  original: false, // 是否保留原始数据
};
const entityList = parse(jsonCode, options);

Options

name type default desc
original boolean false 是否保留原始结构
true:不做任何处理
false:过滤掉所有name相同,key+value类型相同的实体

Package Sidebar

Install

npm i json-to-any

Weekly Downloads

1

Version

6.0.1

License

ISC

Unpacked Size

11.3 kB

Total Files

20

Last publish

Collaborators

  • xietiansheng