All Projects → MrXujiang → xijs

MrXujiang / xijs

Licence: MIT license
A business - oriented scene Js Library

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to xijs

whc-json-to-class
javascript版本json自动转换生成对应语言模型类The whc-json-to-class is the javascript plug-in that automatically converts the json string to the corresponding language model class
Stars: ✭ 24 (-73.63%)
Mutual labels:  json-api, json-parser
format-to-json
An algorithm that can format a string to json-like template. 字符串JSON格式化的算法。
Stars: ✭ 30 (-67.03%)
Mutual labels:  json-api, json-parser
Mojojson
A simple and fast JSON parser.
Stars: ✭ 271 (+197.8%)
Mutual labels:  json-api, json-parser
JSONinSV
JSON lib in Systemverilog
Stars: ✭ 25 (-72.53%)
Mutual labels:  json-api, json-parser
json
a portable, powerful and pure functional JSON library for Scheme
Stars: ✭ 40 (-56.04%)
Mutual labels:  json-api, json-parser
groq-cli
Run GROQ in your command line
Stars: ✭ 139 (+52.75%)
Mutual labels:  json-api, json-parser
Dictfier
Python library to convert/serialize class instances(Objects) both flat and nested into a dictionary data structure. It's very useful in converting Python Objects into JSON format
Stars: ✭ 67 (-26.37%)
Mutual labels:  json-api, json-parser
Json Apis With Github
🔨 Tool to make Simple and Quick JSON APIs with GitHub.
Stars: ✭ 240 (+163.74%)
Mutual labels:  json-api
json-peek
Stringify JSON *just enough* to see what it is
Stars: ✭ 33 (-63.74%)
Mutual labels:  stringify
Crnk Framework
JSON API library for Java
Stars: ✭ 234 (+157.14%)
Mutual labels:  json-api
Datoji
A tiny JSON storage service. Create, Read, Update, Delete and Search JSON data.
Stars: ✭ 222 (+143.96%)
Mutual labels:  json-api
Jsonapi Rails
Rails gem for fast jsonapi-compliant APIs.
Stars: ✭ 242 (+165.93%)
Mutual labels:  json-api
rest-api
Laravel restfull api boilerplate
Stars: ✭ 57 (-37.36%)
Mutual labels:  json-api
Iotwifi
Raspberry Pi (arm) wifi configuration container. Configure and control wifi connectivity with a JSON based REST api.
Stars: ✭ 236 (+159.34%)
Mutual labels:  json-api
Indian-States-and-Cities-Android
Offline Android App to illustrate Auto Complete Indian cities and states text views
Stars: ✭ 19 (-79.12%)
Mutual labels:  json-parser
Json2typescript
Convert JSON to TypeScript with secure type checking!
Stars: ✭ 230 (+152.75%)
Mutual labels:  json-api
fn
No description or website provided.
Stars: ✭ 28 (-69.23%)
Mutual labels:  json-api
druxt.js
The Fully Decoupled Drupal Framework
Stars: ✭ 96 (+5.49%)
Mutual labels:  json-api
FixLanguageTypeJs
Tiny Library for fix problem of language selection in type text.
Stars: ✭ 15 (-83.52%)
Mutual labels:  js-library
stringify-keys
Build an array of key paths from an object.
Stars: ✭ 18 (-80.22%)
Mutual labels:  stringify

xijs

招募有想法, 热衷技术的小伙伴一起共建啦! 致力于打造最好用的前端工具库, 您可以提 issue 或者 pr 来共建项目, 或者加作者微信, 一起让项目更健壮.

一款面向复杂业务场景的 js 类库, 目前已支持:

  • parser json 解析器, 在原生 json api 基础上支持序列化和反序列化函数, 正则等
  • store 一款支持设置过期时间且支持回调的本地缓存库, 基于 localStorage 二次封装
  • formatDate 支持自定义的时间格式化函数
  • obj2url 将对象转换成编码后的 url 字符串
  • url2obj 将 url 字符串转换成对象
  • isPc 判断设备是否为 pc 端类型
  • debounce 防抖函数
  • throttle 节流函数
  • randomStr 生成指定个数随机字符串的函数
  • uuid 生成唯一 id
  • shuffle 数组乱序, 洗牌算法
  • randomStr 生成随机字符串
  • transformTree 将扁平数组转换成树结构

等等开发中常用的工具函数, 轻松提高业务研发效率.

API Doc

xijs 文档

parser

该 json 解析器基于原生JSON API进行的上层封装, 支持序列化函数类型

  • 支持原生 json api 调用方式nativeStringify, nativeParse
  • 支持序列化和反序列化函数 stringify, fastStringify, parse
  • 支持序列化和反序列化正则 stringify, fastStringify, parse
  • 内置开箱即用的工具方法
    • 判断函数类型 isFunc
    • 判断对象类型 isObj
    • 判断数组类型 isArr
    • 判断对象或数组类型 isArrOrObj
    • 判断正则类型 isRegExp

Demo:

/**
 * title: 打开控制台查看结果
 */
import { parser } from 'xijs';

const door = {
  a: 1,
  b: function () {},
  c: {
    c1: 'h5-dooring',
    c2: () => {},
    c3: {
      c: '3fvc',
      d: {
        dd: () => {},
        ee: /[a-z]/g,
      },
    },
  },
  d: /[0-9]/g,
};

// 将对象序列化
console.log('stringify', parser.stringify(door));
console.log('fastStringify', parser.fastStringify(door));

// 将json数据反解析成对象
console.log(parser.parse(parser.stringify(door)));

console.log('native stringify', parser.nativeStringify(door));

注意⚠️

对于出现regeneratorRuntime is not defined问题的解决, 我们可以在webpack做如下配置, 来支持es的async / await :

npm install --save-dev @babel/plugin-transform-runtime

配置:

 use: {
     loader: 'babel-loader',
     options: {
         plugins: ["@babel/plugin-transform-runtime"]
     }
 }

更多推荐

name Description
H5-Dooring 让 H5 制作像搭积木一样简单, 轻松搭建 H5 页面, H5 网站, PC 端网站, LowCode 平台.
V6.Dooring 可视化大屏解决方案, 提供一套可视化编辑引擎, 助力个人或企业轻松定制自己的可视化大屏应用.
dooring-electron-lowcode 基于 electron 的 H5-Dooring 编辑器桌面端.
DooringX 快速高效搭建可视化拖拽平台.

赞助 | Sponsored

开源不易, 有了您的赞助, 我们会做的更好~

共建 | Contribute

欢迎参与到项目的共建中, 您可以提 issue 或者 pr 来共建项目, 或者加作者微信, 一起让项目更健壮.

技术反馈和交流群 | Technical feedback and communication

微信:beautifulFront

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].