npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

czb-bet-content-parse

v1.0.96

Published

投注内容格式化

Readme

[TOC]

介绍

将注码解析为统一的格式

用法

  1. npm i czb-bet-content-parse --save

  2. import BetContentParse from 'czb-bet-content-parse';

  3. 调用方式

let result = BetContentParse({
  lotNo: lotNo,       // 彩种代码
  winCode: winCode,   // 开奖号码
  betCode: betCode,   // 投注的内容
  lotMulti: lotMulti, // 倍数
  jingcaiResults: jingcaiResults, // 竞彩比赛集合(数字彩无此属性)
});

解析后格式说明

双色球

// 格式说明 
-  [{playType: "胆拖",   // 玩法
-  reds: [
-    // 投注的红球
-    {num: "13", isHit: false}, // num:号码  isHit:是否中奖
-    // ...
-  ],
-  blues: [
-    // 投注的蓝球
-    {num: "02", isHit: false},
-    // ...
-  ],
-  fixedReds: [{num: "01", isHit: false}] // 胆码
-}, {
-  playType: "单式",
-  reds: [
-    {num: "11", isHit: false},
-    // ...
-  ],
-  blues: [{num: "04", isHit: false}],
-  fixedReds: null    
-}, {
-  playType: "复式",
-  reds: [
-    {num: "01", isHit: false},
-    // ...
-  ],
-  blues: [
-    {num: "09", isHit: false},
-    // ...
-  ],
-  fixedReds: null
-}];

山东十一选五

// 格式说明 153@02*030405060708091011^       162@01*010203*010203^
[{
    playType:'任选四 胆拖',       //玩法
    isDan:true,                  //是否为胆拖 是则用#连接  否则用|连接
    nums:[
    [
      {num:'01',isHit:false},    
      {num:'02',isHit:false}

    ],
    [
      {num:'03',isHit:false},
      {num:'04',isHit:false},
      {num:'05',isHit:false}
    ]
  ]
 }];

广东十一选五

//返回格式说明
[{
    playType:'前二组选 胆拖',
    isDan:true,
    nums:[              //数组之间 如果是胆拖 以#连接; 否则以|连接
        [
            {num:'05',isHit:false},
        ],[
            {num:'03',isHit:true},
            {num:'04',isHit:false},
            {num:'06',isHit:false},
            {num:'07',isHit:false},
            {num:'09',isHit:true}
        ]
    ]
}]

任选九

// 格式说明
[
  {
    isDan:false,    //是否是胆拖
    teamId:'2',
    day:'2017195',
    host:'切尔西',     //主
    guest:'斯托克',    //客
    result:'胜',       //比赛结果
    league: '',
    enddate: '12-31 00:55',
    peilvs:[{
      isHit:true,     //是否中奖
      type:'胜',       //投注内容
    }]
  },{
    isDan:false,
    teamId:'4',
    day:'2017195',
    host:'利物浦',
    guest:'莱切城',
    result:'胜',
    league: '',
    enddate: '12-31 00:55',
    peilvs:[{
      isHit:true,
      type:'胜',
    }]
  }
]

大乐透

// 格式说明
[{
  playType: "单式",
  reds: [
    {num: "02", isHit: false}, // num:号码  isHit:是否中奖
    {num: "12", isHit: false},
    {num: "13", isHit: false},
    {num: "30", isHit: false},
    {num: "33", isHit: false},
  ],
  blues: [
    {num: "06", isHit: false},
    {num: "11", isHit: false},
  ],
  fixedReds: null,  // 红球胆码
  fixedBlues: null  // 篮球胆码
}, {
  playType: "复式",
  reds: [
    {num: "01", isHit: false},
    // ...
  ],
  blues: [
    {num: "01", isHit: false},
    // ...
  ],
  fixedReds: null,
  fixedBlues: null
}, {
  playType: "胆拖",
  reds: [
    {num: "10", isHit: false},
    // ...
  ],
  blues: [
    {num: "05", isHit: false},
    // ...
  ],
  fixedReds: [{num: "32", isHit: false}],
  fixedBlues: [{num: "02", isHit: false}]
}];

福彩3D

// 格式说明
[{
  playType: "组六普通",	// 玩法
  nums: [[
    {num: "02", isHit: false}, 	// num:号码  isHit:是否中奖
    // ...
  ]]
}, {
  playType: "组三复式",
  nums: [[
    {num: "02", isHit: false},
    {num: "04", isHit: false},
    {num: "06", isHit: false},
  ]]
}, {
  playType: "组三单式",
  nums: [[
    {num: "03", isHit: false},
    {num: "08", isHit: true},
    {num: "08", isHit: false},
  ]]
}, {
  playType: "直选普通",
  nums: [[
    {num: "04", isHit: false},
    {num: "06", isHit: false},
  ], [
    {num: "02", isHit: false},
  ], [
    {num: "04", isHit: false},
    {num: "05", isHit: true},
  ]]
}];

排列3

