Nepotistic Pontifex Maximus

    @careteen/match

    0.2.0 • Public • Published

    match

    license Build Status npm NPM downloads

    English Document

    对象/数组属性映射 主要解决前后端并行开发或前端先行开发带来的命名不统一问题

    快速使用

    NPM

    npm i -D @careteen/match
    import Match from '@careteen/match'
    import { isEqual } from '@careteen/is'
    let preData = {
      name: 'careteen',
      age: 22
    }
    let expectData = {
      realName: 'careteen',
      realAge: 22
    }
    let actualData = Match(preData, {
      'realName': '{{name}}',
      'realAge': '{{age}}'
    })
    
    isEqual(actualData, expectData) // true

    or CDN

    <script src='https://unpkg.com/@careteen/match/dist/index.js'></script>
    <script src='https://unpkg.com/@careteen/is/dist/index.js'></script>
    <script>
      var Is = window['@careteen/is']
      var Match = window['@careteen/match']
    
      var preData = {
        name: 'careteen',
        age: 22
      }
      var expectData = {
        realName: 'careteen',
        realAge: 22
      }
      var actualData = Match(preData, {
        'realName': '{{name}}',
        'realAge': '{{age}}'
      })
    
      Is.isEqual(actualData, expectData) // true  
    </script>

    更详细使用请查看API

    兼容性

    IE9+

    使用文档

    issue模板

    贡献者及指南

    clone仓库并引入依赖

    git clone git@github.com:careteenL/match.git
    npm install

    开始开发:)

    ...

    编写详细使用文档介绍功能,可在本地查看http://127.0.0.1:8880

    npm run doc

    请编写单元测试覆盖所加功能

    npm run test

    启动本地服务器编写示例

    npm run example

    修改package.json README.md CHANGELOG.md版本号,再发布

    npm run release

    更新日志

    计划

    Keywords

    Install

    npm i @careteen/match

    DownloadsWeekly Downloads

    1

    Version

    0.2.0

    License

    MIT

    Unpacked Size

    42 kB

    Total Files

    30

    Last publish

    Collaborators

    • careteen