// 格式说明
[{
  playType: "组六",	// 玩法
  nums: [[
    {num: "0", isHit: false},	// num:号码  isHit:是否中奖
    // ...
  ]]
}, {
  playType: "组三复式",
  nums: [[
    {num: "0", isHit: false},
    // ...
  ]]
}, {
  playType: "组三单式",
  nums: [[
    {num: "1", isHit: false},
    {num: "1", isHit: false},
    {num: "2", isHit: false},
  ]]
}, {
  playType: "直选",
  nums: [[
    {num: "1", isHit: false},
    {num: "2", isHit: false},
  ], [
    {num: "2", isHit: false},
    {num: "3", isHit: false},
  ], [
    {num: "3", isHit: false},
    {num: "4", isHit: false},
  ]]
}];

排列5

// 格式说明
[{
  playType: "直选普通",	// 玩法
  nums: [[
    {num: "0", isHit: true},	// num:号码  isHit:是否中奖
    {num: "1", isHit: false},
    {num: "3", isHit: false},
  ], [
    {num: "2", isHit: false},
    {num: "6", isHit: false},
  ], [
    {num: "2", isHit: false},
    {num: "5", isHit: false},
  ], [
    {num: "1", isHit: true},
    {num: "2", isHit: false},
    {num: "4", isHit: false},
    {num: "6", isHit: false},
  ], [
    {num: "2", isHit: false},
    {num: "3", isHit: false},
  ]]
}, {
  playType: "直选普通",
  nums: [[
    {num: "1", isHit: false},
  ], [
    {num: "7", isHit: false},
  ], [
    {num: "4", isHit: false},
  ], [
    {num: "9", isHit: false},
  ], [
    {num: "0", isHit: true},
  ]]
}]

七乐彩

// 格式说明
[{
  playType: "单式",	// 玩法
  nums: [
    {num: "05", isHit: false},	// num:号码  isHit:是否中奖
    {num: "12", isHit: false},
    {num: "13", isHit: false},
    {num: "14", isHit: false},
    {num: "19", isHit: true},
    {num: "26", isHit: false},
    {num: "30", isHit: false},
  ],
  fixeds: null
}, {
  playType: "复式",
  nums: [
    {num: "04", isHit: false},
    {num: "14", isHit: false},
    {num: "17", isHit: false},
    {num: "19", isHit: true},
    {num: "21", isHit: true},
    {num: "24", isHit: false},
    {num: "25", isHit: false},
    {num: "26", isHit: false},
    {num: "27", isHit: true},
  ],
  fixeds: null
}, {
  playType: "胆拖",
  nums: [
    {num: "06", isHit: false},
    {num: "13", isHit: false},
    {num: "15", isHit: false},
    {num: "17", isHit: false},
    {num: "25", isHit: false},
    {num: "27", isHit: true},
  ],
  fixeds: [
    {num: "07", isHit: true},
    {num: "16", isHit: true},
  ]
}]

七星彩

// 格式说明
[{
  playType: '直选普通',  // 玩法
  nums: [[
    {num: "2", isHit: false},  // num:号码  isHit:是否中奖
  ], [
    {num: "2", isHit: true},
  ], [
    {num: "2", isHit: false},
  ], [
    {num: "2", isHit: false},
  ], [
    {num: "2", isHit: false},
  ], [
    {num: "2", isHit: false},
  ], [
    {num: "2", isHit: false},
  ]]
}];

竞彩足球

// 格式说明
{
  playType: ['2串1', '3串1'], // 串关玩法
    matches: [
      {
        isDan: false,   // 是否为胆
        teamId: '001',
        week: '周三',
        day: '20171227',
        letpoint: '-1',
        host: '奥斯坦德',
        guest: '亨克',
        firsthalfresult: '', // 上半场结果
        result: '',
        league: '',
        enddate: '12-31 00:55',
        peilvs: [{
          isHit: true,    // 是否命中
          type: '胜',     // 玩法
          peilv: '1.00'   // 赔率
        }, {
          isHit: true,
          peilv: '1.00',
          type: '让负',
        }, {
          isHit: true,
          peilv: '1.00',
          type: '让平'
        }],
        openResults: null // 开奖结果, 只包含投注的类型, 未开奖为null
      }, {
        isDan: false,
        teamId: '002',
        week: '周三',
        day: '20171227',
        letpoint: '+1',
        host: '科特赖克',
        guest: '标准列日',
        firsthalfresult: '0:0',
        result: '2:1',
        league: '',
        enddate: '12-31 00:55',
        peilvs: [{
          isHit: true,
          peilv: '3.10',
          type: '胜'
        }],
        openResults: [
          '主胜'
        ]
      }, {
        isDan: false,
        teamId: '003',
        week: '周三',
        day: '20171227',
        letpoint: '-1',
        host: '圣图尔登',
        guest: '安特卫普',
        firsthalfresult: '0:2',
        result: '0:3',
        league: '',
        enddate: '12-31 00:55',
        peilvs: [{
          isHit: false,
          peilv: '3.90',
          type: '让胜'
        }],
        openResults: [
          '让球主负'
        ]
      }
    ]
};

北京单场

// 格式说明
{
  playType: ['2串1', '3串1'], // 串关玩法
    matches: [
      {
        teamId: '001',
        week: '周三',
        day: '20171227',
        letpoint: '-1',
        host: '奥斯坦德',
        guest: '亨克',
        firsthalfresult: '', // 上半场结果
        result: '',
        league: '',
        enddate: '12-31 00:55',
        peilvs: [{
          isHit: false,    // 是否命中
          type: '上单',     // 玩法
          peilv: '1.00'   // 赔率
        }, {
          isHit: false,
          peilv: '1.00',
          type: '下双',
        }, {
          isHit: false,
          peilv: '1.00',
          type: '上双'
        }],
        openResults: null // 开奖结果, 只包含投注的类型, 未开奖为null
      }, {
        teamId: '002',
        week: '周三',
        day: '20171227',
        letpoint: '0',
        host: '科特赖克',
        guest: '标准列日',
        firsthalfresult: '',
        result: '',
        league: '',
        enddate: '12-31 00:55',
        peilvs: [{
          isHit: true,
          peilv: '3.10',
          type: '上单'
        }],
        openResults: [
          '上单'
        ]
      }, {
        teamId: '003',
        week: '周三',
        day: '20171227',
        letpoint: '0',
        host: '圣图尔登',
        guest: '安特卫普',
        firsthalfresult: '',
        result: '',
        league: '',
        enddate: '12-31 00:55',
        peilvs: [{
          isHit: true,
          peilv: '3.90',
          type: '下双'
        }],
        openResults: [
          '下双'
        ]
      }
    ]
};

竞彩篮球

// 格式说明
{
  playType: ['2串1', '3串1'], // 串关玩法
    matches: [
      {
        isDan: false, // 是否为胆
        teamId: '301',
        week: '周四',
        day: '20171207',
        letpoint: null,
        host: '萨基利斯',
        guest: '帕纳辛纳',
        result: '74:80',  // 结果  客队:主队
        league: '',
        enddate: '12-31 00:55',
        peilvs: [{
          isHit: false,   // 是否命中
          type: '负',     // 玩法
          peilv: null     // 赔率
        }],
        openResults: [   // 开奖结果, 只包含投注的类型
          '主胜'
        ]
      }, {
        isDan: true,
        teamId: '302',
        week: '周四',
        day: '20171207',
        letpoint: null,
        host: '布罗斯',
        guest: '莫陆军',
        result: '92:76',
        league: '',
        enddate: '12-31 00:55',
        peilvs: [{
          isHit: false,
          type: '胜',
          peilv: null
        }],
        openResults: [
          '主负'
        ]
      }, {
        isDan: false,
        teamId: '303',
        week: '周四',
        day: '20171207',
        letpoint: null,
        host: '特马卡比',
        guest: '巴伦西亚',
        result: '91:94',
        league: '',
        enddate: '12-31 00:55',
        peilvs: [{
          isHit: true,
          type: '胜',
          peilv: null
        }],
        openResults: [
          '主胜'
        ]
      }, {
        isDan: false,
        teamId: '304',
        week: '周四',
        day: '20171207',
        letpoint: null,
        host: '巴斯克',
        guest: '尤尼卡加',
        result: '82:88',
        league: '',
        enddate: '12-31 00:55',
        peilvs: [{
          isHit: true,
          type: '胜',
          peilv: null
        }],
        openResults: [
          '主胜'
        ]
      }, {
        isDan: false,
        teamId: '305',
        week: '周四',
        day: '20171207',
        letpoint: null,
        host: '米兰',
        guest: '莫希姆基',
        result: '77:71',
        league: '',
        enddate: '12-31 00:55',
        peilvs: [{
          isHit: true,
          type: '负',
          peilv: null
        }],
        openResults: [
          '主负'
        ]
      }
    ]
}

世界杯 冠亚军

//返回格式说明
{
    playType: [],
    matches: [{
        teamId: '01',   //编号
        host: '巴西',   
        guest: null,   //竞彩冠军只有一个队
        result: null,  //赛果
        league: "世界杯",     //世界杯
        peilvs: [{
                isHit: false,   //result === team
                peilv: '3.00'   //赔率
            }]
    }, {
        teamId: '03',   //编号
        host: '西班牙',   
        guest: null,   //竞猜冠军只有一个队
        result: null,
        league: "世界杯",     //世界杯
        peilvs: [{
                isHit: false,
                peilv: '4.25'
            }]
    }]
}

维护

git仓库(码云)

对原有代码进行修改后, 需要运行

npm test

通过所有的测试用例才可以发布新的版本

如果之前的测试用例有未覆盖的情况, 需要补充新的测试用例

发布新的版本, 需要有npm账号并在开发者名单中

发布命令

npm publish