瀏覽代碼

first publish

stanley-king 7 年之前
父節點
當前提交
29d846c8df
共有 100 個文件被更改,包括 22186 次插入16 次删除
  1. 2 0
      .gitignore
  2. 1 0
      README 2.md
  3. 1 1
      dist/index.html
  4. 1 0
      dist/mshop/css/app.637936a4c164df068787cdc4429d497c.css
  5. 1 0
      dist/mshop/css/app.637936a4c164df068787cdc4429d497c.css.map
  6. 0 1
      dist/mshop/css/app.8a84848035c03f09a9d124f5b5e8c23b.css
  7. 0 1
      dist/mshop/css/app.8a84848035c03f09a9d124f5b5e8c23b.css.map
  8. 0 2
      dist/mshop/js/app.6b34fb270051884ec40d.js
  9. 0 1
      dist/mshop/js/app.6b34fb270051884ec40d.js.map
  10. 2 0
      dist/mshop/js/app.c4402e524dfd102740de.js
  11. 1 0
      dist/mshop/js/app.c4402e524dfd102740de.js.map
  12. 2 2
      dist/mshop/js/manifest.1600886244496052f0f6.js
  13. 1 1
      dist/mshop/js/manifest.1600886244496052f0f6.js.map
  14. 0 1
      dist/mshop/js/vendor.022e8951eec4b466de97.js.map
  15. 6 6
      dist/mshop/js/vendor.022e8951eec4b466de97.js
  16. 1 0
      dist/mshop/js/vendor.da44554b3f4609174498.js.map
  17. 17 0
      node_modules/.1.0.1-beta3@mockjs/.editorconfig
  18. 1 0
      node_modules/.1.0.1-beta3@mockjs/.gitattributes
  19. 9 0
      node_modules/.1.0.1-beta3@mockjs/.jshintrc
  20. 9 0
      node_modules/.1.0.1-beta3@mockjs/.npmignore
  21. 1 0
      node_modules/.1.0.1-beta3@mockjs/.npminstall.done
  22. 6 0
      node_modules/.1.0.1-beta3@mockjs/.spmignore
  23. 13 0
      node_modules/.1.0.1-beta3@mockjs/.travis.yml
  24. 137 0
      node_modules/.1.0.1-beta3@mockjs/CHANGELOG.md
  25. 21 0
      node_modules/.1.0.1-beta3@mockjs/LICENSE
  26. 31 0
      node_modules/.1.0.1-beta3@mockjs/README.md
  27. 81 0
      node_modules/.1.0.1-beta3@mockjs/bin/random
  28. 24 0
      node_modules/.1.0.1-beta3@mockjs/bower.json
  29. 10 0
      node_modules/.1.0.1-beta3@mockjs/dist/mock-min.js
  30. 1 0
      node_modules/.1.0.1-beta3@mockjs/dist/mock-min.js.map
  31. 8539 0
      node_modules/.1.0.1-beta3@mockjs/dist/mock.js
  32. 164 0
      node_modules/.1.0.1-beta3@mockjs/gulpfile.js
  33. 1 0
      node_modules/.1.0.1-beta3@mockjs/node_modules/commander
  34. 51 0
      node_modules/.1.0.1-beta3@mockjs/package.json
  35. 二進制
      node_modules/.1.0.1-beta3@mockjs/src/dependencies.png
  36. 67 0
      node_modules/.1.0.1-beta3@mockjs/src/mock.js
  37. 83 0
      node_modules/.1.0.1-beta3@mockjs/src/mock/RE_KEY.svg
  38. 33 0
      node_modules/.1.0.1-beta3@mockjs/src/mock/constant.js
  39. 540 0
      node_modules/.1.0.1-beta3@mockjs/src/mock/handler.js
  40. 71 0
      node_modules/.1.0.1-beta3@mockjs/src/mock/parser.js
  41. 47 0
      node_modules/.1.0.1-beta3@mockjs/src/mock/random/address.js
  42. 4068 0
      node_modules/.1.0.1-beta3@mockjs/src/mock/random/address_dict.js
  43. 126 0
      node_modules/.1.0.1-beta3@mockjs/src/mock/random/basic.js
  44. 137 0
      node_modules/.1.0.1-beta3@mockjs/src/mock/random/color.js
  45. 177 0
      node_modules/.1.0.1-beta3@mockjs/src/mock/random/color_convert.js
  46. 76 0
      node_modules/.1.0.1-beta3@mockjs/src/mock/random/color_dict.js
  47. 141 0
      node_modules/.1.0.1-beta3@mockjs/src/mock/random/date.js
  48. 116 0
      node_modules/.1.0.1-beta3@mockjs/src/mock/random/helper.js
  49. 282 0
      node_modules/.1.0.1-beta3@mockjs/src/mock/random/image.js
  50. 24 0
      node_modules/.1.0.1-beta3@mockjs/src/mock/random/index.js
  51. 105 0
      node_modules/.1.0.1-beta3@mockjs/src/mock/random/misc.js
  52. 87 0
      node_modules/.1.0.1-beta3@mockjs/src/mock/random/name.js
  53. 121 0
      node_modules/.1.0.1-beta3@mockjs/src/mock/random/text.js
  54. 76 0
      node_modules/.1.0.1-beta3@mockjs/src/mock/random/web.js
  55. 392 0
      node_modules/.1.0.1-beta3@mockjs/src/mock/regexp/handler.js
  56. 6 0
      node_modules/.1.0.1-beta3@mockjs/src/mock/regexp/index.js
  57. 570 0
      node_modules/.1.0.1-beta3@mockjs/src/mock/regexp/parser.js
  58. 1 0
      node_modules/.1.0.1-beta3@mockjs/src/mock/schema/index.js
  59. 47 0
      node_modules/.1.0.1-beta3@mockjs/src/mock/schema/schema.js
  60. 126 0
      node_modules/.1.0.1-beta3@mockjs/src/mock/util.js
  61. 1 0
      node_modules/.1.0.1-beta3@mockjs/src/mock/valid/index.js
  62. 445 0
      node_modules/.1.0.1-beta3@mockjs/src/mock/valid/valid.js
  63. 1 0
      node_modules/.1.0.1-beta3@mockjs/src/mock/xhr/index.js
  64. 442 0
      node_modules/.1.0.1-beta3@mockjs/src/mock/xhr/xhr.js
  65. 11 0
      node_modules/.1.0.1-beta3@mockjs/test/bower.json
  66. 2 0
      node_modules/.1.0.1-beta3@mockjs/test/materiels/noop.html
  67. 1 0
      node_modules/.1.0.1-beta3@mockjs/test/materiels/noop.js
  68. 6 0
      node_modules/.1.0.1-beta3@mockjs/test/package.json
  69. 35 0
      node_modules/.1.0.1-beta3@mockjs/test/test.coveralls.js
  70. 57 0
      node_modules/.1.0.1-beta3@mockjs/test/test.mock.html
  71. 62 0
      node_modules/.1.0.1-beta3@mockjs/test/test.mock.mock.js
  72. 464 0
      node_modules/.1.0.1-beta3@mockjs/test/test.mock.random.js
  73. 445 0
      node_modules/.1.0.1-beta3@mockjs/test/test.mock.request.js
  74. 205 0
      node_modules/.1.0.1-beta3@mockjs/test/test.mock.schema.js
  75. 238 0
      node_modules/.1.0.1-beta3@mockjs/test/test.mock.spec.dpd.js
  76. 677 0
      node_modules/.1.0.1-beta3@mockjs/test/test.mock.spec.dtd.js
  77. 308 0
      node_modules/.1.0.1-beta3@mockjs/test/test.mock.valid.js
  78. 264 0
      node_modules/.1.0.1-beta3@mockjs/test/valid.js
  79. 3 0
      node_modules/.1.0.1@graceful-readlink/.npmignore
  80. 1 0
      node_modules/.1.0.1@graceful-readlink/.npminstall.done
  81. 5 0
      node_modules/.1.0.1@graceful-readlink/.travis.yml
  82. 22 0
      node_modules/.1.0.1@graceful-readlink/LICENSE
  83. 17 0
      node_modules/.1.0.1@graceful-readlink/README.md
  84. 12 0
      node_modules/.1.0.1@graceful-readlink/index.js
  85. 20 0
      node_modules/.1.0.1@graceful-readlink/package.json
  86. 1 0
      node_modules/.2.9.0@commander/.npminstall.done
  87. 261 0
      node_modules/.2.9.0@commander/History.md
  88. 22 0
      node_modules/.2.9.0@commander/LICENSE
  89. 351 0
      node_modules/.2.9.0@commander/Readme.md
  90. 1110 0
      node_modules/.2.9.0@commander/index.js
  91. 1 0
      node_modules/.2.9.0@commander/node_modules/graceful-readlink
  92. 35 0
      node_modules/.2.9.0@commander/package.json
  93. 1 0
      node_modules/.bin/_mocha
  94. 1 0
      node_modules/.bin/_mocha-nightwatch
  95. 1 0
      node_modules/.bin/acorn
  96. 1 0
      node_modules/.bin/ansi-html
  97. 1 0
      node_modules/.bin/babylon
  98. 1 0
      node_modules/.bin/browserslist
  99. 1 0
      node_modules/.bin/chromedriver
  100. 0 0
      node_modules/.bin/commonize

+ 2 - 0
.gitignore

@@ -0,0 +1,2 @@
+node_modules/
+.idea/

+ 1 - 0
README 2.md

@@ -0,0 +1 @@
+#panda_h5

文件差異過大導致無法顯示
+ 1 - 1
dist/index.html


文件差異過大導致無法顯示
+ 1 - 0
dist/mshop/css/app.637936a4c164df068787cdc4429d497c.css


文件差異過大導致無法顯示
+ 1 - 0
dist/mshop/css/app.637936a4c164df068787cdc4429d497c.css.map


文件差異過大導致無法顯示
+ 0 - 1
dist/mshop/css/app.8a84848035c03f09a9d124f5b5e8c23b.css


文件差異過大導致無法顯示
+ 0 - 1
dist/mshop/css/app.8a84848035c03f09a9d124f5b5e8c23b.css.map


文件差異過大導致無法顯示
+ 0 - 2
dist/mshop/js/app.6b34fb270051884ec40d.js


文件差異過大導致無法顯示
+ 0 - 1
dist/mshop/js/app.6b34fb270051884ec40d.js.map


文件差異過大導致無法顯示
+ 2 - 0
dist/mshop/js/app.c4402e524dfd102740de.js


文件差異過大導致無法顯示
+ 1 - 0
dist/mshop/js/app.c4402e524dfd102740de.js.map


文件差異過大導致無法顯示
+ 2 - 2
dist/mshop/js/manifest.1600886244496052f0f6.js


文件差異過大導致無法顯示
+ 1 - 1
dist/mshop/js/manifest.1600886244496052f0f6.js.map


文件差異過大導致無法顯示
+ 0 - 1
dist/mshop/js/vendor.022e8951eec4b466de97.js.map


文件差異過大導致無法顯示
+ 6 - 6
dist/mshop/js/vendor.022e8951eec4b466de97.js


文件差異過大導致無法顯示
+ 1 - 0
dist/mshop/js/vendor.da44554b3f4609174498.js.map


+ 17 - 0
node_modules/.1.0.1-beta3@mockjs/.editorconfig

@@ -0,0 +1,17 @@
+# editorconfig.org
+root = true
+
+[*]
+indent_style = space
+indent_size = 4
+end_of_line = lf
+charset = utf-8
+trim_trailing_whitespace = true
+insert_final_newline = true
+
+[package.json]
+indent_style = space
+indent_size = 2
+
+[*.md]
+trim_trailing_whitespace = false

+ 1 - 0
node_modules/.1.0.1-beta3@mockjs/.gitattributes

@@ -0,0 +1 @@
+* text=auto

+ 9 - 0
node_modules/.1.0.1-beta3@mockjs/.jshintrc

@@ -0,0 +1,9 @@
+{
+	"expr": true,
+    "asi": true,
+    "strict": false,
+    "undef": true,
+    "unused": "strict",
+    "multistr": true,
+    "node": true
+}

+ 9 - 0
node_modules/.1.0.1-beta3@mockjs/.npmignore

@@ -0,0 +1,9 @@
+bak
+.DS_Store
+.*.swp
+.idea
+node_modules
+bower_components
+coverage
+PLAN.md
+npm-debug.log

+ 1 - 0
node_modules/.1.0.1-beta3@mockjs/.npminstall.done

@@ -0,0 +1 @@
+Mon Apr 17 2017 19:29:27 GMT+0800 (CST)

+ 6 - 0
node_modules/.1.0.1-beta3@mockjs/.spmignore

@@ -0,0 +1,6 @@
+bin
+demo
+doc
+editor
+src
+test

+ 13 - 0
node_modules/.1.0.1-beta3@mockjs/.travis.yml

@@ -0,0 +1,13 @@
+language: node_js
+node_js:
+  - '0.10'
+before_install:
+  - npm install -g gulp
+  - npm install -g bower
+before_script:
+  - bower install
+  - cd test
+  - bower install
+  - cd ..
+after_script:
+  - npm run coveralls

+ 137 - 0
node_modules/.1.0.1-beta3@mockjs/CHANGELOG.md

@@ -0,0 +1,137 @@
+# Changelog
+
+## 2015.12.03 V0.2.0-alpha2
+
+1. 改用 webpack 打包
+
+### 2014.3.20 V0.2.0-alpha1
+
+1. 增加网站
+
+### 2014.12.23 V0.2.0 重构代码
+
+1. 改用 gulp 打包
+2. 改用 mocha 重写测试用例
+3. 改用 requirejs 重构代码
+
+### 2014.6.24 V0.2.0 重构代码
+
+1. 支持 UMD,包括:
+    * 未打包前的代码
+    * 打包后的代码
+2. random CLI
+    * --help 增加方法和参数说明
+3. 重构文档站 @萝素
+    * 增加《入门》
+    * 单列《文档》
+4. 测试用例
+    * 重写测试用例
+    * 同时支持 nodeunit 和 qunit
+    * 同时支持 jQuery、KISSY、Zepto
+    * 同时支持 KMD、AMD、CMD
+5. 复写 XHR @行列 @霍庸
+6. 废弃的功能
+    * Mock.mockjax()
+    * Mock.tpl()
+    * Mock.xtpl()
+7. Random.dateImage() 支持 node-canvas
+8. Mock.valid(tpl, data)
+9. Mock.toJOSNSchema()
+10. Mock.mock(regexp) 
+11. 完善地支持 node,代码中的:
+    * window
+    * document
+    * XHRHttpRequest
+12. 支持相对路径
+
+### 2014.6.23 V0.1.5
+
+1. [!] 修复 #28 #29,因为 jQuery 每个版本在 Ajax 实现上有些差异,导致在拦截 Ajax 请求时出现了兼容性问题(例如,方法 `xhr.onload()` 访问不到)。本次[测试](http://jsfiddle.net/8y8Fz/)并通过的 jQuery 版本有:
+
+    * jQuery 2.1.0
+    * jQuery 2.0.2
+    * jQuery 1.11.0
+    * jQuery 1.10.1
+    * jQuery 1.9.1
+    * jQuery 1.8.3
+    * jQuery 1.7.2
+    * jQuery 1.6.4
+
+非常抱歉,这个问题一直困扰着 Mock.js 用户,在后面的版本中,会通过拦截 XMLHttpRequest 的方法“一劳永逸”地解决拦截 Ajax 的兼容和适配问题。
+
+### 2014.6.18 V0.1.4
+
+1. [!] 修复 #14 0.1.1版本试了好像jq1.10可以,1.11下$.ajax拦截没反应
+2. [!] 修复 #22 异步加载js文件的时候发现问题
+3. [!] 修复 #23 Mock.mockjax 导致 $.getScript 不执行回调
+4. [!] 修复 #24 Window Firefox 30.0 引用 占位符 抛错
+5. [!] 修复 #25 改变了非函数属性的顺序,查找起来不方便
+6. [!] 修复 #26 生成规则 支持 负数 number|-100-+100
+7. [!] 修复 #27 数据模板编辑器 格式化(Tidy) 时会丢掉 函数属性
+8. [+] 数据模板编辑器 增加了 编辑区 和 生成结果区 的同步滚动
+9. [!] test/nodeuinit > test/nodeunit
+
+### 2014.5.26 V0.1.3
+
+1. [!] 修复 #21
+
+### 2014.5.26 V0.1.2
+
+1. [!] 重构 Mock.mockjax()
+2. [!] 更新 package.json/devDependencies
+3. [+] 增加 懒懒交流会 PPT
+
+### 2014.5.9 V0.1.2
+1. [+] 支持 [`Mock.mock(rurl, rtype, template)`](http://mockjs.com/#mock)
+2. [+] 支持 [`'name|min-max': {}`、`'name|count': {}`](http://mockjs.com/#语法规范)
+3. [+] 支持 [`'name': function(){}`](http://mockjs.com/#语法规范)
+4. [+] 新增占位符 [@NOW](http://mockjs.com/#now)
+5. [+] 更新了 [语法规范](http://mockjs.com/#语法规范)
+
+### 2013.9.6
+1. 增加占位符 @DATAIMAGE
+2. 解析占位符时**完全**忽略大小写
+
+### 2013.9.3
+1. 文档增加用法示例:Sea.js (CMD)、RequireJS (AMD)
+2. 增加对 CMD 规范的支持
+3. 生成 SourceMap 文件 `dist/mock-min.map`
+
+### 2013.8.21
+1. 100% 基于客户端模板生成模拟数据,支持 KISSY XTemplate。
+1. 调整文件结构。
+
+### 2013.8.11
+1. 80% 基于客户端模板生成模拟数据。
+1. 完善针对 KISSY XTemplate 的测试用例 [test/mock4tpl-xtpl-node.js](test/mock4tpl-xtpl-node.js)。
+1. [Mock4Tpl](src/tpl/mock4tpl.js) 支持 Partials。
+1. Mock 支持转义 @。
+1. 更新 README.md,增加对 Mock4Tpl 的说明。
+1. 完善 [demo](demo/)。
+1. 减少 Mock、Mock4Tpl 暴漏的 API。
+
+### 2013.8.7
+1. 75% 基于客户端模板生成模拟数据。
+1. 完善测试用例 [test/mock4tpl-node.js](test/mock4tpl-node.js)。
+1. 重构文件和目录结构,把代码模块化。
+1. 参考 Handlebars.js,引入 Jison 生成模板解析器。
+
+#### 2013.8.2
+1. 60% 基于客户端模板生成模拟数据。
+1. 增加测试用例 [test/mock4tpl-node.js](test/mock4tpl-node.js),参考自 <http://handlebarsjs.com/>。
+
+#### 2013.7.31
+1. 50% 基于客户端模板生成模拟数据。
+
+#### 2013.7.18
+1. 增加占位符 @COLOR。
+1. 完善对占位符的解析,过滤掉 `#%&()?/.`。
+1. 对“支持的占位符”分组。
+
+#### 2013.7.12
+1. Mock.mock(rurl, template) 的参数 rurl 可以是字符串或正则。
+1. 把产生随机元数据的接口封装到 Mock.Random 中。
+1. 增加对日期的格式化。
+1. 增加占位符 @IMG、@PARAGRAPH、@SENTENCE、@WORD、@FIRST、@LAST、@NAME、@DOMAIN、@EMAIL、@IP、@ID。
+1. 支持嵌套的占位符,例如 `@IMG(@AD_SIZE)`。
+1. 支持把普通属性当作占位符使用,例如 `@IMG(@size)`。

+ 21 - 0
node_modules/.1.0.1-beta3@mockjs/LICENSE

@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2015 nuysoft
+http://mockjs.com/
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+ 31 - 0
node_modules/.1.0.1-beta3@mockjs/README.md

@@ -0,0 +1,31 @@
+# Mock.js
+<!-- 模拟请求 & 模拟数据 -->
+[![Build Status](https://travis-ci.org/nuysoft/Mock.svg?branch=refactoring)](https://travis-ci.org/nuysoft/Mock)
+
+<!-- [![Coverage Status](https://coveralls.io/repos/nuysoft/Mock/badge.png?branch=refactoring)](https://coveralls.io/r/nuysoft/Mock?branch=refactoring)
+[![NPM version](https://badge.fury.io/js/mockjs.svg)](http://badge.fury.io/js/mockjs)
+[![Bower version](https://badge.fury.io/bo/mockjs.svg)](http://badge.fury.io/bo/mockjs)
+[![Dependency Status](https://gemnasium.com/nuysoft/Mock.svg)](https://gemnasium.com/nuysoft/Mock)
+[![spm package](http://spmjs.io/badge/mockjs)](http://spmjs.io/package/mockjs) -->
+
+Mock.js is a simulation data generator to help the front-end to develop and prototype separate from the back-end progress and reduce some monotony particularly while writing automated tests.
+
+The official site: <http://mockjs.com>
+
+## Features
+
+* Generate simulated data according to the data template
+* Provide request/response mocking for ajax requests
+* ~~Generate simulated data according to HTML-based templates~~
+
+This library is loosely inspired by Elijah Manor's post [Mocking
+Introduction](http://www.elijahmanor.com/2013/04/angry-birds-of-javascript-green-bird.html), [mennovanslooten/mockJSON](https://github.com/mennovanslooten/mockJSON), [appendto/jquery-mockjax](https://github.com/appendto/jquery-mockjax) and [victorquinn/chancejs](https://github.com/victorquinn/chancejs/).
+
+## Questions?
+If you have any questions, please feel free to ask through [New Issue](https://github.com/nuysoft/Mock/issues/new).
+
+## Reporting an Issue
+Make sure the problem you're addressing is reproducible. Use <http://jsbin.com/> or <http://jsfiddle.net/> to provide a test page. Indicate what browsers the issue can be reproduced in. What version of Mock.js is the issue reproducible in. Is it reproducible after updating to the latest version?
+
+## License
+Mock.js is available under the terms of the [MIT License](./LICENSE).

+ 81 - 0
node_modules/.1.0.1-beta3@mockjs/bin/random

@@ -0,0 +1,81 @@
+#!/usr/bin/env node
+
+"use strict";
+
+/*
+    https://github.com/visionmedia/commander.js
+    http://visionmedia.github.io/commander.js/
+    https://github.com/visionmedia/commander.js/tree/master/examples
+
+    sudo npm install ./ -g
+*/
+
+var path = require('path')
+var program = require('commander')
+var pkg = require(path.resolve(__dirname, '../package.json'))
+var Random = require('../dist/mock.js').Random
+
+program
+    .version(pkg.version)
+    .on('--help', function() {
+        console.log('  Examples:')
+        console.log('')
+        console.log('    $ random date yyyy-MM-dd')
+        console.log('    $ random time HH:mm:ss')
+        console.log('')
+    })
+
+;
+(function() {
+
+    var FN_ARGS = /^function\s*[^\(]*\(\s*([^\)]*)\)/m
+    var FN_ARG_SPLIT = /,/
+    var FN_ARG = /^\s*(_?)(\S+?)\1\s*$/
+    var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg
+    var EXCLUDE = [
+        'extend',
+        'dataImage', // mock/random/image
+        'capitalize', 'upper', 'lower', 'pick', 'shuffle', 'order', // mock/random/helper.js
+        'increment', 'inc' // mock/random/misc.js
+    ]
+
+    function parseArgs(fn) {
+        var fnText = fn.toString().replace(STRIP_COMMENTS, '')
+        var argDecl = fnText.match(FN_ARGS)
+        return argDecl[1].split(FN_ARG_SPLIT).join(', ')
+    }
+
+    Object.keys(Random).forEach(function(key) {
+        if (key[0] === '_') return
+        if (EXCLUDE.indexOf(key) !== -1) return
+
+        var fn = Random[key]
+        if (typeof fn === 'function') {
+            var argDecl = parseArgs(fn)
+            if (argDecl) argDecl = '( ' + argDecl + ' )'
+            else argDecl = '()';
+
+            program
+                .command(key)
+                .description('Random.' + key + argDecl)
+                .action(function() {
+                    var args = [].slice.call(arguments, 0, -1)
+                    var result = fn.apply(Random, args)
+                    console.log(result)
+                })
+        }
+    })
+
+})()
+
+program.parse(process.argv)
+
+;
+(function() {
+    var cmd = program.args[0]
+    if (!cmd) {
+        process.stdout.write(program.helpInformation())
+        program.emit('--help')
+        process.exit()
+    }
+})()

+ 24 - 0
node_modules/.1.0.1-beta3@mockjs/bower.json

@@ -0,0 +1,24 @@
+{
+  "name": "mockjs",
+  "title": "Mock.js",
+  "main": "dist/mock.js",
+  "license": "MIT",
+  "ignore": [
+    "**/.*",
+    "node_modules",
+    "bower_components",
+    "src",
+    "test",
+    "site",
+    "plugins",
+    "package.json",
+    "gulpfile.js",
+    "AUTHORS.txt",
+    "CONTRIBUTING.md",
+    "HISTORY.md",
+    "CHANGELOG.md",
+    "README.md",
+    "LICENSE"
+  ],
+  "devDependencies": {}
+}

文件差異過大導致無法顯示
+ 10 - 0
node_modules/.1.0.1-beta3@mockjs/dist/mock-min.js


文件差異過大導致無法顯示
+ 1 - 0
node_modules/.1.0.1-beta3@mockjs/dist/mock-min.js.map


文件差異過大導致無法顯示
+ 8539 - 0
node_modules/.1.0.1-beta3@mockjs/dist/mock.js


+ 164 - 0
node_modules/.1.0.1-beta3@mockjs/gulpfile.js

@@ -0,0 +1,164 @@
+var gulp = require('gulp')
+var jshint = require('gulp-jshint')
+var webpack = require("webpack")
+var connect = require('gulp-connect')
+var mochaPhantomJS = require('gulp-mocha-phantomjs')
+var exec = require('child_process').exec
+
+var istanbul = require('gulp-istanbul')
+var mocha = require('gulp-mocha')
+var coveralls = require('gulp-coveralls')
+
+// 
+gulp.task('hello', function() {
+    console.log((function() {
+        /*
+___  ___              _        _      
+|  \/  |             | |      (_)     
+| .  . |  ___    ___ | | __    _  ___ 
+| |\/| | / _ \  / __|| |/ /   | |/ __|
+| |  | || (_) || (__ |   <  _ | |\__ \
+\_|  |_/ \___/  \___||_|\_\(_)| ||___/
+                             _/ |     
+                            |__/    
+        */
+    }).toString().split('\n').slice(2, -2).join('\n') + '\n')
+})
+
+// https://github.com/AveVlad/gulp-connect
+gulp.task('connect', function() {
+    /* jshint unused:false */
+    connect.server({
+        port: 5050,
+        middleware: function(connect, opt) {
+            return [
+                // https://github.com/senchalabs/connect/#use-middleware
+                function cors(req, res, next) {
+                    res.setHeader('Access-Control-Allow-Origin', '*')
+                    res.setHeader('Access-Control-Allow-Methods', '*')
+                    next()
+                }
+            ]
+        }
+    })
+})
+
+// https://github.com/spenceralger/gulp-jshint
+gulp.task('jshint', function() {
+    var globs = [
+        'src/**/*.js', 'test/test.*.js', 'gulpfile.js', '!**/regexp/parser.js'
+    ]
+    return gulp.src(globs)
+        .pipe(jshint('.jshintrc'))
+        .pipe(jshint.reporter('jshint-stylish'))
+})
+
+// https://webpack.github.io/docs/usage-with-gulp.html
+gulp.task("webpack", function( /*callback*/ ) {
+    webpack({
+        entry: './src/mock.js',
+        output: {
+            path: './dist',
+            filename: 'mock.js',
+            library: 'Mock',
+            libraryTarget: 'umd'
+        }
+    }, function(err /*, stats*/ ) {
+        // console.log(err, stats)
+        if (err) throw err
+    })
+    webpack({
+        entry: './src/mock.js',
+        devtool: 'source-map',
+        output: {
+            path: './dist',
+            filename: 'mock-min.js',
+            library: 'Mock',
+            libraryTarget: 'umd'
+        },
+        plugins: [
+            new webpack.optimize.UglifyJsPlugin({
+                minimize: true
+            })
+        ]
+    }, function(err /*, stats*/ ) {
+        // console.log(err, stats)
+        if (err) throw err
+    })
+})
+
+// https://github.com/mrhooray/gulp-mocha-phantomjs
+gulp.task('mocha', function() {
+    return gulp.src('test/test.mock.html')
+        .pipe(mochaPhantomJS({
+            reporter: 'spec'
+        }))
+})
+
+
+// https://github.com/floatdrop/gulp-watch
+var watchTasks = ['hello', 'madge', 'jshint', 'webpack', 'mocha']
+gulp.task('watch', function( /*callback*/ ) {
+    gulp.watch(['src/**/*.js', 'gulpfile.js', 'test/*'], watchTasks)
+})
+
+// https://github.com/pahen/madge
+gulp.task('madge', function( /*callback*/ ) {
+    exec('madge ./src/',
+        function(error, stdout /*, stderr*/ ) {
+            if (error) console.log('exec error: ' + error)
+            console.log('module dependencies:')
+            console.log(stdout)
+        }
+    )
+    exec('madge --image ./src/dependencies.png ./src/',
+        function(error /*, stdout, stderr*/ ) {
+            if (error) console.log('exec error: ' + error)
+        }
+    )
+})
+
+// TODO
+
+// https://github.com/SBoudrias/gulp-istanbul
+gulp.task('istanbul', function(cb) {
+    gulp.src(['test/test.coveralls.js'])
+        .pipe(istanbul()) // Covering files
+        .pipe(istanbul.hookRequire()) // Force `require` to return covered files
+        .on('finish', function() {
+            gulp.src(['test/test.coveralls.js'])
+                .pipe(mocha({}))
+                .pipe(istanbul.writeReports()) // Creating the reports after tests runned
+                .on('end', cb)
+        })
+})
+gulp.task('istanbulForMochaPhantomJS', function(cb) {
+    gulp.src(['dist/mock.js'])
+        .pipe(istanbul()) // Covering files
+        .pipe(istanbul.hookRequire()) // Force `require` to return covered files
+        .on('finish', function() {
+            gulp.src(['test/test.mock.html'])
+                .pipe(mochaPhantomJS({
+                    reporter: 'spec'
+                }))
+                .pipe(istanbul.writeReports()) // Creating the reports after tests runned
+                .on('end', cb)
+        })
+})
+
+// https://github.com/markdalgleish/gulp-coveralls
+gulp.task('coveralls', ['istanbul'], function() {
+    return gulp.src('coverage/**/lcov.info')
+        .pipe(coveralls())
+})
+
+// 
+gulp.task('publish', function() {
+    var child_process = require('child_process')
+    child_process.exec('ls', function(error, stdout, stderr) {
+        console.log(error, stdout, stderr)
+    })
+})
+
+gulp.task('default', watchTasks.concat(['watch', 'connect']))
+gulp.task('build', ['jshint', 'webpack', 'mocha'])

+ 1 - 0
node_modules/.1.0.1-beta3@mockjs/node_modules/commander

@@ -0,0 +1 @@
+../../.2.9.0@commander

+ 51 - 0
node_modules/.1.0.1-beta3@mockjs/package.json

@@ -0,0 +1,51 @@
+{
+  "name": "mockjs",
+  "title": "Mock.js",
+  "description": "生成随机数据 & 拦截 Ajax 请求",
+  "version": "1.0.1-beta3",
+  "homepage": "http://mockjs.com/",
+  "keywords": [
+    "mock",
+    "mockJSON",
+    "mockAjax"
+  ],
+  "author": "nuysoft@gmail.com",
+  "dependencies": {
+    "commander": "*"
+  },
+  "devDependencies": {
+    "gulp": "^3.9.0",
+    "gulp-connect": "*",
+    "gulp-coveralls": "^0.1.4",
+    "gulp-istanbul": "^0.10.3",
+    "gulp-jshint": "^2.0.0",
+    "gulp-mocha": "^2.2.0",
+    "gulp-mocha-phantomjs": "^0.10.1",
+    "jshint": "^2.8.0",
+    "jshint-stylish": "^2.1.0",
+    "webpack": "^1.12.9"
+  },
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/nuysoft/Mock.git"
+  },
+  "main": "./dist/mock.js",
+  "scripts": {
+    "test": "gulp mocha",
+    "coveralls": "gulp coveralls"
+  },
+  "bin": {
+    "random": "bin/random"
+  },
+  "licenses": [
+    {
+      "type": "MIT",
+      "url": "https://github.com/nuysoft/Mock/blob/master/LICENSE"
+    }
+  ],
+  "spm": {
+    "main": "dist/mock.js"
+  },
+  "_from": "mockjs@1.0.1-beta3",
+  "_resolved": "http://registry.npm.taobao.org/mockjs/download/mockjs-1.0.1-beta3.tgz"
+}

二進制
node_modules/.1.0.1-beta3@mockjs/src/dependencies.png


+ 67 - 0
node_modules/.1.0.1-beta3@mockjs/src/mock.js

@@ -0,0 +1,67 @@
+/* global require, module, window */
+var Handler = require('./mock/handler')
+var Util = require('./mock/util')
+var Random = require('./mock/random')
+var RE = require('./mock/regexp')
+var toJSONSchema = require('./mock/schema')
+var valid = require('./mock/valid')
+
+var XHR
+if (typeof window !== 'undefined') XHR = require('./mock/xhr')
+
+/*!
+    Mock - 模拟请求 & 模拟数据
+    https://github.com/nuysoft/Mock
+    墨智 mozhi.gyy@taobao.com nuysoft@gmail.com
+*/
+var Mock = {
+    Handler: Handler,
+    Random: Random,
+    Util: Util,
+    XHR: XHR,
+    RE: RE,
+    toJSONSchema: toJSONSchema,
+    valid: valid,
+    heredoc: Util.heredoc,
+    setup: function(settings) {
+        return XHR.setup(settings)
+    },
+    _mocked: {}
+}
+
+Mock.version = '1.0.1-beta3'
+
+// 避免循环依赖
+if (XHR) XHR.Mock = Mock
+
+/*
+    * Mock.mock( template )
+    * Mock.mock( function() )
+    * Mock.mock( rurl, template )
+    * Mock.mock( rurl, function(options) )
+    * Mock.mock( rurl, rtype, template )
+    * Mock.mock( rurl, rtype, function(options) )
+
+    根据数据模板生成模拟数据。
+*/
+Mock.mock = function(rurl, rtype, template) {
+    // Mock.mock(template)
+    if (arguments.length === 1) {
+        return Handler.gen(rurl)
+    }
+    // Mock.mock(rurl, template)
+    if (arguments.length === 2) {
+        template = rtype
+        rtype = undefined
+    }
+    // 拦截 XHR
+    if (XHR) window.XMLHttpRequest = XHR
+    Mock._mocked[rurl + (rtype || '')] = {
+        rurl: rurl,
+        rtype: rtype,
+        template: template
+    }
+    return Mock
+}
+
+module.exports = Mock

文件差異過大導致無法顯示
+ 83 - 0
node_modules/.1.0.1-beta3@mockjs/src/mock/RE_KEY.svg


+ 33 - 0
node_modules/.1.0.1-beta3@mockjs/src/mock/constant.js

@@ -0,0 +1,33 @@
+/*
+    ## Constant
+
+    常量集合。
+ */
+/*
+    RE_KEY
+        'name|min-max': value
+        'name|count': value
+        'name|min-max.dmin-dmax': value
+        'name|min-max.dcount': value
+        'name|count.dmin-dmax': value
+        'name|count.dcount': value
+        'name|+step': value
+
+        1 name, 2 step, 3 range [ min, max ], 4 drange [ dmin, dmax ]
+
+    RE_PLACEHOLDER
+        placeholder(*)
+
+    [正则查看工具](http://www.regexper.com/)
+
+    #26 生成规则 支持 负数,例如 number|-100-100
+*/
+module.exports = {
+    GUID: 1,
+    RE_KEY: /(.+)\|(?:\+(\d+)|([\+\-]?\d+-?[\+\-]?\d*)?(?:\.(\d+-?\d*))?)/,
+    RE_RANGE: /([\+\-]?\d+)-?([\+\-]?\d+)?/,
+    RE_PLACEHOLDER: /\\*@([^@#%&()\?\s]+)(?:\((.*?)\))?/g
+    // /\\*@([^@#%&()\?\s\/\.]+)(?:\((.*?)\))?/g
+    // RE_INDEX: /^index$/,
+    // RE_KEY: /^key$/
+}

+ 540 - 0
node_modules/.1.0.1-beta3@mockjs/src/mock/handler.js

@@ -0,0 +1,540 @@
+/* 
+    ## Handler
+
+    处理数据模板。
+    
+    * Handler.gen( template, name?, context? )
+
+        入口方法。
+
+    * Data Template Definition, DTD
+        
+        处理数据模板定义。
+
+        * Handler.array( options )
+        * Handler.object( options )
+        * Handler.number( options )
+        * Handler.boolean( options )
+        * Handler.string( options )
+        * Handler.function( options )
+        * Handler.regexp( options )
+        
+        处理路径(相对和绝对)。
+
+        * Handler.getValueByKeyPath( key, options )
+
+    * Data Placeholder Definition, DPD
+
+        处理数据占位符定义
+
+        * Handler.placeholder( placeholder, context, templateContext, options )
+
+*/
+
+var Constant = require('./constant')
+var Util = require('./util')
+var Parser = require('./parser')
+var Random = require('./random/')
+var RE = require('./regexp')
+
+var Handler = {
+    extend: Util.extend
+}
+
+/*
+    template        属性值(即数据模板)
+    name            属性名
+    context         数据上下文,生成后的数据
+    templateContext 模板上下文,
+
+    Handle.gen(template, name, options)
+    context
+        currentContext, templateCurrentContext, 
+        path, templatePath
+        root, templateRoot
+*/
+Handler.gen = function(template, name, context) {
+    /* jshint -W041 */
+    name = name == undefined ? '' : (name + '')
+
+    context = context || {}
+    context = {
+            // 当前访问路径,只有属性名,不包括生成规则
+            path: context.path || [Constant.GUID],
+            templatePath: context.templatePath || [Constant.GUID++],
+            // 最终属性值的上下文
+            currentContext: context.currentContext,
+            // 属性值模板的上下文
+            templateCurrentContext: context.templateCurrentContext || template,
+            // 最终值的根
+            root: context.root || context.currentContext,
+            // 模板的根
+            templateRoot: context.templateRoot || context.templateCurrentContext || template
+        }
+        // console.log('path:', context.path.join('.'), template)
+
+    var rule = Parser.parse(name)
+    var type = Util.type(template)
+    var data
+
+    if (Handler[type]) {
+        data = Handler[type]({
+            // 属性值类型
+            type: type,
+            // 属性值模板
+            template: template,
+            // 属性名 + 生成规则
+            name: name,
+            // 属性名
+            parsedName: name ? name.replace(Constant.RE_KEY, '$1') : name,
+
+            // 解析后的生成规则
+            rule: rule,
+            // 相关上下文
+            context: context
+        })
+
+        if (!context.root) context.root = data
+        return data
+    }
+
+    return template
+}
+
+Handler.extend({
+    array: function(options) {
+        var result = [],
+            i, ii;
+
+        // 'name|1': []
+        // 'name|count': []
+        // 'name|min-max': []
+        if (options.template.length === 0) return result
+
+        // 'arr': [{ 'email': '@EMAIL' }, { 'email': '@EMAIL' }]
+        if (!options.rule.parameters) {
+            for (i = 0; i < options.template.length; i++) {
+                options.context.path.push(i)
+                options.context.templatePath.push(i)
+                result.push(
+                    Handler.gen(options.template[i], i, {
+                        path: options.context.path,
+                        templatePath: options.context.templatePath,
+                        currentContext: result,
+                        templateCurrentContext: options.template,
+                        root: options.context.root || result,
+                        templateRoot: options.context.templateRoot || options.template
+                    })
+                )
+                options.context.path.pop()
+                options.context.templatePath.pop()
+            }
+        } else {
+            // 'method|1': ['GET', 'POST', 'HEAD', 'DELETE']
+            if (options.rule.min === 1 && options.rule.max === undefined) {
+                // fix #17
+                options.context.path.push(options.name)
+                options.context.templatePath.push(options.name)
+                result = Random.pick(
+                    Handler.gen(options.template, undefined, {
+                        path: options.context.path,
+                        templatePath: options.context.templatePath,
+                        currentContext: result,
+                        templateCurrentContext: options.template,
+                        root: options.context.root || result,
+                        templateRoot: options.context.templateRoot || options.template
+                    })
+                )
+                options.context.path.pop()
+                options.context.templatePath.pop()
+            } else {
+                // 'data|+1': [{}, {}]
+                if (options.rule.parameters[2]) {
+                    options.template.__order_index = options.template.__order_index || 0
+
+                    options.context.path.push(options.name)
+                    options.context.templatePath.push(options.name)
+                    result = Handler.gen(options.template, undefined, {
+                        path: options.context.path,
+                        templatePath: options.context.templatePath,
+                        currentContext: result,
+                        templateCurrentContext: options.template,
+                        root: options.context.root || result,
+                        templateRoot: options.context.templateRoot || options.template
+                    })[
+                        options.template.__order_index % options.template.length
+                    ]
+
+                    options.template.__order_index += +options.rule.parameters[2]
+
+                    options.context.path.pop()
+                    options.context.templatePath.pop()
+
+                } else {
+                    // 'data|1-10': [{}]
+                    for (i = 0; i < options.rule.count; i++) {
+                        // 'data|1-10': [{}, {}]
+                        for (ii = 0; ii < options.template.length; ii++) {
+                            options.context.path.push(result.length)
+                            options.context.templatePath.push(ii)
+                            result.push(
+                                Handler.gen(options.template[ii], result.length, {
+                                    path: options.context.path,
+                                    templatePath: options.context.templatePath,
+                                    currentContext: result,
+                                    templateCurrentContext: options.template,
+                                    root: options.context.root || result,
+                                    templateRoot: options.context.templateRoot || options.template
+                                })
+                            )
+                            options.context.path.pop()
+                            options.context.templatePath.pop()
+                        }
+                    }
+                }
+            }
+        }
+        return result
+    },
+    object: function(options) {
+        var result = {},
+            keys, fnKeys, key, parsedKey, inc, i;
+
+        // 'obj|min-max': {}
+        /* jshint -W041 */
+        if (options.rule.min != undefined) {
+            keys = Util.keys(options.template)
+            keys = Random.shuffle(keys)
+            keys = keys.slice(0, options.rule.count)
+            for (i = 0; i < keys.length; i++) {
+                key = keys[i]
+                parsedKey = key.replace(Constant.RE_KEY, '$1')
+                options.context.path.push(parsedKey)
+                options.context.templatePath.push(key)
+                result[parsedKey] = Handler.gen(options.template[key], key, {
+                    path: options.context.path,
+                    templatePath: options.context.templatePath,
+                    currentContext: result,
+                    templateCurrentContext: options.template,
+                    root: options.context.root || result,
+                    templateRoot: options.context.templateRoot || options.template
+                })
+                options.context.path.pop()
+                options.context.templatePath.pop()
+            }
+
+        } else {
+            // 'obj': {}
+            keys = []
+            fnKeys = [] // #25 改变了非函数属性的顺序,查找起来不方便
+            for (key in options.template) {
+                (typeof options.template[key] === 'function' ? fnKeys : keys).push(key)
+            }
+            keys = keys.concat(fnKeys)
+
+            /*
+                会改变非函数属性的顺序
+                keys = Util.keys(options.template)
+                keys.sort(function(a, b) {
+                    var afn = typeof options.template[a] === 'function'
+                    var bfn = typeof options.template[b] === 'function'
+                    if (afn === bfn) return 0
+                    if (afn && !bfn) return 1
+                    if (!afn && bfn) return -1
+                })
+            */
+
+            for (i = 0; i < keys.length; i++) {
+                key = keys[i]
+                parsedKey = key.replace(Constant.RE_KEY, '$1')
+                options.context.path.push(parsedKey)
+                options.context.templatePath.push(key)
+                result[parsedKey] = Handler.gen(options.template[key], key, {
+                    path: options.context.path,
+                    templatePath: options.context.templatePath,
+                    currentContext: result,
+                    templateCurrentContext: options.template,
+                    root: options.context.root || result,
+                    templateRoot: options.context.templateRoot || options.template
+                })
+                options.context.path.pop()
+                options.context.templatePath.pop()
+                    // 'id|+1': 1
+                inc = key.match(Constant.RE_KEY)
+                if (inc && inc[2] && Util.type(options.template[key]) === 'number') {
+                    options.template[key] += parseInt(inc[2], 10)
+                }
+            }
+        }
+        return result
+    },
+    number: function(options) {
+        var result, parts;
+        if (options.rule.decimal) { // float
+            options.template += ''
+            parts = options.template.split('.')
+                // 'float1|.1-10': 10,
+                // 'float2|1-100.1-10': 1,
+                // 'float3|999.1-10': 1,
+                // 'float4|.3-10': 123.123,
+            parts[0] = options.rule.range ? options.rule.count : parts[0]
+            parts[1] = (parts[1] || '').slice(0, options.rule.dcount)
+            while (parts[1].length < options.rule.dcount) {
+                parts[1] += (
+                    // 最后一位不能为 0:如果最后一位为 0,会被 JS 引擎忽略掉。
+                    (parts[1].length < options.rule.dcount - 1) ? Random.character('number') : Random.character('123456789')
+                )
+            }
+            result = parseFloat(parts.join('.'), 10)
+        } else { // integer
+            // 'grade1|1-100': 1,
+            result = options.rule.range && !options.rule.parameters[2] ? options.rule.count : options.template
+        }
+        return result
+    },
+    boolean: function(options) {
+        var result;
+        // 'prop|multiple': false, 当前值是相反值的概率倍数
+        // 'prop|probability-probability': false, 当前值与相反值的概率
+        result = options.rule.parameters ? Random.bool(options.rule.min, options.rule.max, options.template) : options.template
+        return result
+    },
+    string: function(options) {
+        var result = '',
+            i, placeholders, ph, phed;
+        if (options.template.length) {
+
+            //  'foo': '★',
+            /* jshint -W041 */
+            if (options.rule.count == undefined) {
+                result += options.template
+            }
+
+            // 'star|1-5': '★',
+            for (i = 0; i < options.rule.count; i++) {
+                result += options.template
+            }
+            // 'email|1-10': '@EMAIL, ',
+            placeholders = result.match(Constant.RE_PLACEHOLDER) || [] // A-Z_0-9 > \w_
+            for (i = 0; i < placeholders.length; i++) {
+                ph = placeholders[i]
+
+                // 遇到转义斜杠,不需要解析占位符
+                if (/^\\/.test(ph)) {
+                    placeholders.splice(i--, 1)
+                    continue
+                }
+
+                phed = Handler.placeholder(ph, options.context.currentContext, options.context.templateCurrentContext, options)
+
+                // 只有一个占位符,并且没有其他字符
+                if (placeholders.length === 1 && ph === result && typeof phed !== typeof result) { // 
+                    result = phed
+                    break
+
+                    if (Util.isNumeric(phed)) {
+                        result = parseFloat(phed, 10)
+                        break
+                    }
+                    if (/^(true|false)$/.test(phed)) {
+                        result = phed === 'true' ? true :
+                            phed === 'false' ? false :
+                            phed // 已经是布尔值
+                        break
+                    }
+                }
+                result = result.replace(ph, phed)
+            }
+
+        } else {
+            // 'ASCII|1-10': '',
+            // 'ASCII': '',
+            result = options.rule.range ? Random.string(options.rule.count) : options.template
+        }
+        return result
+    },
+    'function': function(options) {
+        // ( context, options )
+        return options.template.call(options.context.currentContext, options)
+    },
+    'regexp': function(options) {
+        var source = ''
+
+        // 'name': /regexp/,
+        /* jshint -W041 */
+        if (options.rule.count == undefined) {
+            source += options.template.source // regexp.source
+        }
+
+        // 'name|1-5': /regexp/,
+        for (var i = 0; i < options.rule.count; i++) {
+            source += options.template.source
+        }
+
+        return RE.Handler.gen(
+            RE.Parser.parse(
+                source
+            )
+        )
+    }
+})
+
+Handler.extend({
+    _all: function() {
+        var re = {};
+        for (var key in Random) re[key.toLowerCase()] = key
+        return re
+    },
+    // 处理占位符,转换为最终值
+    placeholder: function(placeholder, obj, templateContext, options) {
+        // console.log(options.context.path)
+        // 1 key, 2 params
+        Constant.RE_PLACEHOLDER.exec('')
+        var parts = Constant.RE_PLACEHOLDER.exec(placeholder),
+            key = parts && parts[1],
+            lkey = key && key.toLowerCase(),
+            okey = this._all()[lkey],
+            params = parts && parts[2] || ''
+        var pathParts = this.splitPathToArray(key)
+
+        // 解析占位符的参数
+        try {
+            // 1. 尝试保持参数的类型
+            /*
+                #24 [Window Firefox 30.0 引用 占位符 抛错](https://github.com/nuysoft/Mock/issues/24)
+                [BX9056: 各浏览器下 window.eval 方法的执行上下文存在差异](http://www.w3help.org/zh-cn/causes/BX9056)
+                应该属于 Window Firefox 30.0 的 BUG
+            */
+            /* jshint -W061 */
+            params = eval('(function(){ return [].splice.call(arguments, 0 ) })(' + params + ')')
+        } catch (error) {
+            // 2. 如果失败,只能解析为字符串
+            // console.error(error)
+            // if (error instanceof ReferenceError) params = parts[2].split(/,\s*/);
+            // else throw error
+            params = parts[2].split(/,\s*/)
+        }
+
+        // 占位符优先引用数据模板中的属性
+        if (obj && (key in obj)) return obj[key]
+
+        // @index @key
+        // if (Constant.RE_INDEX.test(key)) return +options.name
+        // if (Constant.RE_KEY.test(key)) return options.name
+
+        // 绝对路径 or 相对路径
+        if (
+            key.charAt(0) === '/' ||
+            pathParts.length > 1
+        ) return this.getValueByKeyPath(key, options)
+
+        // 递归引用数据模板中的属性
+        if (templateContext &&
+            (typeof templateContext === 'object') &&
+            (key in templateContext) &&
+            (placeholder !== templateContext[key]) // fix #15 避免自己依赖自己
+        ) {
+            // 先计算被引用的属性值
+            templateContext[key] = Handler.gen(templateContext[key], key, {
+                currentContext: obj,
+                templateCurrentContext: templateContext
+            })
+            return templateContext[key]
+        }
+
+        // 如果未找到,则原样返回
+        if (!(key in Random) && !(lkey in Random) && !(okey in Random)) return placeholder
+
+        // 递归解析参数中的占位符
+        for (var i = 0; i < params.length; i++) {
+            Constant.RE_PLACEHOLDER.exec('')
+            if (Constant.RE_PLACEHOLDER.test(params[i])) {
+                params[i] = Handler.placeholder(params[i], obj, templateContext, options)
+            }
+        }
+
+        var handle = Random[key] || Random[lkey] || Random[okey]
+        switch (Util.type(handle)) {
+            case 'array':
+                // 自动从数组中取一个,例如 @areas
+                return Random.pick(handle)
+            case 'function':
+                // 执行占位符方法(大多数情况)
+                handle.options = options
+                var re = handle.apply(Random, params)
+                if (re === undefined) re = '' // 因为是在字符串中,所以默认为空字符串。
+                delete handle.options
+                return re
+        }
+    },
+    getValueByKeyPath: function(key, options) {
+        var originalKey = key
+        var keyPathParts = this.splitPathToArray(key)
+        var absolutePathParts = []
+
+        // 绝对路径
+        if (key.charAt(0) === '/') {
+            absolutePathParts = [options.context.path[0]].concat(
+                this.normalizePath(keyPathParts)
+            )
+        } else {
+            // 相对路径
+            if (keyPathParts.length > 1) {
+                absolutePathParts = options.context.path.slice(0)
+                absolutePathParts.pop()
+                absolutePathParts = this.normalizePath(
+                    absolutePathParts.concat(keyPathParts)
+                )
+
+            }
+        }
+
+        key = keyPathParts[keyPathParts.length - 1]
+        var currentContext = options.context.root
+        var templateCurrentContext = options.context.templateRoot
+        for (var i = 1; i < absolutePathParts.length - 1; i++) {
+            currentContext = currentContext[absolutePathParts[i]]
+            templateCurrentContext = templateCurrentContext[absolutePathParts[i]]
+        }
+        // 引用的值已经计算好
+        if (currentContext && (key in currentContext)) return currentContext[key]
+
+        // 尚未计算,递归引用数据模板中的属性
+        if (templateCurrentContext &&
+            (typeof templateCurrentContext === 'object') &&
+            (key in templateCurrentContext) &&
+            (originalKey !== templateCurrentContext[key]) // fix #15 避免自己依赖自己
+        ) {
+            // 先计算被引用的属性值
+            templateCurrentContext[key] = Handler.gen(templateCurrentContext[key], key, {
+                currentContext: currentContext,
+                templateCurrentContext: templateCurrentContext
+            })
+            return templateCurrentContext[key]
+        }
+    },
+    // https://github.com/kissyteam/kissy/blob/master/src/path/src/path.js
+    normalizePath: function(pathParts) {
+        var newPathParts = []
+        for (var i = 0; i < pathParts.length; i++) {
+            switch (pathParts[i]) {
+                case '..':
+                    newPathParts.pop()
+                    break
+                case '.':
+                    break
+                default:
+                    newPathParts.push(pathParts[i])
+            }
+        }
+        return newPathParts
+    },
+    splitPathToArray: function(path) {
+        var parts = path.split(/\/+/);
+        if (!parts[parts.length - 1]) parts = parts.slice(0, -1)
+        if (!parts[0]) parts = parts.slice(1)
+        return parts;
+    }
+})
+
+module.exports = Handler

+ 71 - 0
node_modules/.1.0.1-beta3@mockjs/src/mock/parser.js

@@ -0,0 +1,71 @@
+/*
+	## Parser
+
+	解析数据模板(属性名部分)。
+
+	* Parser.parse( name )
+		
+		```json
+		{
+			parameters: [ name, inc, range, decimal ],
+			rnage: [ min , max ],
+
+			min: min,
+			max: max,
+			count : count,
+
+			decimal: decimal,
+			dmin: dmin,
+			dmax: dmax,
+			dcount: dcount
+		}
+		```
+ */
+
+var Constant = require('./constant')
+var Random = require('./random/')
+
+/* jshint -W041 */
+module.exports = {
+	parse: function(name) {
+		name = name == undefined ? '' : (name + '')
+
+		var parameters = (name || '').match(Constant.RE_KEY)
+
+		var range = parameters && parameters[3] && parameters[3].match(Constant.RE_RANGE)
+		var min = range && range[1] && parseInt(range[1], 10) // || 1
+		var max = range && range[2] && parseInt(range[2], 10) // || 1
+			// repeat || min-max || 1
+			// var count = range ? !range[2] && parseInt(range[1], 10) || Random.integer(min, max) : 1
+		var count = range ? !range[2] ? parseInt(range[1], 10) : Random.integer(min, max) : undefined
+
+		var decimal = parameters && parameters[4] && parameters[4].match(Constant.RE_RANGE)
+		var dmin = decimal && decimal[1] && parseInt(decimal[1], 10) // || 0,
+		var dmax = decimal && decimal[2] && parseInt(decimal[2], 10) // || 0,
+			// int || dmin-dmax || 0
+		var dcount = decimal ? !decimal[2] && parseInt(decimal[1], 10) || Random.integer(dmin, dmax) : undefined
+
+		var result = {
+			// 1 name, 2 inc, 3 range, 4 decimal
+			parameters: parameters,
+			// 1 min, 2 max
+			range: range,
+			min: min,
+			max: max,
+			// min-max
+			count: count,
+			// 是否有 decimal
+			decimal: decimal,
+			dmin: dmin,
+			dmax: dmax,
+			// dmin-dimax
+			dcount: dcount
+		}
+
+		for (var r in result) {
+			if (result[r] != undefined) return result
+		}
+
+		return {}
+	}
+}

+ 47 - 0
node_modules/.1.0.1-beta3@mockjs/src/mock/random/address.js

@@ -0,0 +1,47 @@
+/*
+    ## Address
+*/
+
+var DICT = require('./address_dict')
+var REGION = ['东北', '华北', '华东', '华中', '华南', '西南', '西北']
+
+module.exports = {
+    // 随机生成一个大区。
+    region: function() {
+        return this.pick(REGION)
+    },
+    // 随机生成一个(中国)省(或直辖市、自治区、特别行政区)。
+    province: function() {
+        return this.pick(DICT).name
+    },
+    // 随机生成一个(中国)市。
+    city: function(prefix) {
+        var province = this.pick(DICT)
+        var city = this.pick(province.children)
+        return prefix ? [province.name, city.name].join(' ') : city.name
+    },
+    // 随机生成一个(中国)县。
+    county: function(prefix) {
+        var province = this.pick(DICT)
+        var city = this.pick(province.children)
+        var county = this.pick(city.children) || {
+            name: '-'
+        }
+        return prefix ? [province.name, city.name, county.name].join(' ') : county.name
+    },
+    // 随机生成一个邮政编码(六位数字)。
+    zip: function(len) {
+        var zip = ''
+        for (var i = 0; i < (len || 6); i++) zip += this.natural(0, 9)
+        return zip
+    }
+
+    // address: function() {},
+    // phone: function() {},
+    // areacode: function() {},
+    // street: function() {},
+    // street_suffixes: function() {},
+    // street_suffix: function() {},
+    // states: function() {},
+    // state: function() {},
+}

文件差異過大導致無法顯示
+ 4068 - 0
node_modules/.1.0.1-beta3@mockjs/src/mock/random/address_dict.js


+ 126 - 0
node_modules/.1.0.1-beta3@mockjs/src/mock/random/basic.js

@@ -0,0 +1,126 @@
+/*
+    ## Basics
+*/
+module.exports = {
+    // 返回一个随机的布尔值。
+    boolean: function(min, max, cur) {
+        if (cur !== undefined) {
+            min = typeof min !== 'undefined' && !isNaN(min) ? parseInt(min, 10) : 1
+            max = typeof max !== 'undefined' && !isNaN(max) ? parseInt(max, 10) : 1
+            return Math.random() > 1.0 / (min + max) * min ? !cur : cur
+        }
+
+        return Math.random() >= 0.5
+    },
+    bool: function(min, max, cur) {
+        return this.boolean(min, max, cur)
+    },
+    // 返回一个随机的自然数(大于等于 0 的整数)。
+    natural: function(min, max) {
+        min = typeof min !== 'undefined' ? parseInt(min, 10) : 0
+        max = typeof max !== 'undefined' ? parseInt(max, 10) : 9007199254740992 // 2^53
+        return Math.round(Math.random() * (max - min)) + min
+    },
+    // 返回一个随机的整数。
+    integer: function(min, max) {
+        min = typeof min !== 'undefined' ? parseInt(min, 10) : -9007199254740992
+        max = typeof max !== 'undefined' ? parseInt(max, 10) : 9007199254740992 // 2^53
+        return Math.round(Math.random() * (max - min)) + min
+    },
+    int: function(min, max) {
+        return this.integer(min, max)
+    },
+    // 返回一个随机的浮点数。
+    float: function(min, max, dmin, dmax) {
+        dmin = dmin === undefined ? 0 : dmin
+        dmin = Math.max(Math.min(dmin, 17), 0)
+        dmax = dmax === undefined ? 17 : dmax
+        dmax = Math.max(Math.min(dmax, 17), 0)
+        var ret = this.integer(min, max) + '.';
+        for (var i = 0, dcount = this.natural(dmin, dmax); i < dcount; i++) {
+            ret += (
+                // 最后一位不能为 0:如果最后一位为 0,会被 JS 引擎忽略掉。
+                (i < dcount - 1) ? this.character('number') : this.character('123456789')
+            )
+        }
+        return parseFloat(ret, 10)
+    },
+    // 返回一个随机字符。
+    character: function(pool) {
+        var pools = {
+            lower: 'abcdefghijklmnopqrstuvwxyz',
+            upper: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
+            number: '0123456789',
+            symbol: '!@#$%^&*()[]'
+        }
+        pools.alpha = pools.lower + pools.upper
+        pools['undefined'] = pools.lower + pools.upper + pools.number + pools.symbol
+
+        pool = pools[('' + pool).toLowerCase()] || pool
+        return pool.charAt(this.natural(0, pool.length - 1))
+    },
+    char: function(pool) {
+        return this.character(pool)
+    },
+    // 返回一个随机字符串。
+    string: function(pool, min, max) {
+        var len
+        switch (arguments.length) {
+            case 0: // ()
+                len = this.natural(3, 7)
+                break
+            case 1: // ( length )
+                len = pool
+                pool = undefined
+                break
+            case 2:
+                // ( pool, length )
+                if (typeof arguments[0] === 'string') {
+                    len = min
+                } else {
+                    // ( min, max )
+                    len = this.natural(pool, min)
+                    pool = undefined
+                }
+                break
+            case 3:
+                len = this.natural(min, max)
+                break
+        }
+
+        var text = ''
+        for (var i = 0; i < len; i++) {
+            text += this.character(pool)
+        }
+
+        return text
+    },
+    str: function( /*pool, min, max*/ ) {
+        return this.string.apply(this, arguments)
+    },
+    // 返回一个整型数组。
+    range: function(start, stop, step) {
+        // range( stop )
+        if (arguments.length <= 1) {
+            stop = start || 0;
+            start = 0;
+        }
+        // range( start, stop )
+        step = arguments[2] || 1;
+
+        start = +start
+        stop = +stop
+        step = +step
+
+        var len = Math.max(Math.ceil((stop - start) / step), 0);
+        var idx = 0;
+        var range = new Array(len);
+
+        while (idx < len) {
+            range[idx++] = start;
+            start += step;
+        }
+
+        return range;
+    }
+}

+ 137 - 0
node_modules/.1.0.1-beta3@mockjs/src/mock/random/color.js

@@ -0,0 +1,137 @@
+/*
+    ## Color
+
+    http://llllll.li/randomColor/
+        A color generator for JavaScript.
+        randomColor generates attractive colors by default. More specifically, randomColor produces bright colors with a reasonably high saturation. This makes randomColor particularly useful for data visualizations and generative art.
+
+    http://randomcolour.com/
+        var bg_colour = Math.floor(Math.random() * 16777215).toString(16);
+        bg_colour = "#" + ("000000" + bg_colour).slice(-6);
+        document.bgColor = bg_colour;
+    
+    http://martin.ankerl.com/2009/12/09/how-to-create-random-colors-programmatically/
+        Creating random colors is actually more difficult than it seems. The randomness itself is easy, but aesthetically pleasing randomness is more difficult.
+        https://github.com/devongovett/color-generator
+
+    http://www.paulirish.com/2009/random-hex-color-code-snippets/
+        Random Hex Color Code Generator in JavaScript
+
+    http://chancejs.com/#color
+        chance.color()
+        // => '#79c157'
+        chance.color({format: 'hex'})
+        // => '#d67118'
+        chance.color({format: 'shorthex'})
+        // => '#60f'
+        chance.color({format: 'rgb'})
+        // => 'rgb(110,52,164)'
+
+    http://tool.c7sky.com/webcolor
+        网页设计常用色彩搭配表
+    
+    https://github.com/One-com/one-color
+        An OO-based JavaScript color parser/computation toolkit with support for RGB, HSV, HSL, CMYK, and alpha channels.
+        API 很赞
+
+    https://github.com/harthur/color
+        JavaScript color conversion and manipulation library
+
+    https://github.com/leaverou/css-colors
+        Share & convert CSS colors
+    http://leaverou.github.io/css-colors/#slategray
+        Type a CSS color keyword, #hex, hsl(), rgba(), whatever:
+
+    色调 hue
+        http://baike.baidu.com/view/23368.htm
+        色调指的是一幅画中画面色彩的总体倾向,是大的色彩效果。
+    饱和度 saturation
+        http://baike.baidu.com/view/189644.htm
+        饱和度是指色彩的鲜艳程度,也称色彩的纯度。饱和度取决于该色中含色成分和消色成分(灰色)的比例。含色成分越大,饱和度越大;消色成分越大,饱和度越小。
+    亮度 brightness
+        http://baike.baidu.com/view/34773.htm
+        亮度是指发光体(反光体)表面发光(反光)强弱的物理量。
+    照度 luminosity
+        物体被照亮的程度,采用单位面积所接受的光通量来表示,表示单位为勒[克斯](Lux,lx) ,即 1m / m2 。
+
+    http://stackoverflow.com/questions/1484506/random-color-generator-in-javascript
+        var letters = '0123456789ABCDEF'.split('')
+        var color = '#'
+        for (var i = 0; i < 6; i++) {
+            color += letters[Math.floor(Math.random() * 16)]
+        }
+        return color
+    
+        // 随机生成一个无脑的颜色,格式为 '#RRGGBB'。
+        // _brainlessColor()
+        var color = Math.floor(
+            Math.random() *
+            (16 * 16 * 16 * 16 * 16 * 16 - 1)
+        ).toString(16)
+        color = "#" + ("000000" + color).slice(-6)
+        return color.toUpperCase()
+*/
+
+var Convert = require('./color_convert')
+var DICT = require('./color_dict')
+
+module.exports = {
+    // 随机生成一个有吸引力的颜色,格式为 '#RRGGBB'。
+    color: function(name) {
+        if (name || DICT[name]) return DICT[name].nicer
+        return this.hex()
+    },
+    // #DAC0DE
+    hex: function() {
+        var hsv = this._goldenRatioColor()
+        var rgb = Convert.hsv2rgb(hsv)
+        var hex = Convert.rgb2hex(rgb[0], rgb[1], rgb[2])
+        return hex
+    },
+    // rgb(128,255,255)
+    rgb: function() {
+        var hsv = this._goldenRatioColor()
+        var rgb = Convert.hsv2rgb(hsv)
+        return 'rgb(' +
+            parseInt(rgb[0], 10) + ', ' +
+            parseInt(rgb[1], 10) + ', ' +
+            parseInt(rgb[2], 10) + ')'
+    },
+    // rgba(128,255,255,0.3)
+    rgba: function() {
+        var hsv = this._goldenRatioColor()
+        var rgb = Convert.hsv2rgb(hsv)
+        return 'rgba(' +
+            parseInt(rgb[0], 10) + ', ' +
+            parseInt(rgb[1], 10) + ', ' +
+            parseInt(rgb[2], 10) + ', ' +
+            Math.random().toFixed(2) + ')'
+    },
+    // hsl(300,80%,90%)
+    hsl: function() {
+        var hsv = this._goldenRatioColor()
+        var hsl = Convert.hsv2hsl(hsv)
+        return 'hsl(' +
+            parseInt(hsl[0], 10) + ', ' +
+            parseInt(hsl[1], 10) + ', ' +
+            parseInt(hsl[2], 10) + ')'
+    },
+    // http://martin.ankerl.com/2009/12/09/how-to-create-random-colors-programmatically/
+    // https://github.com/devongovett/color-generator/blob/master/index.js
+    // 随机生成一个有吸引力的颜色。
+    _goldenRatioColor: function(saturation, value) {
+        this._goldenRatio = 0.618033988749895
+        this._hue = this._hue || Math.random()
+        this._hue += this._goldenRatio
+        this._hue %= 1
+
+        if (typeof saturation !== "number") saturation = 0.5;
+        if (typeof value !== "number") value = 0.95;
+
+        return [
+            this._hue * 360,
+            saturation * 100,
+            value * 100
+        ]
+    }
+}

+ 177 - 0
node_modules/.1.0.1-beta3@mockjs/src/mock/random/color_convert.js

@@ -0,0 +1,177 @@
+/*
+    ## Color Convert
+
+    http://blog.csdn.net/idfaya/article/details/6770414
+        颜色空间RGB与HSV(HSL)的转换
+*/
+// https://github.com/harthur/color-convert/blob/master/conversions.js
+module.exports = {
+	rgb2hsl: function rgb2hsl(rgb) {
+		var r = rgb[0] / 255,
+			g = rgb[1] / 255,
+			b = rgb[2] / 255,
+			min = Math.min(r, g, b),
+			max = Math.max(r, g, b),
+			delta = max - min,
+			h, s, l;
+
+		if (max == min)
+			h = 0;
+		else if (r == max)
+			h = (g - b) / delta;
+		else if (g == max)
+			h = 2 + (b - r) / delta;
+		else if (b == max)
+			h = 4 + (r - g) / delta;
+
+		h = Math.min(h * 60, 360);
+
+		if (h < 0)
+			h += 360;
+
+		l = (min + max) / 2;
+
+		if (max == min)
+			s = 0;
+		else if (l <= 0.5)
+			s = delta / (max + min);
+		else
+			s = delta / (2 - max - min);
+
+		return [h, s * 100, l * 100];
+	},
+	rgb2hsv: function rgb2hsv(rgb) {
+		var r = rgb[0],
+			g = rgb[1],
+			b = rgb[2],
+			min = Math.min(r, g, b),
+			max = Math.max(r, g, b),
+			delta = max - min,
+			h, s, v;
+
+		if (max === 0)
+			s = 0;
+		else
+			s = (delta / max * 1000) / 10;
+
+		if (max == min)
+			h = 0;
+		else if (r == max)
+			h = (g - b) / delta;
+		else if (g == max)
+			h = 2 + (b - r) / delta;
+		else if (b == max)
+			h = 4 + (r - g) / delta;
+
+		h = Math.min(h * 60, 360);
+
+		if (h < 0)
+			h += 360;
+
+		v = ((max / 255) * 1000) / 10;
+
+		return [h, s, v];
+	},
+	hsl2rgb: function hsl2rgb(hsl) {
+		var h = hsl[0] / 360,
+			s = hsl[1] / 100,
+			l = hsl[2] / 100,
+			t1, t2, t3, rgb, val;
+
+		if (s === 0) {
+			val = l * 255;
+			return [val, val, val];
+		}
+
+		if (l < 0.5)
+			t2 = l * (1 + s);
+		else
+			t2 = l + s - l * s;
+		t1 = 2 * l - t2;
+
+		rgb = [0, 0, 0];
+		for (var i = 0; i < 3; i++) {
+			t3 = h + 1 / 3 * -(i - 1);
+			if (t3 < 0) t3++;
+			if (t3 > 1) t3--;
+
+			if (6 * t3 < 1)
+				val = t1 + (t2 - t1) * 6 * t3;
+			else if (2 * t3 < 1)
+				val = t2;
+			else if (3 * t3 < 2)
+				val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
+			else
+				val = t1;
+
+			rgb[i] = val * 255;
+		}
+
+		return rgb;
+	},
+	hsl2hsv: function hsl2hsv(hsl) {
+		var h = hsl[0],
+			s = hsl[1] / 100,
+			l = hsl[2] / 100,
+			sv, v;
+		l *= 2;
+		s *= (l <= 1) ? l : 2 - l;
+		v = (l + s) / 2;
+		sv = (2 * s) / (l + s);
+		return [h, sv * 100, v * 100];
+	},
+	hsv2rgb: function hsv2rgb(hsv) {
+		var h = hsv[0] / 60
+		var s = hsv[1] / 100
+		var v = hsv[2] / 100
+		var hi = Math.floor(h) % 6
+
+		var f = h - Math.floor(h)
+		var p = 255 * v * (1 - s)
+		var q = 255 * v * (1 - (s * f))
+		var t = 255 * v * (1 - (s * (1 - f)))
+
+		v = 255 * v
+
+		switch (hi) {
+			case 0:
+				return [v, t, p]
+			case 1:
+				return [q, v, p]
+			case 2:
+				return [p, v, t]
+			case 3:
+				return [p, q, v]
+			case 4:
+				return [t, p, v]
+			case 5:
+				return [v, p, q]
+		}
+	},
+	hsv2hsl: function hsv2hsl(hsv) {
+		var h = hsv[0],
+			s = hsv[1] / 100,
+			v = hsv[2] / 100,
+			sl, l;
+
+		l = (2 - s) * v;
+		sl = s * v;
+		sl /= (l <= 1) ? l : 2 - l;
+		l /= 2;
+		return [h, sl * 100, l * 100];
+	},
+	// http://www.140byt.es/keywords/color
+	rgb2hex: function(
+		a, // red, as a number from 0 to 255
+		b, // green, as a number from 0 to 255
+		c // blue, as a number from 0 to 255
+	) {
+		return "#" + ((256 + a << 8 | b) << 8 | c).toString(16).slice(1)
+	},
+	hex2rgb: function(
+		a // take a "#xxxxxx" hex string,
+	) {
+		a = '0x' + a.slice(1).replace(a.length > 4 ? a : /./g, '$&$&') | 0;
+		return [a >> 16, a >> 8 & 255, a & 255]
+	}
+}

+ 76 - 0
node_modules/.1.0.1-beta3@mockjs/src/mock/random/color_dict.js

@@ -0,0 +1,76 @@
+/*
+    ## Color 字典数据
+
+    字典数据来源 [A nicer color palette for the web](http://clrs.cc/)
+*/
+module.exports = {
+    // name value nicer
+    navy: {
+        value: '#000080',
+        nicer: '#001F3F'
+    },
+    blue: {
+        value: '#0000ff',
+        nicer: '#0074D9'
+    },
+    aqua: {
+        value: '#00ffff',
+        nicer: '#7FDBFF'
+    },
+    teal: {
+        value: '#008080',
+        nicer: '#39CCCC'
+    },
+    olive: {
+        value: '#008000',
+        nicer: '#3D9970'
+    },
+    green: {
+        value: '#008000',
+        nicer: '#2ECC40'
+    },
+    lime: {
+        value: '#00ff00',
+        nicer: '#01FF70'
+    },
+    yellow: {
+        value: '#ffff00',
+        nicer: '#FFDC00'
+    },
+    orange: {
+        value: '#ffa500',
+        nicer: '#FF851B'
+    },
+    red: {
+        value: '#ff0000',
+        nicer: '#FF4136'
+    },
+    maroon: {
+        value: '#800000',
+        nicer: '#85144B'
+    },
+    fuchsia: {
+        value: '#ff00ff',
+        nicer: '#F012BE'
+    },
+    purple: {
+        value: '#800080',
+        nicer: '#B10DC9'
+    },
+    silver: {
+        value: '#c0c0c0',
+        nicer: '#DDDDDD'
+    },
+    gray: {
+        value: '#808080',
+        nicer: '#AAAAAA'
+    },
+    black: {
+        value: '#000000',
+        nicer: '#111111'
+    },
+    white: {
+        value: '#FFFFFF',
+        nicer: '#FFFFFF'
+    }
+}

+ 141 - 0
node_modules/.1.0.1-beta3@mockjs/src/mock/random/date.js

@@ -0,0 +1,141 @@
+/*
+    ## Date
+*/
+var patternLetters = {
+    yyyy: 'getFullYear',
+    yy: function(date) {
+        return ('' + date.getFullYear()).slice(2)
+    },
+    y: 'yy',
+
+    MM: function(date) {
+        var m = date.getMonth() + 1
+        return m < 10 ? '0' + m : m
+    },
+    M: function(date) {
+        return date.getMonth() + 1
+    },
+
+    dd: function(date) {
+        var d = date.getDate()
+        return d < 10 ? '0' + d : d
+    },
+    d: 'getDate',
+
+    HH: function(date) {
+        var h = date.getHours()
+        return h < 10 ? '0' + h : h
+    },
+    H: 'getHours',
+    hh: function(date) {
+        var h = date.getHours() % 12
+        return h < 10 ? '0' + h : h
+    },
+    h: function(date) {
+        return date.getHours() % 12
+    },
+
+    mm: function(date) {
+        var m = date.getMinutes()
+        return m < 10 ? '0' + m : m
+    },
+    m: 'getMinutes',
+
+    ss: function(date) {
+        var s = date.getSeconds()
+        return s < 10 ? '0' + s : s
+    },
+    s: 'getSeconds',
+
+    SS: function(date) {
+        var ms = date.getMilliseconds()
+        return ms < 10 && '00' + ms || ms < 100 && '0' + ms || ms
+    },
+    S: 'getMilliseconds',
+
+    A: function(date) {
+        return date.getHours() < 12 ? 'AM' : 'PM'
+    },
+    a: function(date) {
+        return date.getHours() < 12 ? 'am' : 'pm'
+    },
+    T: 'getTime'
+}
+module.exports = {
+    // 日期占位符集合。
+    _patternLetters: patternLetters,
+    // 日期占位符正则。
+    _rformat: new RegExp((function() {
+        var re = []
+        for (var i in patternLetters) re.push(i)
+        return '(' + re.join('|') + ')'
+    })(), 'g'),
+    // 格式化日期。
+    _formatDate: function(date, format) {
+        return format.replace(this._rformat, function creatNewSubString($0, flag) {
+            return typeof patternLetters[flag] === 'function' ? patternLetters[flag](date) :
+                patternLetters[flag] in patternLetters ? creatNewSubString($0, patternLetters[flag]) :
+                date[patternLetters[flag]]()
+        })
+    },
+    // 生成一个随机的 Date 对象。
+    _randomDate: function(min, max) { // min, max
+        min = min === undefined ? new Date(0) : min
+        max = max === undefined ? new Date() : max
+        return new Date(Math.random() * (max.getTime() - min.getTime()))
+    },
+    // 返回一个随机的日期字符串。
+    date: function(format) {
+        format = format || 'yyyy-MM-dd'
+        return this._formatDate(this._randomDate(), format)
+    },
+    // 返回一个随机的时间字符串。
+    time: function(format) {
+        format = format || 'HH:mm:ss'
+        return this._formatDate(this._randomDate(), format)
+    },
+    // 返回一个随机的日期和时间字符串。
+    datetime: function(format) {
+        format = format || 'yyyy-MM-dd HH:mm:ss'
+        return this._formatDate(this._randomDate(), format)
+    },
+    // 返回当前的日期和时间字符串。
+    now: function(unit, format) {
+        // now(unit) now(format)
+        if (arguments.length === 1) {
+            // now(format)
+            if (!/year|month|day|hour|minute|second|week/.test(unit)) {
+                format = unit
+                unit = ''
+            }
+        }
+        unit = (unit || '').toLowerCase()
+        format = format || 'yyyy-MM-dd HH:mm:ss'
+
+        var date = new Date()
+
+        /* jshint -W086 */
+        // 参考自 http://momentjs.cn/docs/#/manipulating/start-of/
+        switch (unit) {
+            case 'year':
+                date.setMonth(0)
+            case 'month':
+                date.setDate(1)
+            case 'week':
+            case 'day':
+                date.setHours(0)
+            case 'hour':
+                date.setMinutes(0)
+            case 'minute':
+                date.setSeconds(0)
+            case 'second':
+                date.setMilliseconds(0)
+        }
+        switch (unit) {
+            case 'week':
+                date.setDate(date.getDate() - date.getDay())
+        }
+
+        return this._formatDate(date, format)
+    }
+}

+ 116 - 0
node_modules/.1.0.1-beta3@mockjs/src/mock/random/helper.js

@@ -0,0 +1,116 @@
+/*
+    ## Helpers
+*/
+
+var Util = require('../util')
+
+module.exports = {
+	// 把字符串的第一个字母转换为大写。
+	capitalize: function(word) {
+		return (word + '').charAt(0).toUpperCase() + (word + '').substr(1)
+	},
+	// 把字符串转换为大写。
+	upper: function(str) {
+		return (str + '').toUpperCase()
+	},
+	// 把字符串转换为小写。
+	lower: function(str) {
+		return (str + '').toLowerCase()
+	},
+	// 从数组中随机选取一个元素,并返回。
+	pick: function pick(arr, min, max) {
+		// pick( item1, item2 ... )
+		if (!Util.isArray(arr)) {
+			arr = [].slice.call(arguments)
+			min = 1
+			max = 1
+		} else {
+			// pick( [ item1, item2 ... ] )
+			if (min === undefined) min = 1
+
+			// pick( [ item1, item2 ... ], count )
+			if (max === undefined) max = min
+		}
+
+		if (min === 1 && max === 1) return arr[this.natural(0, arr.length - 1)]
+
+		// pick( [ item1, item2 ... ], min, max )
+		return this.shuffle(arr, min, max)
+
+		// 通过参数个数判断方法签名,扩展性太差!#90
+		// switch (arguments.length) {
+		// 	case 1:
+		// 		// pick( [ item1, item2 ... ] )
+		// 		return arr[this.natural(0, arr.length - 1)]
+		// 	case 2:
+		// 		// pick( [ item1, item2 ... ], count )
+		// 		max = min
+		// 			/* falls through */
+		// 	case 3:
+		// 		// pick( [ item1, item2 ... ], min, max )
+		// 		return this.shuffle(arr, min, max)
+		// }
+	},
+	/*
+	    打乱数组中元素的顺序,并返回。
+	    Given an array, scramble the order and return it.
+
+	    其他的实现思路:
+	        // https://code.google.com/p/jslibs/wiki/JavascriptTips
+	        result = result.sort(function() {
+	            return Math.random() - 0.5
+	        })
+	*/
+	shuffle: function shuffle(arr, min, max) {
+		arr = arr || []
+		var old = arr.slice(0),
+			result = [],
+			index = 0,
+			length = old.length;
+		for (var i = 0; i < length; i++) {
+			index = this.natural(0, old.length - 1)
+			result.push(old[index])
+			old.splice(index, 1)
+		}
+		switch (arguments.length) {
+			case 0:
+			case 1:
+				return result
+			case 2:
+				max = min
+					/* falls through */
+			case 3:
+				min = parseInt(min, 10)
+				max = parseInt(max, 10)
+				return result.slice(0, this.natural(min, max))
+		}
+	},
+	/*
+	    * Random.order(item, item)
+	    * Random.order([item, item ...])
+
+	    顺序获取数组中的元素
+
+	    [JSON导入数组支持数组数据录入](https://github.com/thx/RAP/issues/22)
+
+	    不支持单独调用!
+	*/
+	order: function order(array) {
+		order.cache = order.cache || {}
+
+		if (arguments.length > 1) array = [].slice.call(arguments, 0)
+
+		// options.context.path/templatePath
+		var options = order.options
+		var templatePath = options.context.templatePath.join('.')
+
+		var cache = (
+			order.cache[templatePath] = order.cache[templatePath] || {
+				index: 0,
+				array: array
+			}
+		)
+
+		return cache.array[cache.index++ % cache.array.length]
+	}
+}

+ 282 - 0
node_modules/.1.0.1-beta3@mockjs/src/mock/random/image.js

@@ -0,0 +1,282 @@
+/* global document  */
+/*
+    ## Image
+*/
+module.exports = {
+    // 常见的广告宽高
+    _adSize: [
+        '300x250', '250x250', '240x400', '336x280', '180x150',
+        '720x300', '468x60', '234x60', '88x31', '120x90',
+        '120x60', '120x240', '125x125', '728x90', '160x600',
+        '120x600', '300x600'
+    ],
+    // 常见的屏幕宽高
+    _screenSize: [
+        '320x200', '320x240', '640x480', '800x480', '800x480',
+        '1024x600', '1024x768', '1280x800', '1440x900', '1920x1200',
+        '2560x1600'
+    ],
+    // 常见的视频宽高
+    _videoSize: ['720x480', '768x576', '1280x720', '1920x1080'],
+    /*
+        生成一个随机的图片地址。
+
+        替代图片源
+            http://fpoimg.com/
+        参考自 
+            http://rensanning.iteye.com/blog/1933310
+            http://code.tutsplus.com/articles/the-top-8-placeholders-for-web-designers--net-19485
+    */
+    image: function(size, background, foreground, format, text) {
+        // Random.image( size, background, foreground, text )
+        if (arguments.length === 4) {
+            text = format
+            format = undefined
+        }
+        // Random.image( size, background, text )
+        if (arguments.length === 3) {
+            text = foreground
+            foreground = undefined
+        }
+        // Random.image()
+        if (!size) size = this.pick(this._adSize)
+
+        if (background && ~background.indexOf('#')) background = background.slice(1)
+        if (foreground && ~foreground.indexOf('#')) foreground = foreground.slice(1)
+
+        // http://dummyimage.com/600x400/cc00cc/470047.png&text=hello
+        return 'http://dummyimage.com/' + size +
+            (background ? '/' + background : '') +
+            (foreground ? '/' + foreground : '') +
+            (format ? '.' + format : '') +
+            (text ? '&text=' + text : '')
+    },
+    img: function() {
+        return this.image.apply(this, arguments)
+    },
+
+    /*
+        BrandColors
+        http://brandcolors.net/
+        A collection of major brand color codes curated by Galen Gidman.
+        大牌公司的颜色集合
+
+        // 获取品牌和颜色
+        $('h2').each(function(index, item){
+            item = $(item)
+            console.log('\'' + item.text() + '\'', ':', '\'' + item.next().text() + '\'', ',')
+        })
+    */
+    _brandColors: {
+        '4ormat': '#fb0a2a',
+        '500px': '#02adea',
+        'About.me (blue)': '#00405d',
+        'About.me (yellow)': '#ffcc33',
+        'Addvocate': '#ff6138',
+        'Adobe': '#ff0000',
+        'Aim': '#fcd20b',
+        'Amazon': '#e47911',
+        'Android': '#a4c639',
+        'Angie\'s List': '#7fbb00',
+        'AOL': '#0060a3',
+        'Atlassian': '#003366',
+        'Behance': '#053eff',
+        'Big Cartel': '#97b538',
+        'bitly': '#ee6123',
+        'Blogger': '#fc4f08',
+        'Boeing': '#0039a6',
+        'Booking.com': '#003580',
+        'Carbonmade': '#613854',
+        'Cheddar': '#ff7243',
+        'Code School': '#3d4944',
+        'Delicious': '#205cc0',
+        'Dell': '#3287c1',
+        'Designmoo': '#e54a4f',
+        'Deviantart': '#4e6252',
+        'Designer News': '#2d72da',
+        'Devour': '#fd0001',
+        'DEWALT': '#febd17',
+        'Disqus (blue)': '#59a3fc',
+        'Disqus (orange)': '#db7132',
+        'Dribbble': '#ea4c89',
+        'Dropbox': '#3d9ae8',
+        'Drupal': '#0c76ab',
+        'Dunked': '#2a323a',
+        'eBay': '#89c507',
+        'Ember': '#f05e1b',
+        'Engadget': '#00bdf6',
+        'Envato': '#528036',
+        'Etsy': '#eb6d20',
+        'Evernote': '#5ba525',
+        'Fab.com': '#dd0017',
+        'Facebook': '#3b5998',
+        'Firefox': '#e66000',
+        'Flickr (blue)': '#0063dc',
+        'Flickr (pink)': '#ff0084',
+        'Forrst': '#5b9a68',
+        'Foursquare': '#25a0ca',
+        'Garmin': '#007cc3',
+        'GetGlue': '#2d75a2',
+        'Gimmebar': '#f70078',
+        'GitHub': '#171515',
+        'Google Blue': '#0140ca',
+        'Google Green': '#16a61e',
+        'Google Red': '#dd1812',
+        'Google Yellow': '#fcca03',
+        'Google+': '#dd4b39',
+        'Grooveshark': '#f77f00',
+        'Groupon': '#82b548',
+        'Hacker News': '#ff6600',
+        'HelloWallet': '#0085ca',
+        'Heroku (light)': '#c7c5e6',
+        'Heroku (dark)': '#6567a5',
+        'HootSuite': '#003366',
+        'Houzz': '#73ba37',
+        'HTML5': '#ec6231',
+        'IKEA': '#ffcc33',
+        'IMDb': '#f3ce13',
+        'Instagram': '#3f729b',
+        'Intel': '#0071c5',
+        'Intuit': '#365ebf',
+        'Kickstarter': '#76cc1e',
+        'kippt': '#e03500',
+        'Kodery': '#00af81',
+        'LastFM': '#c3000d',
+        'LinkedIn': '#0e76a8',
+        'Livestream': '#cf0005',
+        'Lumo': '#576396',
+        'Mixpanel': '#a086d3',
+        'Meetup': '#e51937',
+        'Nokia': '#183693',
+        'NVIDIA': '#76b900',
+        'Opera': '#cc0f16',
+        'Path': '#e41f11',
+        'PayPal (dark)': '#1e477a',
+        'PayPal (light)': '#3b7bbf',
+        'Pinboard': '#0000e6',
+        'Pinterest': '#c8232c',
+        'PlayStation': '#665cbe',
+        'Pocket': '#ee4056',
+        'Prezi': '#318bff',
+        'Pusha': '#0f71b4',
+        'Quora': '#a82400',
+        'QUOTE.fm': '#66ceff',
+        'Rdio': '#008fd5',
+        'Readability': '#9c0000',
+        'Red Hat': '#cc0000',
+        'Resource': '#7eb400',
+        'Rockpack': '#0ba6ab',
+        'Roon': '#62b0d9',
+        'RSS': '#ee802f',
+        'Salesforce': '#1798c1',
+        'Samsung': '#0c4da2',
+        'Shopify': '#96bf48',
+        'Skype': '#00aff0',
+        'Snagajob': '#f47a20',
+        'Softonic': '#008ace',
+        'SoundCloud': '#ff7700',
+        'Space Box': '#f86960',
+        'Spotify': '#81b71a',
+        'Sprint': '#fee100',
+        'Squarespace': '#121212',
+        'StackOverflow': '#ef8236',
+        'Staples': '#cc0000',
+        'Status Chart': '#d7584f',
+        'Stripe': '#008cdd',
+        'StudyBlue': '#00afe1',
+        'StumbleUpon': '#f74425',
+        'T-Mobile': '#ea0a8e',
+        'Technorati': '#40a800',
+        'The Next Web': '#ef4423',
+        'Treehouse': '#5cb868',
+        'Trulia': '#5eab1f',
+        'Tumblr': '#34526f',
+        'Twitch.tv': '#6441a5',
+        'Twitter': '#00acee',
+        'TYPO3': '#ff8700',
+        'Ubuntu': '#dd4814',
+        'Ustream': '#3388ff',
+        'Verizon': '#ef1d1d',
+        'Vimeo': '#86c9ef',
+        'Vine': '#00a478',
+        'Virb': '#06afd8',
+        'Virgin Media': '#cc0000',
+        'Wooga': '#5b009c',
+        'WordPress (blue)': '#21759b',
+        'WordPress (orange)': '#d54e21',
+        'WordPress (grey)': '#464646',
+        'Wunderlist': '#2b88d9',
+        'XBOX': '#9bc848',
+        'XING': '#126567',
+        'Yahoo!': '#720e9e',
+        'Yandex': '#ffcc00',
+        'Yelp': '#c41200',
+        'YouTube': '#c4302b',
+        'Zalongo': '#5498dc',
+        'Zendesk': '#78a300',
+        'Zerply': '#9dcc7a',
+        'Zootool': '#5e8b1d'
+    },
+    _brandNames: function() {
+        var brands = [];
+        for (var b in this._brandColors) {
+            brands.push(b)
+        }
+        return brands
+    },
+    /*
+        生成一段随机的 Base64 图片编码。
+
+        https://github.com/imsky/holder
+        Holder renders image placeholders entirely on the client side.
+
+        dataImageHolder: function(size) {
+            return 'holder.js/' + size
+        },
+    */
+    dataImage: function(size, text) {
+        var canvas
+        if (typeof document !== 'undefined') {
+            canvas = document.createElement('canvas')
+        } else {
+            /*
+                https://github.com/Automattic/node-canvas
+                    npm install canvas --save
+                安装问题:
+                * http://stackoverflow.com/questions/22953206/gulp-issues-with-cario-install-command-not-found-when-trying-to-installing-canva
+                * https://github.com/Automattic/node-canvas/issues/415
+                * https://github.com/Automattic/node-canvas/wiki/_pages
+
+                PS:node-canvas 的安装过程实在是太繁琐了,所以不放入 package.json 的 dependencies。
+             */
+            var Canvas = module.require('canvas')
+            canvas = new Canvas()
+        }
+
+        var ctx = canvas && canvas.getContext && canvas.getContext("2d")
+        if (!canvas || !ctx) return ''
+
+        if (!size) size = this.pick(this._adSize)
+        text = text !== undefined ? text : size
+
+        size = size.split('x')
+
+        var width = parseInt(size[0], 10),
+            height = parseInt(size[1], 10),
+            background = this._brandColors[this.pick(this._brandNames())],
+            foreground = '#FFF',
+            text_height = 14,
+            font = 'sans-serif';
+
+        canvas.width = width
+        canvas.height = height
+        ctx.textAlign = 'center'
+        ctx.textBaseline = 'middle'
+        ctx.fillStyle = background
+        ctx.fillRect(0, 0, width, height)
+        ctx.fillStyle = foreground
+        ctx.font = 'bold ' + text_height + 'px ' + font
+        ctx.fillText(text, (width / 2), (height / 2), width)
+        return canvas.toDataURL('image/png')
+    }
+}

+ 24 - 0
node_modules/.1.0.1-beta3@mockjs/src/mock/random/index.js

@@ -0,0 +1,24 @@
+/*
+    ## Mock.Random
+    
+    工具类,用于生成各种随机数据。
+*/
+
+var Util = require('../util')
+
+var Random = {
+    extend: Util.extend
+}
+
+Random.extend(require('./basic'))
+Random.extend(require('./date'))
+Random.extend(require('./image'))
+Random.extend(require('./color'))
+Random.extend(require('./text'))
+Random.extend(require('./name'))
+Random.extend(require('./web'))
+Random.extend(require('./address'))
+Random.extend(require('./helper'))
+Random.extend(require('./misc'))
+
+module.exports = Random

+ 105 - 0
node_modules/.1.0.1-beta3@mockjs/src/mock/random/misc.js

@@ -0,0 +1,105 @@
+/*
+    ## Miscellaneous
+*/
+var DICT = require('./address_dict')
+module.exports = {
+	// Dice
+	d4: function() {
+		return this.natural(1, 4)
+	},
+	d6: function() {
+		return this.natural(1, 6)
+	},
+	d8: function() {
+		return this.natural(1, 8)
+	},
+	d12: function() {
+		return this.natural(1, 12)
+	},
+	d20: function() {
+		return this.natural(1, 20)
+	},
+	d100: function() {
+		return this.natural(1, 100)
+	},
+	/*
+	    随机生成一个 GUID。
+
+	    http://www.broofa.com/2008/09/javascript-uuid-function/
+	    [UUID 规范](http://www.ietf.org/rfc/rfc4122.txt)
+	        UUIDs (Universally Unique IDentifier)
+	        GUIDs (Globally Unique IDentifier)
+	        The formal definition of the UUID string representation is provided by the following ABNF [7]:
+	            UUID                   = time-low "-" time-mid "-"
+	                                   time-high-and-version "-"
+	                                   clock-seq-and-reserved
+	                                   clock-seq-low "-" node
+	            time-low               = 4hexOctet
+	            time-mid               = 2hexOctet
+	            time-high-and-version  = 2hexOctet
+	            clock-seq-and-reserved = hexOctet
+	            clock-seq-low          = hexOctet
+	            node                   = 6hexOctet
+	            hexOctet               = hexDigit hexDigit
+	            hexDigit =
+	                "0" / "1" / "2" / "3" / "4" / "5" / "6" / "7" / "8" / "9" /
+	                "a" / "b" / "c" / "d" / "e" / "f" /
+	                "A" / "B" / "C" / "D" / "E" / "F"
+	    
+	    https://github.com/victorquinn/chancejs/blob/develop/chance.js#L1349
+	*/
+	guid: function() {
+		var pool = "abcdefABCDEF1234567890",
+			guid = this.string(pool, 8) + '-' +
+			this.string(pool, 4) + '-' +
+			this.string(pool, 4) + '-' +
+			this.string(pool, 4) + '-' +
+			this.string(pool, 12);
+		return guid
+	},
+	uuid: function() {
+		return this.guid()
+	},
+	/*
+	    随机生成一个 18 位身份证。
+
+	    [身份证](http://baike.baidu.com/view/1697.htm#4)
+	        地址码 6 + 出生日期码 8 + 顺序码 3 + 校验码 1
+	    [《中华人民共和国行政区划代码》国家标准(GB/T2260)](http://zhidao.baidu.com/question/1954561.html)
+	*/
+	id: function() {
+		var id,
+			sum = 0,
+			rank = [
+				"7", "9", "10", "5", "8", "4", "2", "1", "6", "3", "7", "9", "10", "5", "8", "4", "2"
+			],
+			last = [
+				"1", "0", "X", "9", "8", "7", "6", "5", "4", "3", "2"
+			]
+
+		id = this.pick(DICT).id +
+			this.date('yyyyMMdd') +
+			this.string('number', 3)
+
+		for (var i = 0; i < id.length; i++) {
+			sum += id[i] * rank[i];
+		}
+		id += last[sum % 11];
+
+		return id
+	},
+
+	/*
+	    生成一个全局的自增整数。
+	    类似自增主键(auto increment primary key)。
+	*/
+	increment: function() {
+		var key = 0
+		return function(step) {
+			return key += (+step || 1) // step?
+		}
+	}(),
+	inc: function(step) {
+		return this.increment(step)
+	}
+}

+ 87 - 0
node_modules/.1.0.1-beta3@mockjs/src/mock/random/name.js

@@ -0,0 +1,87 @@
+/*
+    ## Name
+
+    [Beyond the Top 1000 Names](http://www.ssa.gov/oact/babynames/limits.html)
+*/
+module.exports = {
+	// 随机生成一个常见的英文名。
+	first: function() {
+		var names = [
+			// male
+			"James", "John", "Robert", "Michael", "William",
+			"David", "Richard", "Charles", "Joseph", "Thomas",
+			"Christopher", "Daniel", "Paul", "Mark", "Donald",
+			"George", "Kenneth", "Steven", "Edward", "Brian",
+			"Ronald", "Anthony", "Kevin", "Jason", "Matthew",
+			"Gary", "Timothy", "Jose", "Larry", "Jeffrey",
+			"Frank", "Scott", "Eric"
+		].concat([
+			// female
+			"Mary", "Patricia", "Linda", "Barbara", "Elizabeth",
+			"Jennifer", "Maria", "Susan", "Margaret", "Dorothy",
+			"Lisa", "Nancy", "Karen", "Betty", "Helen",
+			"Sandra", "Donna", "Carol", "Ruth", "Sharon",
+			"Michelle", "Laura", "Sarah", "Kimberly", "Deborah",
+			"Jessica", "Shirley", "Cynthia", "Angela", "Melissa",
+			"Brenda", "Amy", "Anna"
+		])
+		return this.pick(names)
+			// or this.capitalize(this.word())
+	},
+	// 随机生成一个常见的英文姓。
+	last: function() {
+		var names = [
+			"Smith", "Johnson", "Williams", "Brown", "Jones",
+			"Miller", "Davis", "Garcia", "Rodriguez", "Wilson",
+			"Martinez", "Anderson", "Taylor", "Thomas", "Hernandez",
+			"Moore", "Martin", "Jackson", "Thompson", "White",
+			"Lopez", "Lee", "Gonzalez", "Harris", "Clark",
+			"Lewis", "Robinson", "Walker", "Perez", "Hall",
+			"Young", "Allen"
+		]
+		return this.pick(names)
+			// or this.capitalize(this.word())
+	},
+	// 随机生成一个常见的英文姓名。
+	name: function(middle) {
+		return this.first() + ' ' +
+			(middle ? this.first() + ' ' : '') +
+			this.last()
+	},
+	/*
+	    随机生成一个常见的中文姓。
+	    [世界常用姓氏排行](http://baike.baidu.com/view/1719115.htm)
+	    [玄派网 - 网络小说创作辅助平台](http://xuanpai.sinaapp.com/)
+	 */
+	cfirst: function() {
+		var names = (
+			'王 李 张 刘 陈 杨 赵 黄 周 吴 ' +
+			'徐 孙 胡 朱 高 林 何 郭 马 罗 ' +
+			'梁 宋 郑 谢 韩 唐 冯 于 董 萧 ' +
+			'程 曹 袁 邓 许 傅 沈 曾 彭 吕 ' +
+			'苏 卢 蒋 蔡 贾 丁 魏 薛 叶 阎 ' +
+			'余 潘 杜 戴 夏 锺 汪 田 任 姜 ' +
+			'范 方 石 姚 谭 廖 邹 熊 金 陆 ' +
+			'郝 孔 白 崔 康 毛 邱 秦 江 史 ' +
+			'顾 侯 邵 孟 龙 万 段 雷 钱 汤 ' +
+			'尹 黎 易 常 武 乔 贺 赖 龚 文'
+		).split(' ')
+		return this.pick(names)
+	},
+	/*
+	    随机生成一个常见的中文名。
+	    [中国最常见名字前50名_三九算命网](http://www.name999.net/xingming/xingshi/20131004/48.html)
+	 */
+	clast: function() {
+		var names = (
+			'伟 芳 娜 秀英 敏 静 丽 强 磊 军 ' +
+			'洋 勇 艳 杰 娟 涛 明 超 秀兰 霞 ' +
+			'平 刚 桂英'
+		).split(' ')
+		return this.pick(names)
+	},
+	// 随机生成一个常见的中文姓名。
+	cname: function() {
+		return this.cfirst() + this.clast()
+	}
+}

文件差異過大導致無法顯示
+ 121 - 0
node_modules/.1.0.1-beta3@mockjs/src/mock/random/text.js


文件差異過大導致無法顯示
+ 76 - 0
node_modules/.1.0.1-beta3@mockjs/src/mock/random/web.js


+ 392 - 0
node_modules/.1.0.1-beta3@mockjs/src/mock/regexp/handler.js

@@ -0,0 +1,392 @@
+/*
+    ## RegExp Handler
+
+    https://github.com/ForbesLindesay/regexp
+    https://github.com/dmajda/pegjs
+    http://www.regexper.com/
+
+    每个节点的结构
+        {
+            type: '',
+            offset: number,
+            text: '',
+            body: {},
+            escaped: true/false
+        }
+
+    type 可选值
+        alternate             |         选择
+        match                 匹配
+        capture-group         ()        捕获组
+        non-capture-group     (?:...)   非捕获组
+        positive-lookahead    (?=p)     零宽正向先行断言
+        negative-lookahead    (?!p)     零宽负向先行断言
+        quantified            a*        重复节点
+        quantifier            *         量词
+        charset               []        字符集
+        range                 {m, n}    范围
+        literal               a         直接量字符
+        unicode               \uxxxx    Unicode
+        hex                   \x        十六进制
+        octal                 八进制
+        back-reference        \n        反向引用
+        control-character     \cX       控制字符
+
+        // Token
+        start               ^       开头
+        end                 $       结尾
+        any-character       .       任意字符
+        backspace           [\b]    退格直接量
+        word-boundary       \b      单词边界
+        non-word-boundary   \B      非单词边界
+        digit               \d      ASCII 数字,[0-9]
+        non-digit           \D      非 ASCII 数字,[^0-9]
+        form-feed           \f      换页符
+        line-feed           \n      换行符
+        carriage-return     \r      回车符
+        white-space         \s      空白符
+        non-white-space     \S      非空白符
+        tab                 \t      制表符
+        vertical-tab        \v      垂直制表符
+        word                \w      ASCII 字符,[a-zA-Z0-9]
+        non-word            \W      非 ASCII 字符,[^a-zA-Z0-9]
+        null-character      \o      NUL 字符
+ */
+
+var Util = require('../util')
+var Random = require('../random/')
+    /*
+        
+    */
+var Handler = {
+    extend: Util.extend
+}
+
+// http://en.wikipedia.org/wiki/ASCII#ASCII_printable_code_chart
+/*var ASCII_CONTROL_CODE_CHART = {
+    '@': ['\u0000'],
+    A: ['\u0001'],
+    B: ['\u0002'],
+    C: ['\u0003'],
+    D: ['\u0004'],
+    E: ['\u0005'],
+    F: ['\u0006'],
+    G: ['\u0007', '\a'],
+    H: ['\u0008', '\b'],
+    I: ['\u0009', '\t'],
+    J: ['\u000A', '\n'],
+    K: ['\u000B', '\v'],
+    L: ['\u000C', '\f'],
+    M: ['\u000D', '\r'],
+    N: ['\u000E'],
+    O: ['\u000F'],
+    P: ['\u0010'],
+    Q: ['\u0011'],
+    R: ['\u0012'],
+    S: ['\u0013'],
+    T: ['\u0014'],
+    U: ['\u0015'],
+    V: ['\u0016'],
+    W: ['\u0017'],
+    X: ['\u0018'],
+    Y: ['\u0019'],
+    Z: ['\u001A'],
+    '[': ['\u001B', '\e'],
+    '\\': ['\u001C'],
+    ']': ['\u001D'],
+    '^': ['\u001E'],
+    '_': ['\u001F']
+}*/
+
+// ASCII printable code chart
+// var LOWER = 'abcdefghijklmnopqrstuvwxyz'
+// var UPPER = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+// var NUMBER = '0123456789'
+// var SYMBOL = ' !"#$%&\'()*+,-./' + ':;<=>?@' + '[\\]^_`' + '{|}~'
+var LOWER = ascii(97, 122)
+var UPPER = ascii(65, 90)
+var NUMBER = ascii(48, 57)
+var OTHER = ascii(32, 47) + ascii(58, 64) + ascii(91, 96) + ascii(123, 126) // 排除 95 _ ascii(91, 94) + ascii(96, 96)
+var PRINTABLE = ascii(32, 126)
+var SPACE = ' \f\n\r\t\v\u00A0\u2028\u2029'
+var CHARACTER_CLASSES = {
+    '\\w': LOWER + UPPER + NUMBER + '_', // ascii(95, 95)
+    '\\W': OTHER.replace('_', ''),
+    '\\s': SPACE,
+    '\\S': function() {
+        var result = PRINTABLE
+        for (var i = 0; i < SPACE.length; i++) {
+            result = result.replace(SPACE[i], '')
+        }
+        return result
+    }(),
+    '\\d': NUMBER,
+    '\\D': LOWER + UPPER + OTHER
+}
+
+function ascii(from, to) {
+    var result = ''
+    for (var i = from; i <= to; i++) {
+        result += String.fromCharCode(i)
+    }
+    return result
+}
+
+// var ast = RegExpParser.parse(regexp.source)
+Handler.gen = function(node, result, cache) {
+    cache = cache || {
+        guid: 1
+    }
+    return Handler[node.type] ? Handler[node.type](node, result, cache) :
+        Handler.token(node, result, cache)
+}
+
+Handler.extend({
+    /* jshint unused:false */
+    token: function(node, result, cache) {
+        switch (node.type) {
+            case 'start':
+            case 'end':
+                return ''
+            case 'any-character':
+                return Random.character()
+            case 'backspace':
+                return ''
+            case 'word-boundary': // TODO
+                return ''
+            case 'non-word-boundary': // TODO
+                break
+            case 'digit':
+                return Random.pick(
+                    NUMBER.split('')
+                )
+            case 'non-digit':
+                return Random.pick(
+                    (LOWER + UPPER + OTHER).split('')
+                )
+            case 'form-feed':
+                break
+            case 'line-feed':
+                return node.body || node.text
+            case 'carriage-return':
+                break
+            case 'white-space':
+                return Random.pick(
+                    SPACE.split('')
+                )
+            case 'non-white-space':
+                return Random.pick(
+                    (LOWER + UPPER + NUMBER).split('')
+                )
+            case 'tab':
+                break
+            case 'vertical-tab':
+                break
+            case 'word': // \w [a-zA-Z0-9]
+                return Random.pick(
+                    (LOWER + UPPER + NUMBER).split('')
+                )
+            case 'non-word': // \W [^a-zA-Z0-9]
+                return Random.pick(
+                    OTHER.replace('_', '').split('')
+                )
+            case 'null-character':
+                break
+        }
+        return node.body || node.text
+    },
+    /*
+        {
+            type: 'alternate',
+            offset: 0,
+            text: '',
+            left: {
+                boyd: []
+            },
+            right: {
+                boyd: []
+            }
+        }
+    */
+    alternate: function(node, result, cache) {
+        // node.left/right {}
+        return this.gen(
+            Random.boolean() ? node.left : node.right,
+            result,
+            cache
+        )
+    },
+    /*
+        {
+            type: 'match',
+            offset: 0,
+            text: '',
+            body: []
+        }
+    */
+    match: function(node, result, cache) {
+        result = ''
+            // node.body []
+        for (var i = 0; i < node.body.length; i++) {
+            result += this.gen(node.body[i], result, cache)
+        }
+        return result
+    },
+    // ()
+    'capture-group': function(node, result, cache) {
+        // node.body {}
+        result = this.gen(node.body, result, cache)
+        cache[cache.guid++] = result
+        return result
+    },
+    // (?:...)
+    'non-capture-group': function(node, result, cache) {
+        // node.body {}
+        return this.gen(node.body, result, cache)
+    },
+    // (?=p)
+    'positive-lookahead': function(node, result, cache) {
+        // node.body
+        return this.gen(node.body, result, cache)
+    },
+    // (?!p)
+    'negative-lookahead': function(node, result, cache) {
+        // node.body
+        return ''
+    },
+    /*
+        {
+            type: 'quantified',
+            offset: 3,
+            text: 'c*',
+            body: {
+                type: 'literal',
+                offset: 3,
+                text: 'c',
+                body: 'c',
+                escaped: false
+            },
+            quantifier: {
+                type: 'quantifier',
+                offset: 4,
+                text: '*',
+                min: 0,
+                max: Infinity,
+                greedy: true
+            }
+        }
+    */
+    quantified: function(node, result, cache) {
+        result = ''
+            // node.quantifier {}
+        var count = this.quantifier(node.quantifier);
+        // node.body {}
+        for (var i = 0; i < count; i++) {
+            result += this.gen(node.body, result, cache)
+        }
+        return result
+    },
+    /*
+        quantifier: {
+            type: 'quantifier',
+            offset: 4,
+            text: '*',
+            min: 0,
+            max: Infinity,
+            greedy: true
+        }
+    */
+    quantifier: function(node, result, cache) {
+        var min = Math.max(node.min, 0)
+        var max = isFinite(node.max) ? node.max :
+            min + Random.integer(3, 7)
+        return Random.integer(min, max)
+    },
+    /*
+        
+    */
+    charset: function(node, result, cache) {
+        // node.invert
+        if (node.invert) return this['invert-charset'](node, result, cache)
+
+        // node.body []
+        var literal = Random.pick(node.body)
+        return this.gen(literal, result, cache)
+    },
+    'invert-charset': function(node, result, cache) {
+        var pool = PRINTABLE
+        for (var i = 0, item; i < node.body.length; i++) {
+            item = node.body[i]
+            switch (item.type) {
+                case 'literal':
+                    pool = pool.replace(item.body, '')
+                    break
+                case 'range':
+                    var min = this.gen(item.start, result, cache).charCodeAt()
+                    var max = this.gen(item.end, result, cache).charCodeAt()
+                    for (var ii = min; ii <= max; ii++) {
+                        pool = pool.replace(String.fromCharCode(ii), '')
+                    }
+                    /* falls through */
+                default:
+                    var characters = CHARACTER_CLASSES[item.text]
+                    if (characters) {
+                        for (var iii = 0; iii <= characters.length; iii++) {
+                            pool = pool.replace(characters[iii], '')
+                        }
+                    }
+            }
+        }
+        return Random.pick(pool.split(''))
+    },
+    range: function(node, result, cache) {
+        // node.start, node.end
+        var min = this.gen(node.start, result, cache).charCodeAt()
+        var max = this.gen(node.end, result, cache).charCodeAt()
+        return String.fromCharCode(
+            Random.integer(min, max)
+        )
+    },
+    literal: function(node, result, cache) {
+        return node.escaped ? node.body : node.text
+    },
+    // Unicode \u
+    unicode: function(node, result, cache) {
+        return String.fromCharCode(
+            parseInt(node.code, 16)
+        )
+    },
+    // 十六进制 \xFF
+    hex: function(node, result, cache) {
+        return String.fromCharCode(
+            parseInt(node.code, 16)
+        )
+    },
+    // 八进制 \0
+    octal: function(node, result, cache) {
+        return String.fromCharCode(
+            parseInt(node.code, 8)
+        )
+    },
+    // 反向引用
+    'back-reference': function(node, result, cache) {
+        return cache[node.code] || ''
+    },
+    /*
+        http://en.wikipedia.org/wiki/C0_and_C1_control_codes
+    */
+    CONTROL_CHARACTER_MAP: function() {
+        var CONTROL_CHARACTER = '@ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \\ ] ^ _'.split(' ')
+        var CONTROL_CHARACTER_UNICODE = '\u0000 \u0001 \u0002 \u0003 \u0004 \u0005 \u0006 \u0007 \u0008 \u0009 \u000A \u000B \u000C \u000D \u000E \u000F \u0010 \u0011 \u0012 \u0013 \u0014 \u0015 \u0016 \u0017 \u0018 \u0019 \u001A \u001B \u001C \u001D \u001E \u001F'.split(' ')
+        var map = {}
+        for (var i = 0; i < CONTROL_CHARACTER.length; i++) {
+            map[CONTROL_CHARACTER[i]] = CONTROL_CHARACTER_UNICODE[i]
+        }
+        return map
+    }(),
+    'control-character': function(node, result, cache) {
+        return this.CONTROL_CHARACTER_MAP[node.code]
+    }
+})
+
+module.exports = Handler

+ 6 - 0
node_modules/.1.0.1-beta3@mockjs/src/mock/regexp/index.js

@@ -0,0 +1,6 @@
+var Parser = require('./parser')
+var Handler = require('./handler')
+module.exports = {
+	Parser: Parser,
+	Handler: Handler
+}

+ 570 - 0
node_modules/.1.0.1-beta3@mockjs/src/mock/regexp/parser.js

@@ -0,0 +1,570 @@
+// https://github.com/nuysoft/regexp
+// forked from https://github.com/ForbesLindesay/regexp
+
+function parse(n) {
+    if ("string" != typeof n) {
+        var l = new TypeError("The regexp to parse must be represented as a string.");
+        throw l;
+    }
+    return index = 1, cgs = {}, parser.parse(n);
+}
+
+function Token(n) {
+    this.type = n, this.offset = Token.offset(), this.text = Token.text();
+}
+
+function Alternate(n, l) {
+    Token.call(this, "alternate"), this.left = n, this.right = l;
+}
+
+function Match(n) {
+    Token.call(this, "match"), this.body = n.filter(Boolean);
+}
+
+function Group(n, l) {
+    Token.call(this, n), this.body = l;
+}
+
+function CaptureGroup(n) {
+    Group.call(this, "capture-group"), this.index = cgs[this.offset] || (cgs[this.offset] = index++), 
+    this.body = n;
+}
+
+function Quantified(n, l) {
+    Token.call(this, "quantified"), this.body = n, this.quantifier = l;
+}
+
+function Quantifier(n, l) {
+    Token.call(this, "quantifier"), this.min = n, this.max = l, this.greedy = !0;
+}
+
+function CharSet(n, l) {
+    Token.call(this, "charset"), this.invert = n, this.body = l;
+}
+
+function CharacterRange(n, l) {
+    Token.call(this, "range"), this.start = n, this.end = l;
+}
+
+function Literal(n) {
+    Token.call(this, "literal"), this.body = n, this.escaped = this.body != this.text;
+}
+
+function Unicode(n) {
+    Token.call(this, "unicode"), this.code = n.toUpperCase();
+}
+
+function Hex(n) {
+    Token.call(this, "hex"), this.code = n.toUpperCase();
+}
+
+function Octal(n) {
+    Token.call(this, "octal"), this.code = n.toUpperCase();
+}
+
+function BackReference(n) {
+    Token.call(this, "back-reference"), this.code = n.toUpperCase();
+}
+
+function ControlCharacter(n) {
+    Token.call(this, "control-character"), this.code = n.toUpperCase();
+}
+
+var parser = function() {
+    function n(n, l) {
+        function u() {
+            this.constructor = n;
+        }
+        u.prototype = l.prototype, n.prototype = new u();
+    }
+    function l(n, l, u, t, r) {
+        function e(n, l) {
+            function u(n) {
+                function l(n) {
+                    return n.charCodeAt(0).toString(16).toUpperCase();
+                }
+                return n.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\x08/g, "\\b").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\f/g, "\\f").replace(/\r/g, "\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g, function(n) {
+                    return "\\x0" + l(n);
+                }).replace(/[\x10-\x1F\x80-\xFF]/g, function(n) {
+                    return "\\x" + l(n);
+                }).replace(/[\u0180-\u0FFF]/g, function(n) {
+                    return "\\u0" + l(n);
+                }).replace(/[\u1080-\uFFFF]/g, function(n) {
+                    return "\\u" + l(n);
+                });
+            }
+            var t, r;
+            switch (n.length) {
+              case 0:
+                t = "end of input";
+                break;
+
+              case 1:
+                t = n[0];
+                break;
+
+              default:
+                t = n.slice(0, -1).join(", ") + " or " + n[n.length - 1];
+            }
+            return r = l ? '"' + u(l) + '"' : "end of input", "Expected " + t + " but " + r + " found.";
+        }
+        this.expected = n, this.found = l, this.offset = u, this.line = t, this.column = r, 
+        this.name = "SyntaxError", this.message = e(n, l);
+    }
+    function u(n) {
+        function u() {
+            return n.substring(Lt, qt);
+        }
+        function t() {
+            return Lt;
+        }
+        function r(l) {
+            function u(l, u, t) {
+                var r, e;
+                for (r = u; t > r; r++) e = n.charAt(r), "\n" === e ? (l.seenCR || l.line++, l.column = 1, 
+                l.seenCR = !1) : "\r" === e || "\u2028" === e || "\u2029" === e ? (l.line++, l.column = 1, 
+                l.seenCR = !0) : (l.column++, l.seenCR = !1);
+            }
+            return Mt !== l && (Mt > l && (Mt = 0, Dt = {
+                line: 1,
+                column: 1,
+                seenCR: !1
+            }), u(Dt, Mt, l), Mt = l), Dt;
+        }
+        function e(n) {
+            Ht > qt || (qt > Ht && (Ht = qt, Ot = []), Ot.push(n));
+        }
+        function o(n) {
+            var l = 0;
+            for (n.sort(); l < n.length; ) n[l - 1] === n[l] ? n.splice(l, 1) : l++;
+        }
+        function c() {
+            var l, u, t, r, o;
+            return l = qt, u = i(), null !== u ? (t = qt, 124 === n.charCodeAt(qt) ? (r = fl, 
+            qt++) : (r = null, 0 === Wt && e(sl)), null !== r ? (o = c(), null !== o ? (r = [ r, o ], 
+            t = r) : (qt = t, t = il)) : (qt = t, t = il), null === t && (t = al), null !== t ? (Lt = l, 
+            u = hl(u, t), null === u ? (qt = l, l = u) : l = u) : (qt = l, l = il)) : (qt = l, 
+            l = il), l;
+        }
+        function i() {
+            var n, l, u, t, r;
+            if (n = qt, l = f(), null === l && (l = al), null !== l) if (u = qt, Wt++, t = d(), 
+            Wt--, null === t ? u = al : (qt = u, u = il), null !== u) {
+                for (t = [], r = h(), null === r && (r = a()); null !== r; ) t.push(r), r = h(), 
+                null === r && (r = a());
+                null !== t ? (r = s(), null === r && (r = al), null !== r ? (Lt = n, l = dl(l, t, r), 
+                null === l ? (qt = n, n = l) : n = l) : (qt = n, n = il)) : (qt = n, n = il);
+            } else qt = n, n = il; else qt = n, n = il;
+            return n;
+        }
+        function a() {
+            var n;
+            return n = x(), null === n && (n = Q(), null === n && (n = B())), n;
+        }
+        function f() {
+            var l, u;
+            return l = qt, 94 === n.charCodeAt(qt) ? (u = pl, qt++) : (u = null, 0 === Wt && e(vl)), 
+            null !== u && (Lt = l, u = wl()), null === u ? (qt = l, l = u) : l = u, l;
+        }
+        function s() {
+            var l, u;
+            return l = qt, 36 === n.charCodeAt(qt) ? (u = Al, qt++) : (u = null, 0 === Wt && e(Cl)), 
+            null !== u && (Lt = l, u = gl()), null === u ? (qt = l, l = u) : l = u, l;
+        }
+        function h() {
+            var n, l, u;
+            return n = qt, l = a(), null !== l ? (u = d(), null !== u ? (Lt = n, l = bl(l, u), 
+            null === l ? (qt = n, n = l) : n = l) : (qt = n, n = il)) : (qt = n, n = il), n;
+        }
+        function d() {
+            var n, l, u;
+            return Wt++, n = qt, l = p(), null !== l ? (u = k(), null === u && (u = al), null !== u ? (Lt = n, 
+            l = Tl(l, u), null === l ? (qt = n, n = l) : n = l) : (qt = n, n = il)) : (qt = n, 
+            n = il), Wt--, null === n && (l = null, 0 === Wt && e(kl)), n;
+        }
+        function p() {
+            var n;
+            return n = v(), null === n && (n = w(), null === n && (n = A(), null === n && (n = C(), 
+            null === n && (n = g(), null === n && (n = b()))))), n;
+        }
+        function v() {
+            var l, u, t, r, o, c;
+            return l = qt, 123 === n.charCodeAt(qt) ? (u = xl, qt++) : (u = null, 0 === Wt && e(yl)), 
+            null !== u ? (t = T(), null !== t ? (44 === n.charCodeAt(qt) ? (r = ml, qt++) : (r = null, 
+            0 === Wt && e(Rl)), null !== r ? (o = T(), null !== o ? (125 === n.charCodeAt(qt) ? (c = Fl, 
+            qt++) : (c = null, 0 === Wt && e(Ql)), null !== c ? (Lt = l, u = Sl(t, o), null === u ? (qt = l, 
+            l = u) : l = u) : (qt = l, l = il)) : (qt = l, l = il)) : (qt = l, l = il)) : (qt = l, 
+            l = il)) : (qt = l, l = il), l;
+        }
+        function w() {
+            var l, u, t, r;
+            return l = qt, 123 === n.charCodeAt(qt) ? (u = xl, qt++) : (u = null, 0 === Wt && e(yl)), 
+            null !== u ? (t = T(), null !== t ? (n.substr(qt, 2) === Ul ? (r = Ul, qt += 2) : (r = null, 
+            0 === Wt && e(El)), null !== r ? (Lt = l, u = Gl(t), null === u ? (qt = l, l = u) : l = u) : (qt = l, 
+            l = il)) : (qt = l, l = il)) : (qt = l, l = il), l;
+        }
+        function A() {
+            var l, u, t, r;
+            return l = qt, 123 === n.charCodeAt(qt) ? (u = xl, qt++) : (u = null, 0 === Wt && e(yl)), 
+            null !== u ? (t = T(), null !== t ? (125 === n.charCodeAt(qt) ? (r = Fl, qt++) : (r = null, 
+            0 === Wt && e(Ql)), null !== r ? (Lt = l, u = Bl(t), null === u ? (qt = l, l = u) : l = u) : (qt = l, 
+            l = il)) : (qt = l, l = il)) : (qt = l, l = il), l;
+        }
+        function C() {
+            var l, u;
+            return l = qt, 43 === n.charCodeAt(qt) ? (u = jl, qt++) : (u = null, 0 === Wt && e($l)), 
+            null !== u && (Lt = l, u = ql()), null === u ? (qt = l, l = u) : l = u, l;
+        }
+        function g() {
+            var l, u;
+            return l = qt, 42 === n.charCodeAt(qt) ? (u = Ll, qt++) : (u = null, 0 === Wt && e(Ml)), 
+            null !== u && (Lt = l, u = Dl()), null === u ? (qt = l, l = u) : l = u, l;
+        }
+        function b() {
+            var l, u;
+            return l = qt, 63 === n.charCodeAt(qt) ? (u = Hl, qt++) : (u = null, 0 === Wt && e(Ol)), 
+            null !== u && (Lt = l, u = Wl()), null === u ? (qt = l, l = u) : l = u, l;
+        }
+        function k() {
+            var l;
+            return 63 === n.charCodeAt(qt) ? (l = Hl, qt++) : (l = null, 0 === Wt && e(Ol)), 
+            l;
+        }
+        function T() {
+            var l, u, t;
+            if (l = qt, u = [], zl.test(n.charAt(qt)) ? (t = n.charAt(qt), qt++) : (t = null, 
+            0 === Wt && e(Il)), null !== t) for (;null !== t; ) u.push(t), zl.test(n.charAt(qt)) ? (t = n.charAt(qt), 
+            qt++) : (t = null, 0 === Wt && e(Il)); else u = il;
+            return null !== u && (Lt = l, u = Jl(u)), null === u ? (qt = l, l = u) : l = u, 
+            l;
+        }
+        function x() {
+            var l, u, t, r;
+            return l = qt, 40 === n.charCodeAt(qt) ? (u = Kl, qt++) : (u = null, 0 === Wt && e(Nl)), 
+            null !== u ? (t = R(), null === t && (t = F(), null === t && (t = m(), null === t && (t = y()))), 
+            null !== t ? (41 === n.charCodeAt(qt) ? (r = Pl, qt++) : (r = null, 0 === Wt && e(Vl)), 
+            null !== r ? (Lt = l, u = Xl(t), null === u ? (qt = l, l = u) : l = u) : (qt = l, 
+            l = il)) : (qt = l, l = il)) : (qt = l, l = il), l;
+        }
+        function y() {
+            var n, l;
+            return n = qt, l = c(), null !== l && (Lt = n, l = Yl(l)), null === l ? (qt = n, 
+            n = l) : n = l, n;
+        }
+        function m() {
+            var l, u, t;
+            return l = qt, n.substr(qt, 2) === Zl ? (u = Zl, qt += 2) : (u = null, 0 === Wt && e(_l)), 
+            null !== u ? (t = c(), null !== t ? (Lt = l, u = nu(t), null === u ? (qt = l, l = u) : l = u) : (qt = l, 
+            l = il)) : (qt = l, l = il), l;
+        }
+        function R() {
+            var l, u, t;
+            return l = qt, n.substr(qt, 2) === lu ? (u = lu, qt += 2) : (u = null, 0 === Wt && e(uu)), 
+            null !== u ? (t = c(), null !== t ? (Lt = l, u = tu(t), null === u ? (qt = l, l = u) : l = u) : (qt = l, 
+            l = il)) : (qt = l, l = il), l;
+        }
+        function F() {
+            var l, u, t;
+            return l = qt, n.substr(qt, 2) === ru ? (u = ru, qt += 2) : (u = null, 0 === Wt && e(eu)), 
+            null !== u ? (t = c(), null !== t ? (Lt = l, u = ou(t), null === u ? (qt = l, l = u) : l = u) : (qt = l, 
+            l = il)) : (qt = l, l = il), l;
+        }
+        function Q() {
+            var l, u, t, r, o;
+            if (Wt++, l = qt, 91 === n.charCodeAt(qt) ? (u = iu, qt++) : (u = null, 0 === Wt && e(au)), 
+            null !== u) if (94 === n.charCodeAt(qt) ? (t = pl, qt++) : (t = null, 0 === Wt && e(vl)), 
+            null === t && (t = al), null !== t) {
+                for (r = [], o = S(), null === o && (o = U()); null !== o; ) r.push(o), o = S(), 
+                null === o && (o = U());
+                null !== r ? (93 === n.charCodeAt(qt) ? (o = fu, qt++) : (o = null, 0 === Wt && e(su)), 
+                null !== o ? (Lt = l, u = hu(t, r), null === u ? (qt = l, l = u) : l = u) : (qt = l, 
+                l = il)) : (qt = l, l = il);
+            } else qt = l, l = il; else qt = l, l = il;
+            return Wt--, null === l && (u = null, 0 === Wt && e(cu)), l;
+        }
+        function S() {
+            var l, u, t, r;
+            return Wt++, l = qt, u = U(), null !== u ? (45 === n.charCodeAt(qt) ? (t = pu, qt++) : (t = null, 
+            0 === Wt && e(vu)), null !== t ? (r = U(), null !== r ? (Lt = l, u = wu(u, r), null === u ? (qt = l, 
+            l = u) : l = u) : (qt = l, l = il)) : (qt = l, l = il)) : (qt = l, l = il), Wt--, 
+            null === l && (u = null, 0 === Wt && e(du)), l;
+        }
+        function U() {
+            var n, l;
+            return Wt++, n = G(), null === n && (n = E()), Wt--, null === n && (l = null, 0 === Wt && e(Au)), 
+            n;
+        }
+        function E() {
+            var l, u;
+            return l = qt, Cu.test(n.charAt(qt)) ? (u = n.charAt(qt), qt++) : (u = null, 0 === Wt && e(gu)), 
+            null !== u && (Lt = l, u = bu(u)), null === u ? (qt = l, l = u) : l = u, l;
+        }
+        function G() {
+            var n;
+            return n = L(), null === n && (n = Y(), null === n && (n = H(), null === n && (n = O(), 
+            null === n && (n = W(), null === n && (n = z(), null === n && (n = I(), null === n && (n = J(), 
+            null === n && (n = K(), null === n && (n = N(), null === n && (n = P(), null === n && (n = V(), 
+            null === n && (n = X(), null === n && (n = _(), null === n && (n = nl(), null === n && (n = ll(), 
+            null === n && (n = ul(), null === n && (n = tl()))))))))))))))))), n;
+        }
+        function B() {
+            var n;
+            return n = j(), null === n && (n = q(), null === n && (n = $())), n;
+        }
+        function j() {
+            var l, u;
+            return l = qt, 46 === n.charCodeAt(qt) ? (u = ku, qt++) : (u = null, 0 === Wt && e(Tu)), 
+            null !== u && (Lt = l, u = xu()), null === u ? (qt = l, l = u) : l = u, l;
+        }
+        function $() {
+            var l, u;
+            return Wt++, l = qt, mu.test(n.charAt(qt)) ? (u = n.charAt(qt), qt++) : (u = null, 
+            0 === Wt && e(Ru)), null !== u && (Lt = l, u = bu(u)), null === u ? (qt = l, l = u) : l = u, 
+            Wt--, null === l && (u = null, 0 === Wt && e(yu)), l;
+        }
+        function q() {
+            var n;
+            return n = M(), null === n && (n = D(), null === n && (n = Y(), null === n && (n = H(), 
+            null === n && (n = O(), null === n && (n = W(), null === n && (n = z(), null === n && (n = I(), 
+            null === n && (n = J(), null === n && (n = K(), null === n && (n = N(), null === n && (n = P(), 
+            null === n && (n = V(), null === n && (n = X(), null === n && (n = Z(), null === n && (n = _(), 
+            null === n && (n = nl(), null === n && (n = ll(), null === n && (n = ul(), null === n && (n = tl()))))))))))))))))))), 
+            n;
+        }
+        function L() {
+            var l, u;
+            return l = qt, n.substr(qt, 2) === Fu ? (u = Fu, qt += 2) : (u = null, 0 === Wt && e(Qu)), 
+            null !== u && (Lt = l, u = Su()), null === u ? (qt = l, l = u) : l = u, l;
+        }
+        function M() {
+            var l, u;
+            return l = qt, n.substr(qt, 2) === Fu ? (u = Fu, qt += 2) : (u = null, 0 === Wt && e(Qu)), 
+            null !== u && (Lt = l, u = Uu()), null === u ? (qt = l, l = u) : l = u, l;
+        }
+        function D() {
+            var l, u;
+            return l = qt, n.substr(qt, 2) === Eu ? (u = Eu, qt += 2) : (u = null, 0 === Wt && e(Gu)), 
+            null !== u && (Lt = l, u = Bu()), null === u ? (qt = l, l = u) : l = u, l;
+        }
+        function H() {
+            var l, u;
+            return l = qt, n.substr(qt, 2) === ju ? (u = ju, qt += 2) : (u = null, 0 === Wt && e($u)), 
+            null !== u && (Lt = l, u = qu()), null === u ? (qt = l, l = u) : l = u, l;
+        }
+        function O() {
+            var l, u;
+            return l = qt, n.substr(qt, 2) === Lu ? (u = Lu, qt += 2) : (u = null, 0 === Wt && e(Mu)), 
+            null !== u && (Lt = l, u = Du()), null === u ? (qt = l, l = u) : l = u, l;
+        }
+        function W() {
+            var l, u;
+            return l = qt, n.substr(qt, 2) === Hu ? (u = Hu, qt += 2) : (u = null, 0 === Wt && e(Ou)), 
+            null !== u && (Lt = l, u = Wu()), null === u ? (qt = l, l = u) : l = u, l;
+        }
+        function z() {
+            var l, u;
+            return l = qt, n.substr(qt, 2) === zu ? (u = zu, qt += 2) : (u = null, 0 === Wt && e(Iu)), 
+            null !== u && (Lt = l, u = Ju()), null === u ? (qt = l, l = u) : l = u, l;
+        }
+        function I() {
+            var l, u;
+            return l = qt, n.substr(qt, 2) === Ku ? (u = Ku, qt += 2) : (u = null, 0 === Wt && e(Nu)), 
+            null !== u && (Lt = l, u = Pu()), null === u ? (qt = l, l = u) : l = u, l;
+        }
+        function J() {
+            var l, u;
+            return l = qt, n.substr(qt, 2) === Vu ? (u = Vu, qt += 2) : (u = null, 0 === Wt && e(Xu)), 
+            null !== u && (Lt = l, u = Yu()), null === u ? (qt = l, l = u) : l = u, l;
+        }
+        function K() {
+            var l, u;
+            return l = qt, n.substr(qt, 2) === Zu ? (u = Zu, qt += 2) : (u = null, 0 === Wt && e(_u)), 
+            null !== u && (Lt = l, u = nt()), null === u ? (qt = l, l = u) : l = u, l;
+        }
+        function N() {
+            var l, u;
+            return l = qt, n.substr(qt, 2) === lt ? (u = lt, qt += 2) : (u = null, 0 === Wt && e(ut)), 
+            null !== u && (Lt = l, u = tt()), null === u ? (qt = l, l = u) : l = u, l;
+        }
+        function P() {
+            var l, u;
+            return l = qt, n.substr(qt, 2) === rt ? (u = rt, qt += 2) : (u = null, 0 === Wt && e(et)), 
+            null !== u && (Lt = l, u = ot()), null === u ? (qt = l, l = u) : l = u, l;
+        }
+        function V() {
+            var l, u;
+            return l = qt, n.substr(qt, 2) === ct ? (u = ct, qt += 2) : (u = null, 0 === Wt && e(it)), 
+            null !== u && (Lt = l, u = at()), null === u ? (qt = l, l = u) : l = u, l;
+        }
+        function X() {
+            var l, u;
+            return l = qt, n.substr(qt, 2) === ft ? (u = ft, qt += 2) : (u = null, 0 === Wt && e(st)), 
+            null !== u && (Lt = l, u = ht()), null === u ? (qt = l, l = u) : l = u, l;
+        }
+        function Y() {
+            var l, u, t;
+            return l = qt, n.substr(qt, 2) === dt ? (u = dt, qt += 2) : (u = null, 0 === Wt && e(pt)), 
+            null !== u ? (n.length > qt ? (t = n.charAt(qt), qt++) : (t = null, 0 === Wt && e(vt)), 
+            null !== t ? (Lt = l, u = wt(t), null === u ? (qt = l, l = u) : l = u) : (qt = l, 
+            l = il)) : (qt = l, l = il), l;
+        }
+        function Z() {
+            var l, u, t;
+            return l = qt, 92 === n.charCodeAt(qt) ? (u = At, qt++) : (u = null, 0 === Wt && e(Ct)), 
+            null !== u ? (gt.test(n.charAt(qt)) ? (t = n.charAt(qt), qt++) : (t = null, 0 === Wt && e(bt)), 
+            null !== t ? (Lt = l, u = kt(t), null === u ? (qt = l, l = u) : l = u) : (qt = l, 
+            l = il)) : (qt = l, l = il), l;
+        }
+        function _() {
+            var l, u, t, r;
+            if (l = qt, n.substr(qt, 2) === Tt ? (u = Tt, qt += 2) : (u = null, 0 === Wt && e(xt)), 
+            null !== u) {
+                if (t = [], yt.test(n.charAt(qt)) ? (r = n.charAt(qt), qt++) : (r = null, 0 === Wt && e(mt)), 
+                null !== r) for (;null !== r; ) t.push(r), yt.test(n.charAt(qt)) ? (r = n.charAt(qt), 
+                qt++) : (r = null, 0 === Wt && e(mt)); else t = il;
+                null !== t ? (Lt = l, u = Rt(t), null === u ? (qt = l, l = u) : l = u) : (qt = l, 
+                l = il);
+            } else qt = l, l = il;
+            return l;
+        }
+        function nl() {
+            var l, u, t, r;
+            if (l = qt, n.substr(qt, 2) === Ft ? (u = Ft, qt += 2) : (u = null, 0 === Wt && e(Qt)), 
+            null !== u) {
+                if (t = [], St.test(n.charAt(qt)) ? (r = n.charAt(qt), qt++) : (r = null, 0 === Wt && e(Ut)), 
+                null !== r) for (;null !== r; ) t.push(r), St.test(n.charAt(qt)) ? (r = n.charAt(qt), 
+                qt++) : (r = null, 0 === Wt && e(Ut)); else t = il;
+                null !== t ? (Lt = l, u = Et(t), null === u ? (qt = l, l = u) : l = u) : (qt = l, 
+                l = il);
+            } else qt = l, l = il;
+            return l;
+        }
+        function ll() {
+            var l, u, t, r;
+            if (l = qt, n.substr(qt, 2) === Gt ? (u = Gt, qt += 2) : (u = null, 0 === Wt && e(Bt)), 
+            null !== u) {
+                if (t = [], St.test(n.charAt(qt)) ? (r = n.charAt(qt), qt++) : (r = null, 0 === Wt && e(Ut)), 
+                null !== r) for (;null !== r; ) t.push(r), St.test(n.charAt(qt)) ? (r = n.charAt(qt), 
+                qt++) : (r = null, 0 === Wt && e(Ut)); else t = il;
+                null !== t ? (Lt = l, u = jt(t), null === u ? (qt = l, l = u) : l = u) : (qt = l, 
+                l = il);
+            } else qt = l, l = il;
+            return l;
+        }
+        function ul() {
+            var l, u;
+            return l = qt, n.substr(qt, 2) === Tt ? (u = Tt, qt += 2) : (u = null, 0 === Wt && e(xt)), 
+            null !== u && (Lt = l, u = $t()), null === u ? (qt = l, l = u) : l = u, l;
+        }
+        function tl() {
+            var l, u, t;
+            return l = qt, 92 === n.charCodeAt(qt) ? (u = At, qt++) : (u = null, 0 === Wt && e(Ct)), 
+            null !== u ? (n.length > qt ? (t = n.charAt(qt), qt++) : (t = null, 0 === Wt && e(vt)), 
+            null !== t ? (Lt = l, u = bu(t), null === u ? (qt = l, l = u) : l = u) : (qt = l, 
+            l = il)) : (qt = l, l = il), l;
+        }
+        var rl, el = arguments.length > 1 ? arguments[1] : {}, ol = {
+            regexp: c
+        }, cl = c, il = null, al = "", fl = "|", sl = '"|"', hl = function(n, l) {
+            return l ? new Alternate(n, l[1]) : n;
+        }, dl = function(n, l, u) {
+            return new Match([ n ].concat(l).concat([ u ]));
+        }, pl = "^", vl = '"^"', wl = function() {
+            return new Token("start");
+        }, Al = "$", Cl = '"$"', gl = function() {
+            return new Token("end");
+        }, bl = function(n, l) {
+            return new Quantified(n, l);
+        }, kl = "Quantifier", Tl = function(n, l) {
+            return l && (n.greedy = !1), n;
+        }, xl = "{", yl = '"{"', ml = ",", Rl = '","', Fl = "}", Ql = '"}"', Sl = function(n, l) {
+            return new Quantifier(n, l);
+        }, Ul = ",}", El = '",}"', Gl = function(n) {
+            return new Quantifier(n, 1/0);
+        }, Bl = function(n) {
+            return new Quantifier(n, n);
+        }, jl = "+", $l = '"+"', ql = function() {
+            return new Quantifier(1, 1/0);
+        }, Ll = "*", Ml = '"*"', Dl = function() {
+            return new Quantifier(0, 1/0);
+        }, Hl = "?", Ol = '"?"', Wl = function() {
+            return new Quantifier(0, 1);
+        }, zl = /^[0-9]/, Il = "[0-9]", Jl = function(n) {
+            return +n.join("");
+        }, Kl = "(", Nl = '"("', Pl = ")", Vl = '")"', Xl = function(n) {
+            return n;
+        }, Yl = function(n) {
+            return new CaptureGroup(n);
+        }, Zl = "?:", _l = '"?:"', nu = function(n) {
+            return new Group("non-capture-group", n);
+        }, lu = "?=", uu = '"?="', tu = function(n) {
+            return new Group("positive-lookahead", n);
+        }, ru = "?!", eu = '"?!"', ou = function(n) {
+            return new Group("negative-lookahead", n);
+        }, cu = "CharacterSet", iu = "[", au = '"["', fu = "]", su = '"]"', hu = function(n, l) {
+            return new CharSet(!!n, l);
+        }, du = "CharacterRange", pu = "-", vu = '"-"', wu = function(n, l) {
+            return new CharacterRange(n, l);
+        }, Au = "Character", Cu = /^[^\\\]]/, gu = "[^\\\\\\]]", bu = function(n) {
+            return new Literal(n);
+        }, ku = ".", Tu = '"."', xu = function() {
+            return new Token("any-character");
+        }, yu = "Literal", mu = /^[^|\\\/.[()?+*$\^]/, Ru = "[^|\\\\\\/.[()?+*$\\^]", Fu = "\\b", Qu = '"\\\\b"', Su = function() {
+            return new Token("backspace");
+        }, Uu = function() {
+            return new Token("word-boundary");
+        }, Eu = "\\B", Gu = '"\\\\B"', Bu = function() {
+            return new Token("non-word-boundary");
+        }, ju = "\\d", $u = '"\\\\d"', qu = function() {
+            return new Token("digit");
+        }, Lu = "\\D", Mu = '"\\\\D"', Du = function() {
+            return new Token("non-digit");
+        }, Hu = "\\f", Ou = '"\\\\f"', Wu = function() {
+            return new Token("form-feed");
+        }, zu = "\\n", Iu = '"\\\\n"', Ju = function() {
+            return new Token("line-feed");
+        }, Ku = "\\r", Nu = '"\\\\r"', Pu = function() {
+            return new Token("carriage-return");
+        }, Vu = "\\s", Xu = '"\\\\s"', Yu = function() {
+            return new Token("white-space");
+        }, Zu = "\\S", _u = '"\\\\S"', nt = function() {
+            return new Token("non-white-space");
+        }, lt = "\\t", ut = '"\\\\t"', tt = function() {
+            return new Token("tab");
+        }, rt = "\\v", et = '"\\\\v"', ot = function() {
+            return new Token("vertical-tab");
+        }, ct = "\\w", it = '"\\\\w"', at = function() {
+            return new Token("word");
+        }, ft = "\\W", st = '"\\\\W"', ht = function() {
+            return new Token("non-word");
+        }, dt = "\\c", pt = '"\\\\c"', vt = "any character", wt = function(n) {
+            return new ControlCharacter(n);
+        }, At = "\\", Ct = '"\\\\"', gt = /^[1-9]/, bt = "[1-9]", kt = function(n) {
+            return new BackReference(n);
+        }, Tt = "\\0", xt = '"\\\\0"', yt = /^[0-7]/, mt = "[0-7]", Rt = function(n) {
+            return new Octal(n.join(""));
+        }, Ft = "\\x", Qt = '"\\\\x"', St = /^[0-9a-fA-F]/, Ut = "[0-9a-fA-F]", Et = function(n) {
+            return new Hex(n.join(""));
+        }, Gt = "\\u", Bt = '"\\\\u"', jt = function(n) {
+            return new Unicode(n.join(""));
+        }, $t = function() {
+            return new Token("null-character");
+        }, qt = 0, Lt = 0, Mt = 0, Dt = {
+            line: 1,
+            column: 1,
+            seenCR: !1
+        }, Ht = 0, Ot = [], Wt = 0;
+        if ("startRule" in el) {
+            if (!(el.startRule in ol)) throw new Error("Can't start parsing from rule \"" + el.startRule + '".');
+            cl = ol[el.startRule];
+        }
+        if (Token.offset = t, Token.text = u, rl = cl(), null !== rl && qt === n.length) return rl;
+        throw o(Ot), Lt = Math.max(qt, Ht), new l(Ot, Lt < n.length ? n.charAt(Lt) : null, Lt, r(Lt).line, r(Lt).column);
+    }
+    return n(l, Error), {
+        SyntaxError: l,
+        parse: u
+    };
+}(), index = 1, cgs = {};
+
+module.exports = parser

+ 1 - 0
node_modules/.1.0.1-beta3@mockjs/src/mock/schema/index.js

@@ -0,0 +1 @@
+module.exports = require('./schema')

+ 47 - 0
node_modules/.1.0.1-beta3@mockjs/src/mock/schema/schema.js

@@ -0,0 +1,47 @@
+/*
+    ## toJSONSchema
+
+    把 Mock.js 风格的数据模板转换成 JSON Schema。
+
+    > [JSON Schema](http://json-schema.org/)
+ */
+var Constant = require('../constant')
+var Util = require('../util')
+var Parser = require('../parser')
+
+function toJSONSchema(template, name, path /* Internal Use Only */ ) {
+    // type rule properties items
+    path = path || []
+    var result = {
+        name: typeof name === 'string' ? name.replace(Constant.RE_KEY, '$1') : name,
+        template: template,
+        type: Util.type(template), // 可能不准确,例如 { 'name|1': [{}, {} ...] }
+        rule: Parser.parse(name)
+    }
+    result.path = path.slice(0)
+    result.path.push(name === undefined ? 'ROOT' : result.name)
+
+    switch (result.type) {
+        case 'array':
+            result.items = []
+            Util.each(template, function(value, index) {
+                result.items.push(
+                    toJSONSchema(value, index, result.path)
+                )
+            })
+            break
+        case 'object':
+            result.properties = []
+            Util.each(template, function(value, name) {
+                result.properties.push(
+                    toJSONSchema(value, name, result.path)
+                )
+            })
+            break
+    }
+
+    return result
+
+}
+
+module.exports = toJSONSchema

+ 126 - 0
node_modules/.1.0.1-beta3@mockjs/src/mock/util.js

@@ -0,0 +1,126 @@
+/*
+    ## Utilities
+*/
+var Util = {}
+
+Util.extend = function extend() {
+    var target = arguments[0] || {},
+        i = 1,
+        length = arguments.length,
+        options, name, src, copy, clone
+
+    if (length === 1) {
+        target = this
+        i = 0
+    }
+
+    for (; i < length; i++) {
+        options = arguments[i]
+        if (!options) continue
+
+        for (name in options) {
+            src = target[name]
+            copy = options[name]
+
+            if (target === copy) continue
+            if (copy === undefined) continue
+
+            if (Util.isArray(copy) || Util.isObject(copy)) {
+                if (Util.isArray(copy)) clone = src && Util.isArray(src) ? src : []
+                if (Util.isObject(copy)) clone = src && Util.isObject(src) ? src : {}
+
+                target[name] = Util.extend(clone, copy)
+            } else {
+                target[name] = copy
+            }
+        }
+    }
+
+    return target
+}
+
+Util.each = function each(obj, iterator, context) {
+    var i, key
+    if (this.type(obj) === 'number') {
+        for (i = 0; i < obj; i++) {
+            iterator(i, i)
+        }
+    } else if (obj.length === +obj.length) {
+        for (i = 0; i < obj.length; i++) {
+            if (iterator.call(context, obj[i], i, obj) === false) break
+        }
+    } else {
+        for (key in obj) {
+            if (iterator.call(context, obj[key], key, obj) === false) break
+        }
+    }
+}
+
+Util.type = function type(obj) {
+    return (obj === null || obj === undefined) ? String(obj) : Object.prototype.toString.call(obj).match(/\[object (\w+)\]/)[1].toLowerCase()
+}
+
+Util.each('String Object Array RegExp Function'.split(' '), function(value) {
+    Util['is' + value] = function(obj) {
+        return Util.type(obj) === value.toLowerCase()
+    }
+})
+
+Util.isObjectOrArray = function(value) {
+    return Util.isObject(value) || Util.isArray(value)
+}
+
+Util.isNumeric = function(value) {
+    return !isNaN(parseFloat(value)) && isFinite(value)
+}
+
+Util.keys = function(obj) {
+    var keys = [];
+    for (var key in obj) {
+        if (obj.hasOwnProperty(key)) keys.push(key)
+    }
+    return keys;
+}
+Util.values = function(obj) {
+    var values = [];
+    for (var key in obj) {
+        if (obj.hasOwnProperty(key)) values.push(obj[key])
+    }
+    return values;
+}
+
+/*
+    ### Mock.heredoc(fn)
+
+    * Mock.heredoc(fn)
+
+    以直观、安全的方式书写(多行)HTML 模板。
+
+    **使用示例**如下所示:
+
+        var tpl = Mock.heredoc(function() {
+            /*!
+        {{email}}{{age}}
+        <!-- Mock { 
+            email: '@EMAIL',
+            age: '@INT(1,100)'
+        } -->
+            *\/
+        })
+    
+    **相关阅读**
+    * [Creating multiline strings in JavaScript](http://stackoverflow.com/questions/805107/creating-multiline-strings-in-javascript)、
+*/
+Util.heredoc = function heredoc(fn) {
+    // 1. 移除起始的 function(){ /*!
+    // 2. 移除末尾的 */ }
+    // 3. 移除起始和末尾的空格
+    return fn.toString()
+        .replace(/^[^\/]+\/\*!?/, '')
+        .replace(/\*\/[^\/]+$/, '')
+        .replace(/^[\s\xA0]+/, '').replace(/[\s\xA0]+$/, '') // .trim()
+}
+
+Util.noop = function() {}
+
+module.exports = Util

+ 1 - 0
node_modules/.1.0.1-beta3@mockjs/src/mock/valid/index.js

@@ -0,0 +1 @@
+module.exports = require('./valid')

+ 445 - 0
node_modules/.1.0.1-beta3@mockjs/src/mock/valid/valid.js

@@ -0,0 +1,445 @@
+/*
+    ## valid(template, data)
+
+    校验真实数据 data 是否与数据模板 template 匹配。
+    
+    实现思路:
+    1. 解析规则。
+        先把数据模板 template 解析为更方便机器解析的 JSON-Schame
+        name               属性名 
+        type               属性值类型
+        template           属性值模板
+        properties         对象属性数组
+        items              数组元素数组
+        rule               属性值生成规则
+    2. 递归验证规则。
+        然后用 JSON-Schema 校验真实数据,校验项包括属性名、值类型、值、值生成规则。
+
+    提示信息 
+    https://github.com/fge/json-schema-validator/blob/master/src/main/resources/com/github/fge/jsonschema/validator/validation.properties
+    [JSON-Schama validator](http://json-schema-validator.herokuapp.com/)
+    [Regexp Demo](http://demos.forbeslindesay.co.uk/regexp/)
+*/
+var Constant = require('../constant')
+var Util = require('../util')
+var toJSONSchema = require('../schema')
+
+function valid(template, data) {
+    var schema = toJSONSchema(template)
+    var result = Diff.diff(schema, data)
+    for (var i = 0; i < result.length; i++) {
+        // console.log(template, data)
+        // console.warn(Assert.message(result[i]))
+    }
+    return result
+}
+
+/*
+    ## name
+        有生成规则:比较解析后的 name
+        无生成规则:直接比较
+    ## type
+        无类型转换:直接比较
+        有类型转换:先试着解析 template,然后再检查?
+    ## value vs. template
+        基本类型
+            无生成规则:直接比较
+            有生成规则:
+                number
+                    min-max.dmin-dmax
+                    min-max.dcount
+                    count.dmin-dmax
+                    count.dcount
+                    +step
+                    整数部分
+                    小数部分
+                boolean 
+                string  
+                    min-max
+                    count
+    ## properties
+        对象
+            有生成规则:检测期望的属性个数,继续递归
+            无生成规则:检测全部的属性个数,继续递归
+    ## items
+        数组
+            有生成规则:
+                `'name|1': [{}, {} ...]`            其中之一,继续递归
+                `'name|+1': [{}, {} ...]`           顺序检测,继续递归
+                `'name|min-max': [{}, {} ...]`      检测个数,继续递归
+                `'name|count': [{}, {} ...]`        检测个数,继续递归
+            无生成规则:检测全部的元素个数,继续递归
+*/
+var Diff = {
+    diff: function diff(schema, data, name /* Internal Use Only */ ) {
+        var result = []
+
+        // 先检测名称 name 和类型 type,如果匹配,才有必要继续检测
+        if (
+            this.name(schema, data, name, result) &&
+            this.type(schema, data, name, result)
+        ) {
+            this.value(schema, data, name, result)
+            this.properties(schema, data, name, result)
+            this.items(schema, data, name, result)
+        }
+
+        return result
+    },
+    /* jshint unused:false */
+    name: function(schema, data, name, result) {
+        var length = result.length
+
+        Assert.equal('name', schema.path, name + '', schema.name + '', result)
+
+        return result.length === length
+    },
+    type: function(schema, data, name, result) {
+        var length = result.length
+
+        switch (schema.type) {
+            case 'string':
+                // 跳过含有『占位符』的属性值,因为『占位符』返回值的类型可能和模板不一致,例如 '@int' 会返回一个整形值
+                if (schema.template.match(Constant.RE_PLACEHOLDER)) return true
+                break
+            case 'array':
+                if (schema.rule.parameters) {
+                    // name|count: array
+                    if (schema.rule.min !== undefined && schema.rule.max === undefined) {
+                        // 跳过 name|1: array,因为最终值的类型(很可能)不是数组,也不一定与 `array` 中的类型一致
+                        if (schema.rule.count === 1) return true
+                    }
+                    // 跳过 name|+inc: array
+                    if (schema.rule.parameters[2]) return true
+                }
+                break
+            case 'function':
+                // 跳过 `'name': function`,因为函数可以返回任何类型的值。
+                return true
+        }
+
+        Assert.equal('type', schema.path, Util.type(data), schema.type, result)
+
+        return result.length === length
+    },
+    value: function(schema, data, name, result) {
+        var length = result.length
+
+        var rule = schema.rule
+        var templateType = schema.type
+        if (templateType === 'object' || templateType === 'array' || templateType === 'function') return true
+
+        // 无生成规则
+        if (!rule.parameters) {
+            switch (templateType) {
+                case 'regexp':
+                    Assert.match('value', schema.path, data, schema.template, result)
+                    return result.length === length
+                case 'string':
+                    // 同样跳过含有『占位符』的属性值,因为『占位符』的返回值会通常会与模板不一致
+                    if (schema.template.match(Constant.RE_PLACEHOLDER)) return result.length === length
+                    break
+            }
+            Assert.equal('value', schema.path, data, schema.template, result)
+            return result.length === length
+        }
+
+        // 有生成规则
+        var actualRepeatCount
+        switch (templateType) {
+            case 'number':
+                var parts = (data + '').split('.')
+                parts[0] = +parts[0]
+
+                // 整数部分
+                // |min-max
+                if (rule.min !== undefined && rule.max !== undefined) {
+                    Assert.greaterThanOrEqualTo('value', schema.path, parts[0], Math.min(rule.min, rule.max), result)
+                        // , 'numeric instance is lower than the required minimum (minimum: {expected}, found: {actual})')
+                    Assert.lessThanOrEqualTo('value', schema.path, parts[0], Math.max(rule.min, rule.max), result)
+                }
+                // |count
+                if (rule.min !== undefined && rule.max === undefined) {
+                    Assert.equal('value', schema.path, parts[0], rule.min, result, '[value] ' + name)
+                }
+
+                // 小数部分
+                if (rule.decimal) {
+                    // |dmin-dmax
+                    if (rule.dmin !== undefined && rule.dmax !== undefined) {
+                        Assert.greaterThanOrEqualTo('value', schema.path, parts[1].length, rule.dmin, result)
+                        Assert.lessThanOrEqualTo('value', schema.path, parts[1].length, rule.dmax, result)
+                    }
+                    // |dcount
+                    if (rule.dmin !== undefined && rule.dmax === undefined) {
+                        Assert.equal('value', schema.path, parts[1].length, rule.dmin, result)
+                    }
+                }
+
+                break
+
+            case 'boolean':
+                break
+
+            case 'string':
+                // 'aaa'.match(/a/g)
+                actualRepeatCount = data.match(new RegExp(schema.template, 'g'))
+                actualRepeatCount = actualRepeatCount ? actualRepeatCount.length : 0
+
+                // |min-max
+                if (rule.min !== undefined && rule.max !== undefined) {
+                    Assert.greaterThanOrEqualTo('repeat count', schema.path, actualRepeatCount, rule.min, result)
+                    Assert.lessThanOrEqualTo('repeat count', schema.path, actualRepeatCount, rule.max, result)
+                }
+                // |count
+                if (rule.min !== undefined && rule.max === undefined) {
+                    Assert.equal('repeat count', schema.path, actualRepeatCount, rule.min, result)
+                }
+
+                break
+
+            case 'regexp':
+                actualRepeatCount = data.match(new RegExp(schema.template.source.replace(/^\^|\$$/g, ''), 'g'))
+                actualRepeatCount = actualRepeatCount ? actualRepeatCount.length : 0
+
+                // |min-max
+                if (rule.min !== undefined && rule.max !== undefined) {
+                    Assert.greaterThanOrEqualTo('repeat count', schema.path, actualRepeatCount, rule.min, result)
+                    Assert.lessThanOrEqualTo('repeat count', schema.path, actualRepeatCount, rule.max, result)
+                }
+                // |count
+                if (rule.min !== undefined && rule.max === undefined) {
+                    Assert.equal('repeat count', schema.path, actualRepeatCount, rule.min, result)
+                }
+                break
+        }
+
+        return result.length === length
+    },
+    properties: function(schema, data, name, result) {
+        var length = result.length
+
+        var rule = schema.rule
+        var keys = Util.keys(data)
+        if (!schema.properties) return
+
+        // 无生成规则
+        if (!schema.rule.parameters) {
+            Assert.equal('properties length', schema.path, keys.length, schema.properties.length, result)
+        } else {
+            // 有生成规则
+            // |min-max
+            if (rule.min !== undefined && rule.max !== undefined) {
+                Assert.greaterThanOrEqualTo('properties length', schema.path, keys.length, Math.min(rule.min, rule.max), result)
+                Assert.lessThanOrEqualTo('properties length', schema.path, keys.length, Math.max(rule.min, rule.max), result)
+            }
+            // |count
+            if (rule.min !== undefined && rule.max === undefined) {
+                // |1, |>1
+                if (rule.count !== 1) Assert.equal('properties length', schema.path, keys.length, rule.min, result)
+            }
+        }
+
+        if (result.length !== length) return false
+
+        for (var i = 0; i < keys.length; i++) {
+            result.push.apply(
+                result,
+                this.diff(
+                    function() {
+                        var property
+                        Util.each(schema.properties, function(item /*, index*/ ) {
+                            if (item.name === keys[i]) property = item
+                        })
+                        return property || schema.properties[i]
+                    }(),
+                    data[keys[i]],
+                    keys[i]
+                )
+            )
+        }
+
+        return result.length === length
+    },
+    items: function(schema, data, name, result) {
+        var length = result.length
+
+        if (!schema.items) return
+
+        var rule = schema.rule
+
+        // 无生成规则
+        if (!schema.rule.parameters) {
+            Assert.equal('items length', schema.path, data.length, schema.items.length, result)
+        } else {
+            // 有生成规则
+            // |min-max
+            if (rule.min !== undefined && rule.max !== undefined) {
+                Assert.greaterThanOrEqualTo('items', schema.path, data.length, (Math.min(rule.min, rule.max) * schema.items.length), result,
+                    '[{utype}] array is too short: {path} must have at least {expected} elements but instance has {actual} elements')
+                Assert.lessThanOrEqualTo('items', schema.path, data.length, (Math.max(rule.min, rule.max) * schema.items.length), result,
+                    '[{utype}] array is too long: {path} must have at most {expected} elements but instance has {actual} elements')
+            }
+            // |count
+            if (rule.min !== undefined && rule.max === undefined) {
+                // |1, |>1
+                if (rule.count === 1) return result.length === length
+                else Assert.equal('items length', schema.path, data.length, (rule.min * schema.items.length), result)
+            }
+            // |+inc
+            if (rule.parameters[2]) return result.length === length
+        }
+
+        if (result.length !== length) return false
+
+        for (var i = 0; i < data.length; i++) {
+            result.push.apply(
+                result,
+                this.diff(
+                    schema.items[i % schema.items.length],
+                    data[i],
+                    i % schema.items.length
+                )
+            )
+        }
+
+        return result.length === length
+    }
+}
+
+/*
+    完善、友好的提示信息
+    
+    Equal, not equal to, greater than, less than, greater than or equal to, less than or equal to
+    路径 验证类型 描述 
+
+    Expect path.name is less than or equal to expected, but path.name is actual.
+
+    Expect path.name is less than or equal to expected, but path.name is actual.
+    Expect path.name is greater than or equal to expected, but path.name is actual.
+
+*/
+var Assert = {
+    message: function(item) {
+        return (item.message ||
+                '[{utype}] Expect {path}\'{ltype} {action} {expected}, but is {actual}')
+            .replace('{utype}', item.type.toUpperCase())
+            .replace('{ltype}', item.type.toLowerCase())
+            .replace('{path}', Util.isArray(item.path) && item.path.join('.') || item.path)
+            .replace('{action}', item.action)
+            .replace('{expected}', item.expected)
+            .replace('{actual}', item.actual)
+    },
+    equal: function(type, path, actual, expected, result, message) {
+        if (actual === expected) return true
+        switch (type) {
+            case 'type':
+                // 正则模板 === 字符串最终值
+                if (expected === 'regexp' && actual === 'string') return true
+                break
+        }
+
+        var item = {
+            path: path,
+            type: type,
+            actual: actual,
+            expected: expected,
+            action: 'is equal to',
+            message: message
+        }
+        item.message = Assert.message(item)
+        result.push(item)
+        return false
+    },
+    // actual matches expected
+    match: function(type, path, actual, expected, result, message) {
+        if (expected.test(actual)) return true
+
+        var item = {
+            path: path,
+            type: type,
+            actual: actual,
+            expected: expected,
+            action: 'matches',
+            message: message
+        }
+        item.message = Assert.message(item)
+        result.push(item)
+        return false
+    },
+    notEqual: function(type, path, actual, expected, result, message) {
+        if (actual !== expected) return true
+        var item = {
+            path: path,
+            type: type,
+            actual: actual,
+            expected: expected,
+            action: 'is not equal to',
+            message: message
+        }
+        item.message = Assert.message(item)
+        result.push(item)
+        return false
+    },
+    greaterThan: function(type, path, actual, expected, result, message) {
+        if (actual > expected) return true
+        var item = {
+            path: path,
+            type: type,
+            actual: actual,
+            expected: expected,
+            action: 'is greater than',
+            message: message
+        }
+        item.message = Assert.message(item)
+        result.push(item)
+        return false
+    },
+    lessThan: function(type, path, actual, expected, result, message) {
+        if (actual < expected) return true
+        var item = {
+            path: path,
+            type: type,
+            actual: actual,
+            expected: expected,
+            action: 'is less to',
+            message: message
+        }
+        item.message = Assert.message(item)
+        result.push(item)
+        return false
+    },
+    greaterThanOrEqualTo: function(type, path, actual, expected, result, message) {
+        if (actual >= expected) return true
+        var item = {
+            path: path,
+            type: type,
+            actual: actual,
+            expected: expected,
+            action: 'is greater than or equal to',
+            message: message
+        }
+        item.message = Assert.message(item)
+        result.push(item)
+        return false
+    },
+    lessThanOrEqualTo: function(type, path, actual, expected, result, message) {
+        if (actual <= expected) return true
+        var item = {
+            path: path,
+            type: type,
+            actual: actual,
+            expected: expected,
+            action: 'is less than or equal to',
+            message: message
+        }
+        item.message = Assert.message(item)
+        result.push(item)
+        return false
+    }
+}
+
+valid.Diff = Diff
+valid.Assert = Assert
+
+module.exports = valid

+ 1 - 0
node_modules/.1.0.1-beta3@mockjs/src/mock/xhr/index.js

@@ -0,0 +1 @@
+module.exports = require('./xhr')

+ 442 - 0
node_modules/.1.0.1-beta3@mockjs/src/mock/xhr/xhr.js

@@ -0,0 +1,442 @@
+/* global window, document, location, Event, setTimeout */
+/*
+    ## MockXMLHttpRequest
+
+    期望的功能:
+    1. 完整地覆盖原生 XHR 的行为
+    2. 完整地模拟原生 XHR 的行为
+    3. 在发起请求时,自动检测是否需要拦截
+    4. 如果不必拦截,则执行原生 XHR 的行为
+    5. 如果需要拦截,则执行虚拟 XHR 的行为
+    6. 兼容 XMLHttpRequest 和 ActiveXObject
+        new window.XMLHttpRequest()
+        new window.ActiveXObject("Microsoft.XMLHTTP")
+
+    关键方法的逻辑:
+    * new   此时尚无法确定是否需要拦截,所以创建原生 XHR 对象是必须的。
+    * open  此时可以取到 URL,可以决定是否进行拦截。
+    * send  此时已经确定了请求方式。
+
+    规范:
+    http://xhr.spec.whatwg.org/
+    http://www.w3.org/TR/XMLHttpRequest2/
+
+    参考实现:
+    https://github.com/philikon/MockHttpRequest/blob/master/lib/mock.js
+    https://github.com/trek/FakeXMLHttpRequest/blob/master/fake_xml_http_request.js
+    https://github.com/ilinsky/xmlhttprequest/blob/master/XMLHttpRequest.js
+    https://github.com/firebug/firebug-lite/blob/master/content/lite/xhr.js
+    https://github.com/thx/RAP/blob/master/lab/rap.plugin.xinglie.js
+
+    **需不需要全面重写 XMLHttpRequest?**
+        http://xhr.spec.whatwg.org/#interface-xmlhttprequest
+        关键属性 readyState、status、statusText、response、responseText、responseXML 是 readonly,所以,试图通过修改这些状态,来模拟响应是不可行的。
+        因此,唯一的办法是模拟整个 XMLHttpRequest,就像 jQuery 对事件模型的封装。
+
+    // Event handlers
+    onloadstart         loadstart
+    onprogress          progress
+    onabort             abort
+    onerror             error
+    onload              load
+    ontimeout           timeout
+    onloadend           loadend
+    onreadystatechange  readystatechange
+ */
+
+var Util = require('../util')
+
+// 备份原生 XMLHttpRequest
+window._XMLHttpRequest = window.XMLHttpRequest
+window._ActiveXObject = window.ActiveXObject
+
+/*
+    PhantomJS
+    TypeError: '[object EventConstructor]' is not a constructor (evaluating 'new Event("readystatechange")')
+
+    https://github.com/bluerail/twitter-bootstrap-rails-confirm/issues/18
+    https://github.com/ariya/phantomjs/issues/11289
+*/
+try {
+    new window.Event('custom')
+} catch (exception) {
+    window.Event = function(type, bubbles, cancelable, detail) {
+        var event = document.createEvent('CustomEvent') // MUST be 'CustomEvent'
+        event.initCustomEvent(type, bubbles, cancelable, detail)
+        return event
+    }
+}
+
+var XHR_STATES = {
+    // The object has been constructed.
+    UNSENT: 0,
+    // The open() method has been successfully invoked.
+    OPENED: 1,
+    // All redirects (if any) have been followed and all HTTP headers of the response have been received.
+    HEADERS_RECEIVED: 2,
+    // The response's body is being received.
+    LOADING: 3,
+    // The data transfer has been completed or something went wrong during the transfer (e.g. infinite redirects).
+    DONE: 4
+}
+
+var XHR_EVENTS = 'readystatechange loadstart progress abort error load timeout loadend'.split(' ')
+var XHR_REQUEST_PROPERTIES = 'timeout withCredentials'.split(' ')
+var XHR_RESPONSE_PROPERTIES = 'readyState responseURL status statusText responseType response responseText responseXML'.split(' ')
+
+// https://github.com/trek/FakeXMLHttpRequest/blob/master/fake_xml_http_request.js#L32
+var HTTP_STATUS_CODES = {
+    100: "Continue",
+    101: "Switching Protocols",
+    200: "OK",
+    201: "Created",
+    202: "Accepted",
+    203: "Non-Authoritative Information",
+    204: "No Content",
+    205: "Reset Content",
+    206: "Partial Content",
+    300: "Multiple Choice",
+    301: "Moved Permanently",
+    302: "Found",
+    303: "See Other",
+    304: "Not Modified",
+    305: "Use Proxy",
+    307: "Temporary Redirect",
+    400: "Bad Request",
+    401: "Unauthorized",
+    402: "Payment Required",
+    403: "Forbidden",
+    404: "Not Found",
+    405: "Method Not Allowed",
+    406: "Not Acceptable",
+    407: "Proxy Authentication Required",
+    408: "Request Timeout",
+    409: "Conflict",
+    410: "Gone",
+    411: "Length Required",
+    412: "Precondition Failed",
+    413: "Request Entity Too Large",
+    414: "Request-URI Too Long",
+    415: "Unsupported Media Type",
+    416: "Requested Range Not Satisfiable",
+    417: "Expectation Failed",
+    422: "Unprocessable Entity",
+    500: "Internal Server Error",
+    501: "Not Implemented",
+    502: "Bad Gateway",
+    503: "Service Unavailable",
+    504: "Gateway Timeout",
+    505: "HTTP Version Not Supported"
+}
+
+/*
+    MockXMLHttpRequest
+*/
+
+function MockXMLHttpRequest() {
+    // 初始化 custom 对象,用于存储自定义属性
+    this.custom = {
+        events: {},
+        requestHeaders: {},
+        responseHeaders: {}
+    }
+}
+
+MockXMLHttpRequest._settings = {
+    timeout: '10-100',
+    /*
+        timeout: 50,
+        timeout: '10-100',
+     */
+}
+
+MockXMLHttpRequest.setup = function(settings) {
+    Util.extend(MockXMLHttpRequest._settings, settings)
+    return MockXMLHttpRequest._settings
+}
+
+Util.extend(MockXMLHttpRequest, XHR_STATES)
+Util.extend(MockXMLHttpRequest.prototype, XHR_STATES)
+
+// 标记当前对象为 MockXMLHttpRequest
+MockXMLHttpRequest.prototype.mock = true
+
+// 是否拦截 Ajax 请求
+MockXMLHttpRequest.prototype.match = false
+
+// 初始化 Request 相关的属性和方法
+Util.extend(MockXMLHttpRequest.prototype, {
+    // https://xhr.spec.whatwg.org/#the-open()-method
+    // Sets the request method, request URL, and synchronous flag.
+    open: function(method, url, async, username, password) {
+        var that = this
+
+        Util.extend(this.custom, {
+            method: method,
+            url: url,
+            async: typeof async === 'boolean' ? async : true,
+            username: username,
+            password: password,
+            options: {
+                url: url,
+                type: method
+            }
+        })
+
+        this.custom.timeout = function(timeout) {
+            if (typeof timeout === 'number') return timeout
+            if (typeof timeout === 'string' && !~timeout.indexOf('-')) return parseInt(timeout, 10)
+            if (typeof timeout === 'string' && ~timeout.indexOf('-')) {
+                var tmp = timeout.split('-')
+                var min = parseInt(tmp[0], 10)
+                var max = parseInt(tmp[1], 10)
+                return Math.round(Math.random() * (max - min)) + min
+            }
+        }(MockXMLHttpRequest._settings.timeout)
+
+        // 查找与请求参数匹配的数据模板
+        var item = find(this.custom.options)
+
+        function handle(event) {
+            // 同步属性 NativeXMLHttpRequest => MockXMLHttpRequest
+            for (var i = 0; i < XHR_RESPONSE_PROPERTIES.length; i++) {
+                try {
+                    that[XHR_RESPONSE_PROPERTIES[i]] = xhr[XHR_RESPONSE_PROPERTIES[i]]
+                } catch (e) {}
+            }
+            // 触发 MockXMLHttpRequest 上的同名事件
+            that.dispatchEvent(new Event(event.type /*, false, false, that*/ ))
+        }
+
+        // 如果未找到匹配的数据模板,则采用原生 XHR 发送请求。
+        if (!item) {
+            // 创建原生 XHR 对象,调用原生 open(),监听所有原生事件
+            var xhr = createNativeXMLHttpRequest()
+            this.custom.xhr = xhr
+
+            // 初始化所有事件,用于监听原生 XHR 对象的事件
+            for (var i = 0; i < XHR_EVENTS.length; i++) {
+                xhr.addEventListener(XHR_EVENTS[i], handle)
+            }
+
+            // xhr.open()
+            if (username) xhr.open(method, url, async, username, password)
+            else xhr.open(method, url, async)
+
+            // 同步属性 MockXMLHttpRequest => NativeXMLHttpRequest
+            for (var j = 0; j < XHR_REQUEST_PROPERTIES.length; j++) {
+                try {
+                    xhr[XHR_REQUEST_PROPERTIES[j]] = that[XHR_REQUEST_PROPERTIES[j]]
+                } catch (e) {}
+            }
+
+            return
+        }
+
+        // 找到了匹配的数据模板,开始拦截 XHR 请求
+        this.match = true
+        this.custom.template = item
+        this.readyState = MockXMLHttpRequest.OPENED
+        this.dispatchEvent(new Event('readystatechange' /*, false, false, this*/ ))
+    },
+    // https://xhr.spec.whatwg.org/#the-setrequestheader()-method
+    // Combines a header in author request headers.
+    setRequestHeader: function(name, value) {
+        // 原生 XHR
+        if (!this.match) {
+            this.custom.xhr.setRequestHeader(name, value)
+            return
+        }
+
+        // 拦截 XHR
+        var requestHeaders = this.custom.requestHeaders
+        if (requestHeaders[name]) requestHeaders[name] += ',' + value
+        else requestHeaders[name] = value
+    },
+    timeout: 0,
+    withCredentials: false,
+    upload: {},
+    // https://xhr.spec.whatwg.org/#the-send()-method
+    // Initiates the request.
+    send: function send(data) {
+        var that = this
+        this.custom.options.body = data
+
+        // 原生 XHR
+        if (!this.match) {
+            this.custom.xhr.send(data)
+            return
+        }
+
+        // 拦截 XHR
+
+        // X-Requested-With header
+        this.setRequestHeader('X-Requested-With', 'MockXMLHttpRequest')
+
+        // loadstart The fetch initiates.
+        this.dispatchEvent(new Event('loadstart' /*, false, false, this*/ ))
+
+        if (this.custom.async) setTimeout(done, this.custom.timeout) // 异步
+        else done() // 同步
+
+        function done() {
+            that.readyState = MockXMLHttpRequest.HEADERS_RECEIVED
+            that.dispatchEvent(new Event('readystatechange' /*, false, false, that*/ ))
+            that.readyState = MockXMLHttpRequest.LOADING
+            that.dispatchEvent(new Event('readystatechange' /*, false, false, that*/ ))
+
+            that.status = 200
+            that.statusText = HTTP_STATUS_CODES[200]
+
+            // fix #92 #93 by @qddegtya
+            that.response = that.responseText = JSON.stringify(
+                convert(that.custom.template, that.custom.options),
+                null, 4
+            )
+
+            that.readyState = MockXMLHttpRequest.DONE
+            that.dispatchEvent(new Event('readystatechange' /*, false, false, that*/ ))
+            that.dispatchEvent(new Event('load' /*, false, false, that*/ ));
+            that.dispatchEvent(new Event('loadend' /*, false, false, that*/ ));
+        }
+    },
+    // https://xhr.spec.whatwg.org/#the-abort()-method
+    // Cancels any network activity.
+    abort: function abort() {
+        // 原生 XHR
+        if (!this.match) {
+            this.custom.xhr.abort()
+            return
+        }
+
+        // 拦截 XHR
+        this.readyState = MockXMLHttpRequest.UNSENT
+        this.dispatchEvent(new Event('abort', false, false, this))
+        this.dispatchEvent(new Event('error', false, false, this))
+    }
+})
+
+// 初始化 Response 相关的属性和方法
+Util.extend(MockXMLHttpRequest.prototype, {
+    responseURL: '',
+    status: MockXMLHttpRequest.UNSENT,
+    statusText: '',
+    // https://xhr.spec.whatwg.org/#the-getresponseheader()-method
+    getResponseHeader: function(name) {
+        // 原生 XHR
+        if (!this.match) {
+            return this.custom.xhr.getResponseHeader(name)
+        }
+
+        // 拦截 XHR
+        return this.custom.responseHeaders[name.toLowerCase()]
+    },
+    // https://xhr.spec.whatwg.org/#the-getallresponseheaders()-method
+    // http://www.utf8-chartable.de/
+    getAllResponseHeaders: function() {
+        // 原生 XHR
+        if (!this.match) {
+            return this.custom.xhr.getAllResponseHeaders()
+        }
+
+        // 拦截 XHR
+        var responseHeaders = this.custom.responseHeaders
+        var headers = ''
+        for (var h in responseHeaders) {
+            if (!responseHeaders.hasOwnProperty(h)) continue
+            headers += h + ': ' + responseHeaders[h] + '\r\n'
+        }
+        return headers
+    },
+    overrideMimeType: function( /*mime*/ ) {},
+    responseType: '', // '', 'text', 'arraybuffer', 'blob', 'document', 'json'
+    response: null,
+    responseText: '',
+    responseXML: null
+})
+
+// EventTarget
+Util.extend(MockXMLHttpRequest.prototype, {
+    addEventListener: function addEventListener(type, handle) {
+        var events = this.custom.events
+        if (!events[type]) events[type] = []
+        events[type].push(handle)
+    },
+    removeEventListener: function removeEventListener(type, handle) {
+        var handles = this.custom.events[type] || []
+        for (var i = 0; i < handles.length; i++) {
+            if (handles[i] === handle) {
+                handles.splice(i--, 1)
+            }
+        }
+    },
+    dispatchEvent: function dispatchEvent(event) {
+        var handles = this.custom.events[event.type] || []
+        for (var i = 0; i < handles.length; i++) {
+            handles[i].call(this, event)
+        }
+
+        var ontype = 'on' + event.type
+        if (this[ontype]) this[ontype](event)
+    }
+})
+
+// Inspired by jQuery
+function createNativeXMLHttpRequest() {
+    var isLocal = function() {
+        var rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/
+        var rurl = /^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/
+        var ajaxLocation = location.href
+        var ajaxLocParts = rurl.exec(ajaxLocation.toLowerCase()) || []
+        return rlocalProtocol.test(ajaxLocParts[1])
+    }()
+
+    return window.ActiveXObject ?
+        (!isLocal && createStandardXHR() || createActiveXHR()) : createStandardXHR()
+
+    function createStandardXHR() {
+        try {
+            return new window._XMLHttpRequest();
+        } catch (e) {}
+    }
+
+    function createActiveXHR() {
+        try {
+            return new window._ActiveXObject("Microsoft.XMLHTTP");
+        } catch (e) {}
+    }
+}
+
+
+// 查找与请求参数匹配的数据模板:URL,Type
+function find(options) {
+
+    for (var sUrlType in MockXMLHttpRequest.Mock._mocked) {
+        var item = MockXMLHttpRequest.Mock._mocked[sUrlType]
+        if (
+            (!item.rurl || match(item.rurl, options.url)) &&
+            (!item.rtype || match(item.rtype, options.type.toLowerCase()))
+        ) {
+            // console.log('[mock]', options.url, '>', item.rurl)
+            return item
+        }
+    }
+
+    function match(expected, actual) {
+        if (Util.type(expected) === 'string') {
+            return expected === actual
+        }
+        if (Util.type(expected) === 'regexp') {
+            return expected.test(actual)
+        }
+    }
+
+}
+
+// 数据模板 => 响应数据
+function convert(item, options) {
+    return Util.isFunction(item.template) ?
+        item.template(options) : MockXMLHttpRequest.Mock.mock(item.template)
+}
+
+module.exports = MockXMLHttpRequest

+ 11 - 0
node_modules/.1.0.1-beta3@mockjs/test/bower.json

@@ -0,0 +1,11 @@
+{
+  "name": "test",
+  "dependencies": {},
+  "devDependencies": {
+    "requirejs": "*",
+    "mocha": "*",
+    "chai": "*",
+    "underscore": "*",
+    "jquery": "~2.1.1"
+  }
+}

+ 2 - 0
node_modules/.1.0.1-beta3@mockjs/test/materiels/noop.html

@@ -0,0 +1,2 @@
+<script type="text/javascript" src="./noop.js"></script>
+<div>noop.html</div>

+ 1 - 0
node_modules/.1.0.1-beta3@mockjs/test/materiels/noop.js

@@ -0,0 +1 @@
+(function noop() {})();

+ 6 - 0
node_modules/.1.0.1-beta3@mockjs/test/package.json

@@ -0,0 +1,6 @@
+{
+  "name": "test",
+  "dependencies": {
+    "chai": "^1.10.0"
+  }
+}

+ 35 - 0
node_modules/.1.0.1-beta3@mockjs/test/test.coveralls.js

@@ -0,0 +1,35 @@
+/* global require */
+/* global describe, it */
+var assert = require("assert")
+describe('Array', function() {
+    describe('#indexOf()', function() {
+        it('should return -1 when the value is not present', function() {
+            assert.equal(-1, [1, 2, 3].indexOf(5))
+            assert.equal(-1, [1, 2, 3].indexOf(0))
+        })
+    })
+})
+describe('Array', function() {
+    describe('#indexOf()', function() {
+        it('should return -1 when the value is not present', function() {
+            assert.equal(-1, [1, 2, 3].indexOf(5))
+            assert.equal(-1, [1, 2, 3].indexOf(0))
+        })
+    })
+})
+describe('Array', function() {
+    describe('#indexOf()', function() {
+        it('should return -1 when the value is not present', function() {
+            assert.equal(-1, [1, 2, 3].indexOf(5))
+            assert.equal(-1, [1, 2, 3].indexOf(0))
+        })
+    })
+})
+describe('Array', function() {
+    describe('#indexOf()', function() {
+        it('should return -1 when the value is not present', function() {
+            assert.equal(-1, [1, 2, 3].indexOf(5))
+            assert.equal(-1, [1, 2, 3].indexOf(0))
+        })
+    })
+})

+ 57 - 0
node_modules/.1.0.1-beta3@mockjs/test/test.mock.html

@@ -0,0 +1,57 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <title>Test: Mock</title>
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <link href="./bower_components/mocha/mocha.css" rel="stylesheet">
+    <style type="text/css">
+        li.test h2 {
+            font-family: monospace;
+            /*white-space: pre;*/
+            padding-left: 20px;
+        }
+    </style>
+</head>
+<body>
+    <div id="mocha"></div>
+    <!-- Include local Mocha. -->
+    <script src="./bower_components/mocha/mocha.js"></script>
+    <script src="./bower_components/chai/chai.js"></script>
+    <script>mocha.setup('bdd')</script>
+    <!-- Include RequireJS -->
+    <script src="./bower_components/requirejs/require.js"></script>
+    <script type="text/javascript">
+        require.config({
+            paths: {
+                'mock': '../dist/mock',
+                jquery: 'bower_components/jquery/dist/jquery',
+                underscore: 'bower_components/underscore/underscore'
+            }
+        })
+    </script>
+
+    <hr>
+    <div id="container" style="margin: 60px 50px;"></div>
+    <pre id="tpl" class="container"></pre>
+    <pre id="data" class="container"></pre>
+
+    <!-- Include the actual tests. -->
+    <script src="./test.mock.spec.dtd.js"></script>
+    <script src="./test.mock.spec.dpd.js"></script>
+    <script src="./test.mock.random.js"></script>
+    <script src="./test.mock.mock.js"></script>
+    <script src="./test.mock.request.js"></script>
+    <script src="./test.mock.schema.js"></script>
+    <script src="./test.mock.valid.js"></script>
+    
+    <!-- PhantomJS -->
+    <script type="text/javascript">
+         if (window.mochaPhantomJS) {
+             mochaPhantomJS.run()
+         } else {
+             mocha.run()
+         }
+    </script>
+</body>
+</html>

+ 62 - 0
node_modules/.1.0.1-beta3@mockjs/test/test.mock.mock.js

@@ -0,0 +1,62 @@
+/* global require, chai, describe, before, it */
+// 数据占位符定义(Data Placeholder Definition,DPD)
+var expect = chai.expect
+var Mock, $, _
+
+describe('Mock.mock', function() {
+    before(function(done) {
+        require(['mock', 'underscore', 'jquery'], function() {
+            Mock = arguments[0]
+            _ = arguments[1]
+            $ = arguments[2]
+            expect(Mock).to.not.equal(undefined)
+            expect(_).to.not.equal(undefined)
+            expect($).to.not.equal(undefined)
+            done()
+        })
+    })
+
+    describe('Mock.mock( String )', function() {
+        it('@EMAIL', function() {
+            var data = Mock.mock(this.test.title)
+            expect(data).to.not.equal(this.test.title)
+            this.test.title += ' => ' + data
+        })
+    })
+    describe('Mock.mock( {} )', function() {
+        it('', function() {
+            var tpl = {
+                'list|1-10': [{
+                    'id|+1': 1,
+                    'email': '@EMAIL'
+                }]
+            }
+            var data = Mock.mock(tpl)
+            this.test.title = JSON.stringify(tpl /*, null, 4*/ ) + ' => ' + JSON.stringify(data /*, null, 4*/ )
+            expect(data).to.have.property('list')
+                .that.be.an('array').with.length.within(1, 10)
+            _.each(data.list, function(item, index, list) {
+                if (index > 0) expect(item.id).to.equal(list[index - 1].id + 1)
+            })
+        })
+    })
+    describe('Mock.mock( function() )', function() {
+        it('', function() {
+            var fn = function() {
+                return Mock.mock({
+                    'list|1-10': [{
+                        'id|+1': 1,
+                        'email': '@EMAIL'
+                    }]
+                })
+            }
+            var data = Mock.mock(fn)
+            this.test.title = fn.toString() + ' => ' + JSON.stringify(data /*, null, 4*/ )
+            expect(data).to.have.property('list')
+                .that.be.an('array').with.length.within(1, 10)
+            _.each(data.list, function(item, index, list) {
+                if (index > 0) expect(item.id).to.equal(list[index - 1].id + 1)
+            })
+        })
+    })
+})

+ 464 - 0
node_modules/.1.0.1-beta3@mockjs/test/test.mock.random.js

@@ -0,0 +1,464 @@
+/* global require, chai, describe, before, it */
+/* global window */
+// 数据占位符定义(Data Placeholder Definition,DPD)
+var expect = chai.expect
+var Mock, Random, $, _, Random
+
+/* jshint -W061 */
+describe('Random', function() {
+    before(function(done) {
+        require(['mock', 'underscore', 'jquery'], function() {
+            Mock = arguments[0]
+            window.Random = Random = Mock.Random
+            _ = arguments[1]
+            $ = arguments[2]
+            expect(Mock).to.not.equal(undefined)
+            expect(_).to.not.equal(undefined)
+            expect($).to.not.equal(undefined)
+            done()
+        })
+    })
+
+    function stringify(json) {
+        return JSON.stringify(json /*, null, 4*/ )
+    }
+
+    function doit(expression, validator) {
+        it('', function() {
+            // for (var i = 0; i < 1; i++) {}
+            var data = eval(expression)
+            validator(data)
+            this.test.title = stringify(expression) + ' => ' + stringify(data)
+        })
+    }
+
+    describe('Basic', function() {
+        doit('Random.boolean()', function(data) {
+            expect(data).to.be.a('boolean')
+        })
+
+        doit('Random.natural()', function(data) {
+            expect(data).to.be.a('number').within(0, 9007199254740992)
+        })
+        doit('Random.natural(1, 3)', function(data) {
+            expect(data).to.be.a('number').within(1, 3)
+        })
+        doit('Random.natural(1)', function(data) {
+            expect(data).to.be.a('number').least(1)
+        })
+
+        doit('Random.integer()', function(data) {
+            expect(data).to.be.a('number').within(-9007199254740992, 9007199254740992)
+        })
+        doit('Random.integer(-10, 10)', function(data) {
+            expect(data).to.be.a('number').within(-10, 10)
+        })
+
+        // 1 整数部分 2 小数部分
+        var RE_FLOAT = /(\-?\d+)\.?(\d+)?/
+
+        function validFloat(float, min, max, dmin, dmax) {
+            RE_FLOAT.lastIndex = 0
+            var parts = RE_FLOAT.exec(float + '')
+
+            expect(+parts[1]).to.be.a('number').within(min, max)
+
+            /* jshint -W041 */
+            if (parts[2] != undefined) {
+                expect(parts[2]).to.have.length.within(dmin, dmax)
+            }
+        }
+
+        doit('Random.float()', function(data) {
+            validFloat(data, -9007199254740992, 9007199254740992, 0, 17)
+        })
+        doit('Random.float(0)', function(data) {
+            validFloat(data, 0, 9007199254740992, 0, 17)
+        })
+        doit('Random.float(60, 100)', function(data) {
+            validFloat(data, 60, 100, 0, 17)
+        })
+        doit('Random.float(60, 100, 3)', function(data) {
+            validFloat(data, 60, 100, 3, 17)
+        })
+        doit('Random.float(60, 100, 3, 5)', function(data) {
+            validFloat(data, 60, 100, 3, 5)
+        })
+
+        var CHARACTER_LOWER = 'abcdefghijklmnopqrstuvwxyz'
+        var CHARACTER_UPPER = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+        var CHARACTER_NUMBER = '0123456789'
+        var CHARACTER_SYMBOL = '!@#$%^&*()[]'
+        doit('Random.character()', function(data) {
+            expect(data).to.be.a('string').with.length(1)
+            expect(
+                CHARACTER_LOWER +
+                CHARACTER_UPPER +
+                CHARACTER_NUMBER +
+                CHARACTER_SYMBOL
+            ).to.include(data)
+        })
+        doit('Random.character("lower")', function(data) {
+            expect(data).to.be.a('string').with.length(1)
+            expect(CHARACTER_LOWER).to.include(data)
+        })
+        doit('Random.character("upper")', function(data) {
+            expect(data).to.be.a('string').with.length(1)
+            expect(CHARACTER_UPPER).to.include(data)
+        })
+        doit('Random.character("number")', function(data) {
+            expect(data).to.be.a('string').with.length(1)
+            expect(CHARACTER_NUMBER).to.include(data)
+        })
+        doit('Random.character("symbol")', function(data) {
+            expect(data).to.be.a('string').with.length(1)
+            expect(CHARACTER_SYMBOL).to.include(data)
+        })
+        doit('Random.character("aeiou")', function(data) {
+            expect(data).to.be.a('string').with.length(1)
+            expect('aeiou').to.include(data)
+        })
+
+        doit('Random.string()', function(data) {
+            expect(data).to.be.a('string').with.length.within(3, 7)
+        })
+        doit('Random.string(5)', function(data) {
+            expect(data).to.be.a('string').with.length(5)
+        })
+        doit('Random.string("lower", 5)', function(data) {
+            expect(data).to.be.a('string').with.length(5)
+            for (var i = 0; i < data.length; i++) {
+                expect(CHARACTER_LOWER).to.include(data[i])
+            }
+        })
+        doit('Random.string(7, 10)', function(data) {
+            expect(data).to.be.a('string').with.length.within(7, 10)
+        })
+        doit('Random.string("aeiou", 1, 3)', function(data) {
+            expect(data).to.be.a('string').with.length.within(1, 3)
+            for (var i = 0; i < data.length; i++) {
+                expect('aeiou').to.include(data[i])
+            }
+        })
+
+        doit('Random.range(10)', function(data) {
+            expect(data).to.be.an('array').with.length(10)
+        })
+        doit('Random.range(3, 7)', function(data) {
+            expect(data).to.be.an('array').deep.equal([3, 4, 5, 6])
+        })
+        doit('Random.range(1, 10, 2)', function(data) {
+            expect(data).to.be.an('array').deep.equal([1, 3, 5, 7, 9])
+        })
+        doit('Random.range(1, 10, 3)', function(data) {
+            expect(data).to.be.an('array').deep.equal([1, 4, 7])
+        })
+
+        var RE_DATE = /\d{4}-\d{2}-\d{2}/
+        var RE_TIME = /\d{2}:\d{2}:\d{2}/
+        var RE_DATETIME = new RegExp(RE_DATE.source + ' ' + RE_TIME.source)
+
+        doit('Random.date()', function(data) {
+            expect(RE_DATE.test(data)).to.be.true
+        })
+
+        doit('Random.time()', function(data) {
+            expect(RE_TIME.test(data)).to.be.true
+        })
+
+        doit('Random.datetime()', function(data) {
+            expect(RE_DATETIME.test(data)).to.be.true
+        })
+        doit('Random.datetime("yyyy-MM-dd A HH:mm:ss")', function(data) {
+            expect(data).to.be.ok
+        })
+        doit('Random.datetime("yyyy-MM-dd a HH:mm:ss")', function(data) {
+            expect(data).to.be.ok
+        })
+        doit('Random.datetime("yy-MM-dd HH:mm:ss")', function(data) {
+            expect(data).to.be.ok
+        })
+        doit('Random.datetime("y-MM-dd HH:mm:ss")', function(data) {
+            expect(data).to.be.ok
+        })
+        doit('Random.datetime("y-M-d H:m:s")', function(data) {
+            expect(data).to.be.ok
+        })
+        doit('Random.datetime("yyyy yy y MM M dd d HH H hh h mm m ss s SS S A a T")', function(data) {
+            expect(data).to.be.ok
+        })
+
+        doit('Random.now()', function(data) {
+            expect(data).to.be.ok
+        })
+        doit('Random.now("year")', function(data) {
+            expect(data).to.be.ok
+        })
+        doit('Random.now("month")', function(data) {
+            expect(data).to.be.ok
+        })
+        doit('Random.now("day")', function(data) {
+            expect(data).to.be.ok
+        })
+        doit('Random.now("hour")', function(data) {
+            expect(data).to.be.ok
+        })
+        doit('Random.now("minute")', function(data) {
+            expect(data).to.be.ok
+        })
+        doit('Random.now("second")', function(data) {
+            expect(data).to.be.ok
+        })
+        doit('Random.now("week")', function(data) {
+            expect(data).to.be.ok
+        })
+        doit('Random.now("yyyy-MM-dd HH:mm:ss SS")', function(data) {
+            expect(data).to.be.ok
+        })
+    })
+
+    describe('Image', function() {
+        doit('Random.image()', function(data) {
+            expect(data).to.be.ok
+        })
+        it('Random.dataImage()', function() {
+            var data = eval(this.test.title)
+            expect(data).to.be.ok
+            this.test.title = stringify(this.test.title) + ' => '
+        })
+        it('Random.dataImage("200x100")', function() {
+            var data = eval(this.test.title)
+            expect(data).to.be.ok
+            this.test.title = stringify(this.test.title) + ' => '
+        })
+        it('Random.dataImage("200x100", "Hello Mock.js!")', function() {
+            var data = eval(this.test.title)
+            expect(data).to.be.ok
+            this.test.title = stringify(this.test.title) + ' => '
+        })
+    })
+
+    var RE_COLOR = /^#[0-9a-fA-F]{6}$/
+    var RE_COLOR_RGB = /^rgb\(\d{1,3}, \d{1,3}, \d{1,3}\)$/
+    var RE_COLOR_RGBA = /^rgba\(\d{1,3}, \d{1,3}, \d{1,3}, 0\.\d{1,2}\)$/
+    var RE_COLOR_HSL = /^hsl\(\d{1,3}, \d{1,3}, \d{1,3}\)$/
+    describe('Color', function() {
+        doit('Random.color()', function(data) {
+            expect(RE_COLOR.test(data)).to.true
+        })
+        doit('Random.hex()', function(data) {
+            expect(RE_COLOR.test(data)).to.true
+        })
+        doit('Random.rgb()', function(data) {
+            expect(RE_COLOR_RGB.test(data)).to.true
+        })
+        doit('Random.rgba()', function(data) {
+            expect(RE_COLOR_RGBA.test(data)).to.true
+        })
+        doit('Random.hsl()', function(data) {
+            expect(RE_COLOR_HSL.test(data)).to.true
+        })
+    })
+
+    describe('Text', function() {
+        doit('Random.paragraph()', function(data) {
+            expect(data.split('.').length - 1).to.within(3, 7)
+        })
+        doit('Random.paragraph(2)', function(data) {
+            expect(data.split('.').length - 1).to.equal(2)
+        })
+        doit('Random.paragraph(1, 3)', function(data) {
+            expect(data.split('.').length - 1).to.within(1, 3)
+        })
+
+        doit('Random.sentence()', function(data) {
+            expect(data[0]).to.equal(data.toUpperCase()[0])
+            expect(data.split(' ').length).to.within(12, 18)
+        })
+        doit('Random.sentence(4)', function(data) {
+            expect(data[0]).to.equal(data.toUpperCase()[0])
+            expect(data.split(' ').length).to.equal(4)
+        })
+        doit('Random.sentence(3, 5)', function(data) {
+            expect(data[0]).to.equal(data.toUpperCase()[0])
+            expect(data.split(' ').length).to.within(3, 5)
+        })
+
+        doit('Random.word()', function(data) {
+            expect(data).to.have.length.within(3, 10)
+        })
+        doit('Random.word(4)', function(data) {
+            expect(data).to.have.length(4)
+        })
+        doit('Random.word(3, 5)', function(data) {
+            expect(data).to.have.length.within(3, 5)
+        })
+
+        doit('Random.title()', function(data) {
+            var words = data.split(' ')
+            _.each(words, function(word) {
+                expect(word[0]).to.equal(word[0].toUpperCase())
+            })
+            expect(words).to.have.length.within(3, 7)
+        })
+        doit('Random.title(4)', function(data) {
+            var words = data.split(' ')
+            _.each(words, function(word) {
+                expect(word[0]).to.equal(word[0].toUpperCase())
+            })
+            expect(words).to.have.length(4)
+        })
+        doit('Random.title(3, 5)', function(data) {
+            var words = data.split(' ')
+            _.each(words, function(word) {
+                expect(word[0]).to.equal(word[0].toUpperCase())
+            })
+            expect(words).to.have.length.within(3, 5)
+        })
+    })
+
+    describe('Name', function() {
+        doit('Random.first()', function(data) {
+            expect(data[0]).to.equal(data[0].toUpperCase())
+        })
+        doit('Random.last()', function(data) {
+            expect(data[0]).to.equal(data[0].toUpperCase())
+        })
+        doit('Random.name()', function(data) {
+            var words = data.split(' ')
+            expect(words).to.have.length(2)
+            expect(words[0][0]).to.equal(words[0][0].toUpperCase())
+            expect(words[1][0]).to.equal(words[1][0].toUpperCase())
+        })
+        doit('Random.name(true)', function(data) {
+            var words = data.split(' ')
+            expect(words).to.have.length(3)
+            expect(words[0][0]).to.equal(words[0][0].toUpperCase())
+            expect(words[1][0]).to.equal(words[1][0].toUpperCase())
+            expect(words[2][0]).to.equal(words[2][0].toUpperCase())
+        })
+
+        doit('Random.cfirst()', function(data) {
+            expect(data).to.be.ok
+        })
+        doit('Random.clast()', function(data) {
+            expect(data).to.be.ok
+        })
+        doit('Random.cname()', function(data) {
+            expect(data).to.be.ok
+        })
+    })
+
+    var RE_URL = /^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/
+    var RE_IP = /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/
+    describe('Web', function() {
+        doit('Random.url()', function(data) {
+            expect(RE_URL.test(data)).to.be.true
+        })
+        doit('Random.domain()', function(data) {
+            expect(data).to.be.ok
+        })
+        doit('Random.domain("com")', function(data) {
+            expect(data).to.include('.com')
+        })
+        doit('Random.tld()', function(data) {
+            expect(data).to.be.ok
+        })
+
+        doit('Random.email()', function(data) {
+            expect(data).to.be.ok
+        })
+        doit('Random.email("nuysoft.com")', function(data) {
+            expect(data).to.include('@nuysoft.com')
+        })
+        doit('Random.ip()', function(data) {
+            expect(RE_IP.test(data)).to.be.true
+        })
+    })
+    describe('Address', function() {
+        doit('Random.region()', function(data) {
+            expect(data).to.be.ok
+        })
+        doit('Random.province()', function(data) {
+            expect(data).to.be.ok
+        })
+        doit('Random.city()', function(data) {
+            expect(data).to.be.ok
+        })
+        doit('Random.city(true)', function(data) {
+            expect(data).to.be.ok
+        })
+        doit('Random.county()', function(data) {
+            expect(data).to.be.ok
+        })
+        doit('Random.county(true)', function(data) {
+            expect(data).to.be.ok
+        })
+        doit('Random.zip()', function(data) {
+            expect(data).to.be.ok
+        })
+    })
+    describe('Helpers', function() {
+        doit('Random.capitalize()', function(data) {
+            expect(data).to.equal('Undefined')
+        })
+        doit('Random.capitalize("hello")', function(data) {
+            expect(data).to.equal('Hello')
+        })
+
+        doit('Random.upper()', function(data) {
+            expect(data).to.equal('UNDEFINED')
+        })
+        doit('Random.upper("hello")', function(data) {
+            expect(data).to.equal('HELLO')
+        })
+
+        doit('Random.lower()', function(data) {
+            expect(data).to.equal('undefined')
+        })
+        doit('Random.lower("HELLO")', function(data) {
+            expect(data).to.equal('hello')
+        })
+
+        doit('Random.pick()', function(data) {
+            expect(data).to.be.undefined
+        })
+        doit('Random.pick("a", "e", "i", "o", "u")', function(data) {
+            expect(["a", "e", "i", "o", "u"]).to.include(data)
+        })
+        doit('Random.pick(["a", "e", "i", "o", "u"])', function(data) {
+            expect(["a", "e", "i", "o", "u"]).to.include(data)
+        })
+        doit('Random.pick(["a", "e", "i", "o", "u"], 3)', function(data) {
+            expect(data).to.be.an('array').with.length(3)
+        })
+        doit('Random.pick(["a", "e", "i", "o", "u"], 1, 5)', function(data) {
+            expect(data).to.be.an('array').with.length.within(1, 5)
+        })
+
+        doit('Random.shuffle()', function(data) {
+            expect(data).to.deep.equal([])
+        })
+        doit('Random.shuffle(["a", "e", "i", "o", "u"])', function(data) {
+            expect(data.join('')).to.not.equal('aeiou')
+            expect(data.sort().join('')).to.equal('aeiou')
+        })
+        doit('Random.shuffle(["a", "e", "i", "o", "u"], 3)', function(data) {
+            expect(data).to.be.an('array').with.length(3)
+        })
+        doit('Random.shuffle(["a", "e", "i", "o", "u"], 1, 5)', function(data) {
+            expect(data).to.be.an('array').with.length.within(1, 5)
+        })
+    })
+
+    var RE_GUID = /[a-fA-F0-9]{8}\-[a-fA-F0-9]{4}\-[a-fA-F0-9]{4}\-[a-fA-F0-9]{4}\-[a-fA-F0-9]{12}/
+    describe('Miscellaneous', function() {
+        doit('Random.guid()', function(data) {
+            expect(data).to.be.a('string').with.length(36)
+            expect(RE_GUID.test(data)).to.be.true
+        })
+        doit('Random.id()', function(data) {
+            expect(data).to.be.a('string').with.length(18)
+        })
+    })
+})

+ 445 - 0
node_modules/.1.0.1-beta3@mockjs/test/test.mock.request.js

@@ -0,0 +1,445 @@
+/* global console, require, chai, describe, before, it */
+// 数据占位符定义(Data Placeholder Definition,DPD)
+var expect = chai.expect
+var Mock, $, _
+
+describe('Request', function() {
+    before(function(done) {
+        require(['mock', 'underscore', 'jquery'], function() {
+            Mock = arguments[0]
+            _ = arguments[1]
+            $ = arguments[2]
+            expect(Mock).to.not.equal(undefined)
+            expect(_).to.not.equal(undefined)
+            expect($).to.not.equal(undefined)
+            done()
+        })
+    })
+
+    function stringify(json) {
+        return JSON.stringify(json /*, null, 4*/ )
+    }
+
+    describe('jQuery.ajax()', function() {
+        it('', function(done) {
+            var that = this
+            var url = Math.random()
+            $.ajax({
+                url: url,
+                dataType: 'json'
+            }).done(function( /*data, textStatus, jqXHR*/ ) {
+                // 不会进入
+            }).fail(function(jqXHR /*, textStatus, errorThrown*/ ) {
+                // 浏览器 || PhantomJS
+                expect([404, 0]).to.include(jqXHR.status)
+                that.test.title += url + ' => ' + jqXHR.status
+            }).always(function() {
+                done()
+            })
+        })
+    })
+    describe('jQuery.getScript()', function() {
+        it('', function(done) {
+            var that = this
+            var url = './materiels/noop.js'
+            $.getScript(url, function(script, textStatus, jqXHR) {
+                expect(script).to.be.ok
+                that.test.title += url + ' => ' + jqXHR.status + ' ' + textStatus
+                done()
+            })
+        })
+    })
+    describe('jQuery.load()', function() {
+        it('', function(done) {
+            var that = this
+            var url = './materiels/noop.html'
+            $('<div>').load(url, function(responseText /*, textStatus, jqXHR*/ ) {
+                expect(responseText).to.be.ok
+                that.test.title += url + ' => ' + responseText
+                done()
+            })
+        })
+    })
+    describe('jQuery.ajax() XHR Fields', function() {
+        it('', function(done) {
+            var that = this
+            var url = Math.random()
+            var xhr
+            $.ajax({
+                xhr: function() {
+                    xhr = $.ajaxSettings.xhr()
+                    return xhr
+                },
+                url: url,
+                dataType: 'json',
+                xhrFields: {
+                    timeout: 123,
+                    withCredentials: true
+                }
+            }).done(function( /*data, textStatus, jqXHR*/ ) {
+                // 不会进入
+            }).fail(function(jqXHR /*, textStatus, errorThrown*/ ) {
+                // 浏览器 || PhantomJS
+                expect([404, 0]).to.include(jqXHR.status)
+                that.test.title += url + ' => ' + jqXHR.status
+                expect(xhr.timeout).to.be.equal(123)
+                expect(xhr.withCredentials).to.be.equal(true)
+            }).always(function() {
+                done()
+            })
+        })
+    })
+
+    describe('Mock.mock( rurl, template )', function() {
+        it('', function(done) {
+            var that = this
+            var url = 'rurl_template.json'
+
+            Mock.mock(/rurl_template.json/, {
+                'list|1-10': [{
+                    'id|+1': 1,
+                    'email': '@EMAIL'
+                }]
+            })
+
+            Mock.setup({
+                // timeout: 100,
+                timeout: '10-50',
+            })
+            $.ajax({
+                url: url,
+                dataType: 'json'
+            }).done(function(data /*, textStatus, jqXHR*/ ) {
+                that.test.title += url + ' => ' + stringify(data)
+                expect(data).to.have.property('list')
+                    .that.be.an('array').with.length.within(1, 10)
+                _.each(data.list, function(item, index, list) {
+                    if (index > 0) expect(item.id).to.be.equal(list[index - 1].id + 1)
+                })
+            }).fail(function(jqXHR, textStatus, errorThrown) {
+                console.log(jqXHR, textStatus, errorThrown)
+            }).always(function() {
+                done()
+            })
+        })
+    })
+
+    describe('Mock.mock( rurl, function(options) )', function() {
+        it('', function(done) {
+            var that = this
+            var url = 'rurl_function.json'
+
+            Mock.mock(/rurl_function\.json/, function(options) {
+                expect(options).to.not.equal(undefined)
+                expect(options.url).to.be.equal(url)
+                expect(options.type).to.be.equal('GET')
+                expect(options.body).to.be.equal(null)
+                return Mock.mock({
+                    'list|1-10': [{
+                        'id|+1': 1,
+                        'email': '@EMAIL'
+                    }]
+                })
+            })
+
+            $.ajax({
+                url: url,
+                dataType: 'json'
+            }).done(function(data /*, status, jqXHR*/ ) {
+                that.test.title += url + ' => ' + stringify(data)
+                expect(data).to.have.property('list')
+                    .that.be.an('array').with.length.within(1, 10)
+                _.each(data.list, function(item, index, list) {
+                    if (index > 0) expect(item.id).to.be.equal(list[index - 1].id + 1)
+                })
+            }).fail(function(jqXHR, textStatus, errorThrown) {
+                console.log(jqXHR, textStatus, errorThrown)
+            }).always(function() {
+                done()
+            })
+        })
+    })
+
+    describe('Mock.mock( rurl, function(options) ) + GET + data', function() {
+        it('', function(done) {
+            var that = this
+            var url = 'rurl_function.json'
+
+            Mock.mock(/rurl_function\.json/, function(options) {
+                expect(options).to.not.equal(undefined)
+                expect(options.url).to.be.equal(url + '?foo=1')
+                expect(options.type).to.be.equal('GET')
+                expect(options.body).to.be.equal(null)
+                return Mock.mock({
+                    'list|1-10': [{
+                        'id|+1': 1,
+                        'email': '@EMAIL'
+                    }]
+                })
+            })
+
+            $.ajax({
+                url: url,
+                dataType: 'json',
+                data: {
+                    foo: 1
+                }
+            }).done(function(data /*, status, jqXHR*/ ) {
+                that.test.title += url + ' => ' + stringify(data)
+                expect(data).to.have.property('list')
+                    .that.be.an('array').with.length.within(1, 10)
+                _.each(data.list, function(item, index, list) {
+                    if (index > 0) expect(item.id).to.be.equal(list[index - 1].id + 1)
+                })
+            }).fail(function(jqXHR, textStatus, errorThrown) {
+                console.log(jqXHR, textStatus, errorThrown)
+            }).always(function() {
+                done()
+            })
+        })
+    })
+
+    describe('Mock.mock( rurl, function(options) ) + POST + data', function() {
+        it('', function(done) {
+            var that = this
+            var url = 'rurl_function.json'
+
+            Mock.mock(/rurl_function\.json/, function(options) {
+                expect(options).to.not.equal(undefined)
+                expect(options.url).to.be.equal(url)
+                expect(options.type).to.be.equal('POST')
+                expect(options.body).to.be.equal('foo=1')
+                return Mock.mock({
+                    'list|1-10': [{
+                        'id|+1': 1,
+                        'email': '@EMAIL'
+                    }]
+                })
+            })
+
+            $.ajax({
+                url: url,
+                type: 'post',
+                dataType: 'json',
+                data: {
+                    foo: 1
+                }
+            }).done(function(data /*, status, jqXHR*/ ) {
+                that.test.title += url + ' => ' + stringify(data)
+                expect(data).to.have.property('list')
+                    .that.be.an('array').with.length.within(1, 10)
+                _.each(data.list, function(item, index, list) {
+                    if (index > 0) expect(item.id).to.be.equal(list[index - 1].id + 1)
+                })
+            }).fail(function(jqXHR, textStatus, errorThrown) {
+                console.log(jqXHR, textStatus, errorThrown)
+            }).always(function() {
+                done()
+            })
+        })
+    })
+
+    describe('Mock.mock( rurl, rtype, template )', function() {
+        it('', function(done) {
+            var that = this
+            var url = 'rurl_rtype_template.json'
+            var count = 0
+
+            Mock.mock(/rurl_rtype_template\.json/, 'get', {
+                'list|1-10': [{
+                    'id|+1': 1,
+                    'email': '@EMAIL',
+                    type: 'get'
+                }]
+            })
+            Mock.mock(/rurl_rtype_template\.json/, 'post', {
+                'list|1-10': [{
+                    'id|+1': 1,
+                    'email': '@EMAIL',
+                    type: 'post'
+                }]
+            })
+
+            $.ajax({
+                url: url,
+                type: 'get',
+                dataType: 'json'
+            }).done(function(data /*, status, jqXHR*/ ) {
+                that.test.title += 'GET ' + url + ' => ' + stringify(data) + ' '
+                expect(data).to.have.property('list')
+                    .that.be.an('array').with.length.within(1, 10)
+                _.each(data.list, function(item, index, list) {
+                    if (index > 0) expect(item.id).to.be.equal(list[index - 1].id + 1)
+                    expect(item).to.have.property('type').equal('get')
+                })
+            }).done(success).always(complete)
+
+            $.ajax({
+                url: url,
+                type: 'post',
+                dataType: 'json'
+            }).done(function(data /*, status, jqXHR*/ ) {
+                that.test.title += 'POST ' + url + ' => ' + stringify(data) + ' '
+                expect(data).to.have.property('list')
+                    .that.be.an('array').with.length.within(1, 10)
+                _.each(data.list, function(item, index, list) {
+                    if (index > 0) expect(item.id).to.be.equal(list[index - 1].id + 1)
+                    expect(item).to.have.property('type').equal('post')
+                })
+            }).done(success).always(complete)
+
+            function success( /*data*/ ) {
+                count++
+            }
+
+            function complete() {
+                if (count === 2) done()
+            }
+
+        })
+    })
+
+    describe('Mock.mock( rurl, rtype, function(options) )', function() {
+        it('', function(done) {
+            var that = this
+            var url = 'rurl_rtype_function.json'
+            var count = 0
+
+            Mock.mock(/rurl_rtype_function\.json/, /get/, function(options) {
+                expect(options).to.not.equal(undefined)
+                expect(options.url).to.be.equal(url)
+                expect(options.type).to.be.equal('GET')
+                expect(options.body).to.be.equal(null)
+                return {
+                    type: 'get'
+                }
+            })
+            Mock.mock(/rurl_rtype_function\.json/, /post|put/, function(options) {
+                expect(options).to.not.equal(undefined)
+                expect(options.url).to.be.equal(url)
+                expect(['POST', 'PUT']).to.include(options.type)
+                expect(options.body).to.be.equal(null)
+                return {
+                    type: options.type.toLowerCase()
+                }
+            })
+
+            $.ajax({
+                url: url,
+                type: 'get',
+                dataType: 'json'
+            }).done(function(data /*, status, jqXHR*/ ) {
+                that.test.title += 'GET ' + url + ' => ' + stringify(data)
+                expect(data).to.have.property('type', 'get')
+            }).done(success).always(complete)
+
+            $.ajax({
+                url: url,
+                type: 'post',
+                dataType: 'json'
+            }).done(function(data /*, status, jqXHR*/ ) {
+                that.test.title += 'POST ' + url + ' => ' + stringify(data)
+                expect(data).to.have.property('type', 'post')
+            }).done(success).always(complete)
+
+            $.ajax({
+                url: url,
+                type: 'put',
+                dataType: 'json'
+            }).done(function(data /*, status, jqXHR*/ ) {
+                that.test.title += 'PUT ' + url + ' => ' + stringify(data)
+                expect(data).to.have.property('type', 'put')
+            }).done(success).always(complete)
+
+
+            function success( /*data*/ ) {
+                count++
+            }
+
+            function complete() {
+                if (count === 3) done()
+            }
+
+        })
+    })
+    describe('Mock.mock( rurl, rtype, function(options) ) + data', function() {
+        it('', function(done) {
+            var that = this
+            var url = 'rurl_rtype_function.json'
+            var count = 0
+
+            Mock.mock(/rurl_rtype_function\.json/, /get/, function(options) {
+                expect(options).to.not.equal(undefined)
+                expect(options.url).to.be.equal(url + '?foo=1')
+                expect(options.type).to.be.equal('GET')
+                expect(options.body).to.be.equal(null)
+                return {
+                    type: 'get'
+                }
+            })
+            Mock.mock(/rurl_rtype_function\.json/, /post|put/, function(options) {
+                expect(options).to.not.equal(undefined)
+                expect(options.url).to.be.equal(url)
+                expect(['POST', 'PUT']).to.include(options.type)
+                expect(options.body).to.be.equal('foo=1')
+                return {
+                    type: options.type.toLowerCase()
+                }
+            })
+
+            $.ajax({
+                url: url,
+                type: 'get',
+                dataType: 'json',
+                data: {
+                    foo: 1
+                }
+            }).done(function(data /*, status, jqXHR*/ ) {
+                that.test.title += 'GET ' + url + ' => ' + stringify(data)
+                expect(data).to.have.property('type', 'get')
+            }).done(success).always(complete)
+
+            $.ajax({
+                url: url,
+                type: 'post',
+                dataType: 'json',
+                data: {
+                    foo: 1
+                }
+            }).done(function(data /*, status, jqXHR*/ ) {
+                that.test.title += 'POST ' + url + ' => ' + stringify(data)
+                expect(data).to.have.property('type', 'post')
+            }).done(success).always(complete)
+
+            $.ajax({
+                url: url,
+                type: 'put',
+                dataType: 'json',
+                data: {
+                    foo: 1
+                }
+            }).done(function(data /*, status, jqXHR*/ ) {
+                that.test.title += 'PUT ' + url + ' => ' + stringify(data)
+                expect(data).to.have.property('type', 'put')
+            }).done(success).always(complete)
+
+
+            function success( /*data*/ ) {
+                count++
+            }
+
+            function complete() {
+                if (count === 3) done()
+            }
+
+        })
+    })
+    describe('#105 addEventListener', function() {
+        it('addEventListene => addEventListener', function(done) {
+            var xhr = new Mock.XHR()
+            expect(xhr.addEventListener).to.not.equal(undefined)
+            expect(xhr.addEventListene).to.equal(undefined)
+            done()
+        })
+    })
+})

+ 205 - 0
node_modules/.1.0.1-beta3@mockjs/test/test.mock.schema.js

@@ -0,0 +1,205 @@
+/* global require, chai, describe, before, it */
+/* global window */
+// 数据占位符定义(Data Placeholder Definition,DPD)
+var expect = chai.expect
+var Mock, $, _
+
+describe('Schema', function() {
+    before(function(done) {
+        require(['mock', 'underscore', 'jquery'], function() {
+            Mock = arguments[0]
+            window.XMLHttpRequest = Mock.XHR
+            _ = arguments[1]
+            $ = arguments[2]
+            expect(Mock).to.not.equal(undefined)
+            expect(_).to.not.equal(undefined)
+            expect($).to.not.equal(undefined)
+            done()
+        })
+    })
+
+    function stringify(json) {
+        return JSON.stringify(json /*, null, 4*/ )
+    }
+
+    function doit(template, validator) {
+        it('', function() {
+            var schema = Mock.toJSONSchema(template)
+            this.test.title = (stringify(template) || template.toString()) + ' => ' + stringify(schema)
+            validator(schema)
+        })
+    }
+
+    describe('Type', function() {
+        doit(1, function(schema) {
+            expect(schema.name).to.be.an('undefined')
+                // expect(schema).to.not.have.property('name')
+            expect(schema).to.have.property('type', 'number')
+            for (var n in schema.rule) {
+                expect(schema.rule[n]).to.be.null()
+            }
+        })
+        doit(true, function(schema) {
+            expect(schema.name).to.be.an('undefined')
+                // expect(schema).to.not.have.property('name')
+            expect(schema).to.have.property('type', 'boolean')
+            for (var n in schema.rule) {
+                expect(schema.rule[n]).to.be.null()
+            }
+        })
+        doit('', function(schema) {
+            expect(schema.name).to.be.an('undefined')
+                // expect(schema).to.not.have.property('name')
+            expect(schema).to.have.property('type', 'string')
+            for (var n in schema.rule) {
+                expect(schema.rule[n]).to.be.null()
+            }
+        })
+        doit(function() {}, function(schema) {
+            expect(schema.name).to.be.an('undefined')
+                // expect(schema).to.not.have.property('name')
+            expect(schema).to.have.property('type', 'function')
+            for (var n in schema.rule) {
+                expect(schema.rule[n]).to.be.null()
+            }
+        })
+        doit(/\d/, function(schema) {
+            expect(schema.name).to.be.an('undefined')
+                // expect(schema).to.not.have.property('name')
+            expect(schema).to.have.property('type', 'regexp')
+            for (var n in schema.rule) {
+                expect(schema.rule[n]).to.be.null()
+            }
+        })
+        doit([], function(schema) {
+            expect(schema.name).to.be.an('undefined')
+                // expect(schema).to.not.have.property('name')
+            expect(schema).to.have.property('type', 'array')
+            for (var n in schema.rule) {
+                expect(schema.rule[n]).to.be.null()
+            }
+            expect(schema).to.have.property('items').with.length(0)
+        })
+        doit({}, function(schema) {
+            expect(schema.name).to.be.an('undefined')
+                // expect(schema).to.not.have.property('name')
+            expect(schema).to.have.property('type', 'object')
+            for (var n in schema.rule) {
+                expect(schema.rule[n]).to.be.null()
+            }
+            expect(schema).to.have.property('properties').with.length(0)
+        })
+
+    })
+
+    describe('Object', function() {
+        doit({
+            a: {
+                b: {
+                    c: {
+                        d: {}
+                    }
+                }
+            }
+        }, function(schema) {
+            expect(schema.name).to.be.an('undefined')
+                // expect(schema).to.not.have.property('name')
+            expect(schema).to.have.property('type', 'object')
+
+            var properties;
+
+            // root.properties
+            properties = schema.properties
+            expect(properties).to.with.length(1)
+            expect(properties[0]).to.have.property('name', 'a')
+            expect(properties[0]).to.have.property('type', 'object')
+
+            // root.a.properties
+            properties = properties[0].properties
+            expect(properties).to.with.length(1)
+            expect(properties[0]).to.have.property('name', 'b')
+            expect(properties[0]).to.have.property('type', 'object')
+
+            // root.a.b.properties
+            properties = properties[0].properties
+            expect(properties).to.with.length(1)
+            expect(properties[0]).to.have.property('name', 'c')
+            expect(properties[0]).to.have.property('type', 'object')
+
+            // root.a.b.c.properties
+            properties = properties[0].properties
+            expect(properties).to.with.length(1)
+            expect(properties[0]).to.have.property('name', 'd')
+            expect(properties[0]).to.have.property('type', 'object')
+
+            // root.a.b.c.d.properties
+            properties = properties[0].properties
+            expect(properties).to.with.length(0)
+        })
+
+    })
+
+    describe('Array', function() {
+        doit([
+            [
+                ['foo', 'bar']
+            ]
+        ], function(schema) {
+            expect(schema.name).to.be.an('undefined')
+                // expect(schema).to.not.have.property('name')
+            expect(schema).to.have.property('type', 'array')
+
+            var items;
+
+            // root.items
+            items = schema.items
+            expect(items).to.with.length(1)
+            expect(items[0]).to.have.property('type', 'array')
+
+            // root[0].items
+            items = items[0].items
+            expect(items).to.with.length(1)
+            expect(items[0]).to.have.property('type', 'array')
+
+            // root[0][0].items
+            items = items[0].items
+            expect(items).to.with.length(2)
+            expect(items[0]).to.have.property('type', 'string')
+            expect(items[1]).to.have.property('type', 'string')
+        })
+    })
+
+    describe('String Rule', function() {
+        doit({
+            'string|1-10': '★'
+        }, function(schema) {
+            expect(schema.name).to.be.an('undefined')
+                // expect(schema).to.not.have.property('name')
+            expect(schema).to.have.property('type', 'object')
+
+            var properties;
+            // root.properties
+            properties = schema.properties
+            expect(properties).to.with.length(1)
+            expect(properties[0]).to.have.property('type', 'string')
+            expect(properties[0].rule).to.have.property('min', 1)
+            expect(properties[0].rule).to.have.property('max', 10)
+        })
+        doit({
+            'string|3': 'value',
+        }, function(schema) {
+            expect(schema.name).to.be.an('undefined')
+                // expect(schema).to.not.have.property('name')
+            expect(schema).to.have.property('type', 'object')
+
+            var properties;
+            // root.properties
+            properties = schema.properties
+            expect(properties).to.with.length(1)
+            expect(properties[0]).to.have.property('type', 'string')
+            expect(properties[0].rule).to.have.property('min', 3)
+            expect(properties[0].rule.max).to.be.an('undefined')
+        })
+    })
+
+})

+ 238 - 0
node_modules/.1.0.1-beta3@mockjs/test/test.mock.spec.dpd.js

@@ -0,0 +1,238 @@
+/* global require, chai, describe, before, it */
+// 数据占位符定义(Data Placeholder Definition,DPD)
+var expect = chai.expect
+var Mock, $, _
+
+describe('DPD', function() {
+    before(function(done) {
+        require(['mock', 'underscore', 'jquery'], function() {
+            Mock = arguments[0]
+            _ = arguments[1]
+            $ = arguments[2]
+            expect(Mock).to.not.equal(undefined)
+            expect(_).to.not.equal(undefined)
+            expect($).to.not.equal(undefined)
+            done()
+        })
+    })
+    describe('Reference', function() {
+        it('@EMAIL', function() {
+            var data = Mock.mock(this.test.title)
+            expect(data).to.not.equal(this.test.title)
+        })
+    })
+    describe('Priority', function() {
+        it('@EMAIL', function() {
+            var data = Mock.mock({
+                email: 'nuysoft@gmail.com',
+                name: '@EMAIL'
+            })
+            this.test.title += ' => ' + data.name
+            expect(data.name).to.not.equal(data.email)
+        })
+        it('@email', function() {
+            var data = Mock.mock({
+                email: 'nuysoft@gmail.com',
+                name: '@email'
+            })
+            this.test.title += ' => ' + data.name
+            expect(data.name).to.equal(data.email)
+        })
+    })
+    describe('Escape', function() {
+        it('\@EMAIL', function() {
+            var data = Mock.mock(this.test.title)
+            this.test.title += ' => ' + data
+            expect(data).to.not.equal(this.test.title)
+        })
+        it('\\@EMAIL', function() {
+            var data = Mock.mock(this.test.title)
+            this.test.title += ' => ' + data
+            expect(data).to.not.equal(this.test.title)
+        })
+        it('\\\@EMAIL', function() {
+            var data = Mock.mock(this.test.title)
+            this.test.title += ' => ' + data
+            expect(data).to.not.equal(this.test.title)
+        })
+        it('\\\\@EMAIL', function() {
+            var data = Mock.mock(this.test.title)
+            this.test.title += ' => ' + data
+            expect(data).to.not.equal(this.test.title)
+        })
+    })
+    describe('Path', function() {
+        it('Absolute Path', function() {
+            var data = Mock.mock({
+                id: '@UUID',
+                children: [{
+                    parentId: '@/id'
+                }],
+                child: {
+                    parentId: '@/id'
+                }
+            })
+            expect(data.children[0]).to.have.property('parentId', data.id)
+            expect(data.child).to.have.property('parentId', data.id)
+        })
+        it('Relative Path', function() {
+            var data = Mock.mock({
+                id: '@UUID',
+                children: [{
+                    parentId: '@../../id'
+                }],
+                child: {
+                    parentId: '@../id'
+                }
+            })
+            expect(data.children[0]).to.have.property('parentId', data.id)
+            expect(data.child).to.have.property('parentId', data.id)
+        })
+
+    })
+    describe('Complex', function() {
+        var tpl = {
+            basics: {
+                boolean1: '@BOOLEAN',
+                boolean2: '@BOOLEAN(1, 9, true)',
+
+                natural1: '@NATURAL',
+                natural2: '@NATURAL(10000)',
+                natural3: '@NATURAL(60, 100)',
+
+                integer1: '@INTEGER',
+                integer2: '@INTEGER(10000)',
+                integer3: '@INTEGER(60, 100)',
+
+                float1: '@FLOAT',
+                float2: '@FLOAT(0)',
+                float3: '@FLOAT(60, 100)',
+                float4: '@FLOAT(60, 100, 3)',
+                float5: '@FLOAT(60, 100, 3, 5)',
+
+                character1: '@CHARACTER',
+                character2: '@CHARACTER("lower")',
+                character3: '@CHARACTER("upper")',
+                character4: '@CHARACTER("number")',
+                character5: '@CHARACTER("symbol")',
+                character6: '@CHARACTER("aeiou")',
+
+                string1: '@STRING',
+                string2: '@STRING(5)',
+                string3: '@STRING("lower",5)',
+                string4: '@STRING(7, 10)',
+                string5: '@STRING("aeiou", 1, 3)',
+
+                range1: '@RANGE(10)',
+                range2: '@RANGE(3, 7)',
+                range3: '@RANGE(1, 10, 2)',
+                range4: '@RANGE(1, 10, 3)',
+
+                date: '@DATE',
+                time: '@TIME',
+
+                datetime1: '@DATETIME',
+                datetime2: '@DATETIME("yyyy-MM-dd A HH:mm:ss")',
+                datetime3: '@DATETIME("yyyy-MM-dd a HH:mm:ss")',
+                datetime4: '@DATETIME("yy-MM-dd HH:mm:ss")',
+                datetime5: '@DATETIME("y-MM-dd HH:mm:ss")',
+                datetime6: '@DATETIME("y-M-d H:m:s")',
+
+                now: '@NOW',
+                nowYear: '@NOW("year")',
+                nowMonth: '@NOW("month")',
+                nowDay: '@NOW("day")',
+                nowHour: '@NOW("hour")',
+                nowMinute: '@NOW("minute")',
+                nowSecond: '@NOW("second")',
+                nowWeek: '@NOW("week")',
+                nowCustom: '@NOW("yyyy-MM-dd HH:mm:ss SS")'
+            },
+            image: {
+                image1: '@IMAGE',
+                image2: '@IMAGE("100x200", "#000")',
+                image3: '@IMAGE("100x200", "#000", "hello")',
+                image4: '@IMAGE("100x200", "#000", "#FFF", "hello")',
+                image5: '@IMAGE("100x200", "#000", "#FFF", "png", "hello")',
+
+                dataImage1: '@DATAIMAGE',
+                dataImage2: '@DATAIMAGE("200x100")',
+                dataImage3: '@DATAIMAGE("300x100", "Hello Mock.js!")'
+            },
+            color: {
+                color: '@COLOR',
+                render: function() {
+                    $('.header').css('background', this.color)
+                }
+            },
+            text: {
+                title1: '@TITLE',
+                title2: '@TITLE(5)',
+                title3: '@TITLE(3, 5)',
+
+                word1: '@WORD',
+                word2: '@WORD(5)',
+                word3: '@WORD(3, 5)',
+
+                sentence1: '@SENTENCE',
+                sentence2: '@SENTENCE(5)',
+                sentence3: '@SENTENCE(3, 5)',
+
+                paragraph1: '@PARAGRAPH',
+                paragraph2: '@PARAGRAPH(2)',
+                paragraph3: '@PARAGRAPH(1, 3)'
+            },
+            name: {
+                first: '@FIRST',
+                last: '@LAST',
+                name1: '@NAME',
+                name2: '@NAME(true)'
+            },
+            web: {
+                url: '@URL',
+                domain: '@DOMAIN',
+                email: '@EMAIL',
+                ip: '@IP',
+                tld: '@TLD',
+            },
+            address: {
+                region: '@REGION',
+                province: '@PROVINCE',
+                city: '@CITY',
+                county: '@COUNTY'
+            },
+            miscellaneous: {
+                guid: '@GUID',
+                id: '@ID',
+                'increment1|3': [
+                    '@INCREMENT'
+                ],
+                'increment2|3': [
+                    '@INCREMENT(10)'
+                ]
+            },
+            helpers: {
+                capitalize1: '@CAPITALIZE()',
+                capitalize2: '@CAPITALIZE("hello")',
+
+                upper1: '@UPPER',
+                upper2: '@UPPER("hello")',
+
+                lower1: '@LOWER',
+                lower2: '@LOWER("HELLO")',
+
+                pick1: '@PICK',
+                pick2: '@PICK("abc")',
+                pick3: '@PICK(["a", "b", "c"])',
+
+                shuffle1: '@SHUFFLE',
+                shuffle2: '@SHUFFLE(["a", "b", "c"])'
+            }
+        }
+        it('', function() {
+            var data = Mock.mock(tpl)
+            // this.test.title += JSON.stringify(data, null, 4)
+            expect(data).to.be.a('object')
+        })
+    })
+})

+ 677 - 0
node_modules/.1.0.1-beta3@mockjs/test/test.mock.spec.dtd.js

@@ -0,0 +1,677 @@
+/* global require, chai, describe, before, it */
+// 数据模板定义(Data Temaplte Definition,DTD)
+/*
+    ## BDD
+    1. 结构 
+        describe suite
+            [ describe ]
+            before after beforeEach afterEach
+            it test
+        done
+            搜索 this.async = fn && fn.length
+    2. 常用 expect
+        expect().to
+            .equal .deep.equal .not.equal
+            .match
+            .have.length .with.length
+            .have.property .have.deep.property
+            .to.be.a .to.be.an
+            .that
+            .least .most .within
+    3. 速度 
+        搜索 test.speed
+        slow > 75
+        75 / 2 < medium < 75
+        fast < 75 / 2
+ */
+var expect = chai.expect
+var Mock, $, _
+
+describe('DTD', function() {
+    before(function(done) {
+        require(['mock', 'underscore', 'jquery'], function() {
+            Mock = arguments[0]
+            _ = arguments[1]
+            $ = arguments[2]
+            expect(Mock).to.not.equal(undefined)
+            expect(_).to.not.equal(undefined)
+            expect($).to.not.equal(undefined)
+            done()
+        })
+    })
+    describe('Literal', function() {
+        it('', function() {
+            var data = Mock.mock(this.test.title)
+            expect(data).to.equal(this.test.title)
+        })
+        it('foo', function() {
+            var data = Mock.mock(this.test.title)
+            expect(data).to.equal(this.test.title)
+        })
+        it(1, function() {
+            var data = Mock.mock(this.test.title)
+            expect(data).to.equal(this.test.title)
+        })
+        it(true, function() {
+            var data = Mock.mock(this.test.title)
+            expect(data).to.equal(this.test.title)
+        })
+        it(false, function() {
+            var data = Mock.mock(this.test.title)
+            expect(data).to.equal(this.test.title)
+        })
+        it({}, function() {
+            var data = Mock.mock(this.test.title)
+            expect(data).to.deep.equal(this.test.title)
+        })
+        it([], function() {
+            var data = Mock.mock(this.test.title)
+            expect(data).to.deep.equal(this.test.title)
+        })
+        it(function() {}, function() {
+            var data = Mock.mock(this.test.title)
+            expect(data).to.equal(undefined)
+        })
+    })
+    describe('String', function() {
+        // `'name|min-max': 'value'`
+        it('name|min-max', function() {
+            var data = Mock.mock({
+                'name|1-10': '★号'
+            })
+            expect(data.name).to.have.length.within(2, 20)
+        })
+
+        // `'name|count': 'value'`
+        it('name|count', function() {
+            var data = Mock.mock({
+                'name|10': '★号'
+            })
+            expect(data.name).to.be.a('string')
+                .that.have.length(20)
+        })
+    })
+    describe('Number', function() {
+        // `'name|+step': value`
+        it('name|+step', function() {
+            var data = Mock.mock({
+                'list|10': [{
+                    'name|+1': 100
+                }]
+            })
+            expect(data.list).to.be.an('array').with.length(10)
+            _.each(data.list, function(item, index) {
+                expect(item).to.have.property('name')
+                    .that.be.a('number')
+                if (index === 0) expect(item.name).to.equal(100)
+                else expect(item.name).to.equal(
+                    data.list[index - 1].name + 1
+                )
+            })
+        })
+
+        // `'name|min-max': value`
+        it('name|min-max', function() {
+            var data = Mock.mock({
+                'name|1-100': 100
+            })
+            expect(data).to.have.property('name')
+                .that.be.a('number').within(1, 100)
+        })
+        it('name|max-min', function() {
+            var data = Mock.mock({
+                'name|100-1': 100
+            })
+            expect(data).to.have.property('name')
+                .that.be.a('number').within(1, 100)
+        })
+        it('name|-min--max', function() {
+            var data = Mock.mock({
+                'name|-100--1': 100
+            })
+            expect(data).to.have.property('name')
+                .that.be.a('number').within(-100, -1)
+        })
+        it('name|-max--min', function() {
+            var data = Mock.mock({
+                'name|-1--100': 100
+            })
+            expect(data).to.have.property('name')
+                .that.be.a('number').within(-100, -1)
+        })
+        it('name|min-min', function() {
+            var data = Mock.mock({
+                'name|10-10': 100
+            })
+            expect(data).to.have.property('name')
+                .that.be.a('number').equal(10)
+        })
+        it('name|count', function() {
+            var data = Mock.mock({
+                'name|10': 100
+            })
+            expect(data).to.have.property('name')
+                .that.be.a('number').equal(10)
+        })
+
+        // `'name|min-max.dmin-dmax': value`
+
+        // 1 整数部分 2 小数部分
+        var RE_FLOAT = /([\+\-]?\d+)\.?(\d+)?/
+
+        function validNumber(number, min, max, dmin, dmax) {
+            expect(number).to.be.a('number')
+            RE_FLOAT.lastIndex = 0
+            var parts = RE_FLOAT.exec('' + number)
+            expect(+parts[1]).to.be.a('number').within(min, max)
+            expect(parts[2]).to.have.length.within(dmin, dmax)
+        }
+
+        it('name|min-max.dmin-dmax', function() {
+            var data = Mock.mock({
+                'name|1-10.1-10': 123.456
+            })
+            validNumber(data.name, 1, 10, 1, 10)
+        })
+        it('name|min-max.dcount', function() {
+            var data = Mock.mock({
+                'name|1-10.10': 123.456
+            })
+            validNumber(data.name, 1, 10, 10, 10)
+        })
+        it('name|count.dmin-dmax', function() {
+            var data = Mock.mock({
+                'name|10.1-10': 123.456
+            })
+            validNumber(data.name, 10, 10, 1, 10)
+        })
+        it('name|count.dcount', function() {
+            var data = Mock.mock({
+                'name|10.10': 123.456
+            })
+            validNumber(data.name, 10, 10, 10, 10)
+        })
+        it('name|.dmin-dmax', function() {
+            var data = Mock.mock({
+                'name|.1-10': 123.456
+            })
+            validNumber(data.name, 123, 123, 1, 10)
+        })
+        it('name|.dcount', function() {
+            var data = Mock.mock({
+                'name|.10': 123.456
+            })
+            validNumber(data.name, 123, 123, 10, 10)
+        })
+    })
+    describe('Boolean', function() {
+        // `'name|1': value` 
+        it('name|1', function() {
+            var data = Mock.mock({
+                'name|1': true
+            })
+            expect(data).to.have.property('name')
+                .that.be.a('boolean')
+        })
+
+        // `'name|min-max': value`
+        it('name|min-max', function() {
+            var data = Mock.mock({
+                'name|8-2': true
+            })
+            expect(data).to.have.property('name')
+                .that.be.a('boolean')
+        })
+    })
+    describe('Object', function() {
+        var methods = {
+            GET: '@URL',
+            POST: '@URL',
+            HEAD: '@URL',
+            PUT: '@URL',
+            DELETE: '@URL'
+        }
+        var methodCount, tpl, data
+
+        // `'name|min-max': {}`
+        it('name|min-max', function() {
+            methodCount = _.keys(methods).length // 5
+            for (var min = 0, max; min <= methodCount + 1; min++) {
+                tpl = {}
+                max = Mock.Random.integer(0, methodCount)
+
+                // methods|0-? |1-? |2-? |3-? |4-? |5-? |6-?
+                tpl['methods|' + min + '-' + max] = methods
+                data = Mock.mock(tpl)
+                expect(_.keys(data.methods)).to.have.length
+                    .that.within(Math.min(min, max), Math.max(min, max))
+            }
+        })
+
+        // `'name|count': {}`
+        it('name|count', function() {
+            methodCount = _.keys(methods).length // 5
+            for (var count = 0; count <= methodCount + 1; count++) {
+                tpl = {}
+                tpl['methods|' + count] = methods
+                data = Mock.mock(tpl)
+                expect(_.keys(data.methods)).to.have.length(
+                    Math.min(count, methodCount)
+                )
+            }
+        })
+    })
+    describe('Array', function() {
+        // `'name': [{}, {} ...]`
+        it('name', function() {
+            var value = [{
+                foo: 'foo'
+            }, {
+                bar: 'bar'
+            }, {
+                foobar: 'foobar'
+            }]
+            var data = Mock.mock({
+                name: value
+            })
+            expect(data).to.have.property('name')
+                .that.be.an('array').with.length(3)
+                .that.not.equal(value)
+            expect(data).to.have.property('name')
+
+            for (var i = 0; i < data.name.length; i++) {
+                expect(data.name[i]).to.not.equal(value[i])
+                expect(data.name[i]).to.deep.equal(value[i])
+            }
+        })
+
+        // `'name|1': [{}, {} ...]`
+        it('name|1: [1, 2, 4, 8]', function() {
+            // number array
+            var value = [1, 2, 4, 8]
+            var data = Mock.mock({
+                'name|1': value
+            })
+            expect(data).to.have.property('name')
+                .that.be.a('number')
+            expect(value).to.include(data.name)
+        })
+        it('name|1: ["GET", "POST", "HEAD", "DELETE"]', function() {
+            // string array
+            var value = ['GET', 'POST', 'HEAD', 'DELETE']
+            var data = Mock.mock({
+                'name|1': value
+            })
+            expect(data).to.have.property('name')
+                .that.be.a('string')
+            expect(value).to.include(data.name)
+        })
+        it('name|1 [{}]', function() {
+            // object array
+            var value = [{}]
+            var data = Mock.mock({
+                'name|1': value
+            })
+            expect(data).to.have.property('name')
+                .that.be.a('object')
+                .that.deep.equal({})
+            expect(data.name).to.not.equal(value[0])
+        })
+        it('name|1 [{}, {}, {}]', function() {
+            // object array
+            var data = Mock.mock({
+                'name|1': [{}, {}, {}]
+            })
+            expect(data).to.have.property('name')
+                .that.be.a('object')
+                .that.deep.equal({})
+        })
+        it('name|1 [{}, {}, {}]', function() {
+            // object array
+            var value = [{
+                method: 'GET'
+            }, {
+                method: 'POST'
+            }, {
+                method: 'HEAD'
+            }, {
+                method: 'DELETE'
+            }]
+            var data = Mock.mock({
+                'name|1': value
+            })
+            expect(data).to.have.property('name')
+                .that.be.a('object')
+                .that.have.property('method')
+                .that.be.a('string')
+            expect(_.pluck(value, 'method')).include(data.name.method)
+        })
+
+        // `'name|+1': [{}, {} ...]`
+        it('name|+1: ["a", "b", "c"]', function() {
+            var data = Mock.mock({
+                'list|5': [{
+                    'name|+1': ['a', 'b', 'c']
+                }]
+            })
+            expect(data).to.have.property('list')
+                .that.be.an('array').with.length(5)
+            expect(data.list[0].name).to.equal('a')
+            expect(data.list[1].name).to.equal('b')
+            expect(data.list[2].name).to.equal('c')
+            expect(data.list[3].name).to.equal('a')
+            expect(data.list[4].name).to.equal('b')
+        })
+        it('name|+1: ["@integer", "@email", "@boolean"]', function() {
+            var data = Mock.mock({
+                'list|5-10': [{
+                    'name|+1': ['@integer', '@email', '@boolean']
+                }]
+            })
+            expect(data).to.have.property('list')
+                .that.be.an('array').have.length.within(5, 10)
+            expect(data.list[0].name).to.be.a('number')
+            expect(data.list[1].name).to.be.a('string')
+            expect(data.list[2].name).to.be.a('boolean')
+            expect(data.list[3].name).to.be.a('number')
+            expect(data.list[4].name).to.be.a('string')
+        })
+
+        // `'name|min-max': [{}, {} ...]`
+        it('name|min-min', function() {
+            var data = Mock.mock({
+                'name|1-1': [{}]
+            })
+            expect(data.name).to.be.an('array').with.length(1)
+            _.each(data.name, function(item /*, index*/ ) {
+                expect(item).to.deep.equal({})
+            })
+        })
+        it('name|min-max [{}]', function() {
+            var data = Mock.mock({
+                'name|1-10': [{}]
+            })
+            expect(data.name).to.be.an('array').with.length.within(1, 10)
+            _.each(data.name, function(item /*, index*/ ) {
+                expect(item).to.deep.equal({})
+            })
+        })
+        it('name|max-min [{}]', function() {
+            var data = Mock.mock({
+                'name|10-1': [{}]
+            })
+            expect(data.name).to.be.an('array').with.length.within(1, 10)
+            _.each(data.name, function(item /*, index*/ ) {
+                expect(item).to.deep.equal({})
+            })
+        })
+        it('name|min-max [{}, {}]', function() {
+            var data = Mock.mock({
+                'name|1-10': [{}, {}]
+            })
+            expect(data.name).to.be.an('array').with.length.within(2, 20)
+            _.each(data.name, function(item /*, index*/ ) {
+                expect(item).to.deep.equal({})
+            })
+        })
+        it('name|max-min [{}, {}]', function() {
+            var data = Mock.mock({
+                'name|10-1': [{}, {}]
+            })
+            expect(data.name).to.be.an('array').with.length.within(2, 20)
+            _.each(data.name, function(item /*, index*/ ) {
+                expect(item).to.deep.equal({})
+            })
+        })
+
+        // `'name|count': [{}, {} ...]`
+        it('name|count [{}]', function() {
+            var data = Mock.mock({
+                'name|10': [{}]
+            })
+            expect(data.name).to.be.an('array').with.length(10)
+            _.each(data.name, function(item /*, index*/ ) {
+                expect(item).to.deep.equal({})
+            })
+        })
+        it('name|count [{}, {}]', function() {
+            var data = Mock.mock({
+                'name|10': [{}, {}]
+            })
+            expect(data.name).to.be.an('array').with.length(20)
+            _.each(data.name, function(item /*, index*/ ) {
+                expect(item).to.deep.equal({})
+            })
+        })
+    })
+    describe('Function', function() {
+        // `'name': function(){}`
+        it('name: function', function() {
+            var data = Mock.mock({
+                prop: 'hello',
+                name: function( /*root, path*/ ) {
+                    return this.prop
+                }
+            })
+            expect(data).to.have.property('name')
+                .that.be.a('string').equal('hello')
+        })
+
+        // 无序的 function
+        it('name: function', function() {
+            var data = Mock.mock({
+                name2: function() {
+                    return this.prop * 2
+                },
+                prop: 1,
+                name4: function() {
+                    return this.prop * 4
+                }
+            })
+            expect(data.name2).to.equal(2)
+            expect(data.name4).to.equal(4)
+        })
+
+        // #25 改变了非函数属性的顺序,查找起来不方便
+        it('name: function', function() {
+            var data = Mock.mock({
+                name: function() {},
+                first: '',
+                second: '',
+                third: ''
+            })
+            var keys = _.keys(data)
+            expect(keys[0]).equal('first')
+            expect(keys[1]).equal('second')
+            expect(keys[2]).equal('third')
+            expect(keys[3]).equal('name')
+        })
+    })
+
+    /*
+        按照 http://www.regexr.com/ 的 Reference 设计测试用例。
+        https://github.com/nuysoft/Mock/blob/7c1e3a686bcc515855f1f583d70ae0ee89acc65e/test/regexp.js#L120
+     */
+    describe('RegExp', function() {
+        function validRegExp(regexp) {
+            if (arguments.length > 1) {
+                for (var i = 0; i < arguments.length; i++) {
+                    validRegExp(arguments[i])
+                }
+            }
+
+            it(regexp, function() {
+                var data = Mock.mock(regexp)
+                this.test.title += ' => ' + data
+                expect(regexp.test(data)).to.be.true
+            })
+        }
+
+        describe('Character Classes', function() {
+            validRegExp(/./)
+            validRegExp(
+                /[a-z]/,
+                /[A-Z]/,
+                /[0-9]/
+            )
+            validRegExp(
+                /\w/,
+                /\W/,
+                /\s/,
+                /\S/,
+                /\d/,
+                /\D/
+            )
+            validRegExp(
+                /[.]/,
+                /[\w]/,
+                /[\W]/,
+                /[\s]/,
+                /[\S]/,
+                /[\d]/,
+                /[\D]/
+            )
+            validRegExp(
+                /[^.]/,
+                /[^\w]/,
+                /[^\W]/,
+                /[^\s]/,
+                /[^\S]/,
+                /[^\d]/,
+                /[^\D]/
+            )
+        })
+        describe('Quantifiers', function() {
+            validRegExp(
+                /\d?/,
+                /\d+/,
+                /\d*/
+            )
+
+            // {n}, {n,}, {n,m}, {0,1} ?, {1,0} +, {0,} *
+            validRegExp(
+                /\d{5}/,
+                /\d{5,}/,
+                /\d{5,10}/,
+                /\d{0,1}/,
+                /\d{0,}/
+            )
+
+            validRegExp(/[\u4E00-\u9FA5]+/) // 汉字
+        })
+        describe('Anchors', function() {
+            validRegExp(/^/)
+            validRegExp(/$/)
+            validRegExp(/^foo/)
+            validRegExp(/foo$/)
+            validRegExp(/\bfoo/)
+            validRegExp(/\Bfoo/)
+        })
+
+        describe('Escaped Characters', function() {
+            validRegExp(/\000/)
+            validRegExp(/\xFF/)
+            validRegExp(/\uFFFF/)
+            validRegExp(/\cI/)
+        })
+
+        describe('Groups & Lookaround', function() {
+            validRegExp(/(ABC)/)
+            validRegExp(/(ABC)\1/)
+            validRegExp(/(?:ABC)/)
+            validRegExp(/(?=ABC)/)
+            validRegExp(/(?!ABC)/)
+                // validRegExp(/(?<=ABC)/)
+                // validRegExp(/(?<!ABC)/)
+
+            validRegExp(/(\d{5,10})|([a-zA-Z]{5,10})/)
+            validRegExp(/(?:\d{5,10})|(?:[a-zA-Z]{5,10})/)
+            validRegExp(/(.)(\w)(\W)(\s)(\S)(\d)(\D),\1\2\3\4\5\6\7,\1\2\3\4\5\6\7/)
+        })
+
+        describe('Quantifiers & Alternation', function() {
+            validRegExp(/.+/)
+            validRegExp(/.*/)
+            validRegExp(/.{1,3}/)
+            validRegExp(/.?/)
+            validRegExp(/a|bc/)
+
+            validRegExp(/\d{5,10}|[a-zA-Z]{5,10}/)
+        })
+
+        describe('Flags', function() {
+            // ignoreCase
+            // multiline
+            // global
+        })
+    })
+
+    describe('Complex', function() {
+        var tpl = {
+            'title': 'Syntax Demo',
+
+            'string1|1-10': '★',
+            'string2|3': 'value',
+
+            'number1|+1': 100,
+            'number2|1-100': 100,
+            'number3|1-100.1-10': 1,
+            'number4|123.1-10': 1,
+            'number5|123.3': 1,
+            'number6|123.10': 1.123,
+
+            'boolean1|1': true,
+            'boolean2|1-2': true,
+
+            'object1|2-4': {
+                '110000': '北京市',
+                '120000': '天津市',
+                '130000': '河北省',
+                '140000': '山西省'
+            },
+            'object2|2': {
+                '310000': '上海市',
+                '320000': '江苏省',
+                '330000': '浙江省',
+                '340000': '安徽省'
+            },
+
+            'array1|1': ['AMD', 'CMD', 'KMD', 'UMD'],
+            'array2|1-10': ['Mock.js'],
+            'array3|3': ['Mock.js'],
+            'array4|1-10': [{
+                'name|+1': ['Hello', 'Mock.js', '!']
+            }],
+
+            'function': function() {
+                return this.title
+            },
+
+            'regexp1': /[a-z][A-Z][0-9]/,
+            'regexp2': /\w\W\s\S\d\D/,
+            'regexp3': /\d{5,10}/,
+
+            'nested': {
+                a: {
+                    b: {
+                        c: 'Mock.js'
+                    }
+                }
+            },
+            'absolutePath': '@/title @/nested/a/b/c',
+            'relativePath': {
+                a: {
+                    b: {
+                        c: '@../../../nested/a/b/c'
+                    }
+                }
+            },
+        }
+
+        it('', function() {
+            var data = Mock.mock(tpl)
+            this.test.title += JSON.stringify(data /*, null, 4*/ )
+            expect(data).to.be.a('object')
+        })
+    })
+})

+ 308 - 0
node_modules/.1.0.1-beta3@mockjs/test/test.mock.valid.js

@@ -0,0 +1,308 @@
+/* global require, chai, describe, before, it */
+/* global window */
+var expect = chai.expect
+var Mock, Random, $, _
+
+describe('Mock.valid', function() {
+    before(function(done) {
+        require(['mock', 'underscore', 'jquery'], function() {
+            Mock = arguments[0]
+            window.Random = Random = Mock.Random
+            _ = arguments[1]
+            $ = arguments[2]
+            expect(Mock).to.not.equal(undefined)
+            expect(_).to.not.equal(undefined)
+            expect($).to.not.equal(undefined)
+            done()
+        })
+    })
+
+    function stringify(json) {
+        return JSON.stringify(json /*, null, 4*/ )
+    }
+
+    function title(tpl, data, result, test) {
+        test.title = stringify(tpl) + ' VS ' + stringify(data) + '\n\tresult: ' + stringify(result)
+
+        // if (result.length) test.title += '\n\tresult: '
+        // for (var i = 0; i < result.length; i++) {
+        //     test.title += '\n\t' + result[i].message // stringify(result)
+        // }
+    }
+
+    function doit(tpl, data, len) {
+        it('', function() {
+            var result = Mock.valid(tpl, data)
+            title(tpl, data, result, this.test)
+            expect(result).to.be.an('array').with.length(len)
+        })
+    }
+
+    describe('Name', function() {
+        doit({
+            name: 1
+        }, {
+            name: 1
+        }, 0)
+
+        doit({
+            name1: 1
+        }, {
+            name2: 1
+        }, 1)
+    })
+    describe('Value - Number', function() {
+        doit({
+            name: 1
+        }, {
+            name: 1
+        }, 0)
+
+        doit({
+            name: 1
+        }, {
+            name: 2
+        }, 1)
+
+        doit({
+            name: 1.1
+        }, {
+            name: 2.2
+        }, 1)
+
+        doit({
+            'name|1-10': 1
+        }, {
+            name: 5
+        }, 0)
+
+        doit({
+            'name|1-10': 1
+        }, {
+            name: 0
+        }, 1)
+
+        doit({
+            'name|1-10': 1
+        }, {
+            name: 11
+        }, 1)
+    })
+    describe('Value - String', function() {
+        doit({
+            name: 'value'
+        }, {
+            name: 'value'
+        }, 0)
+
+        doit({
+            name: 'value1'
+        }, {
+            name: 'value2'
+        }, 1)
+
+        doit({
+            'name|1': 'value'
+        }, {
+            name: 'value'
+        }, 0)
+
+        doit({
+            'name|2': 'value'
+        }, {
+            name: 'valuevalue'
+        }, 0)
+
+        doit({
+            'name|2': 'value'
+        }, {
+            name: 'value'
+        }, 1)
+
+        doit({
+            'name|2-3': 'value'
+        }, {
+            name: 'value'
+        }, 1)
+
+        doit({
+            'name|2-3': 'value'
+        }, {
+            name: 'valuevaluevaluevalue'
+        }, 1)
+    })
+    describe('Value - RgeExp', function() {
+        doit({
+            name: /value/
+        }, {
+            name: 'value'
+        }, 0)
+        doit({
+            name: /value/
+        }, {
+            name: 'vvvvv'
+        }, 1)
+        doit({
+            'name|1-10': /value/
+        }, {
+            name: 'valuevaluevaluevaluevalue'
+        }, 0)
+        doit({
+            'name|1-10': /value/
+        }, {
+            name: 'vvvvvvvvvvvvvvvvvvvvvvvvv'
+        }, 1)
+        doit({
+            'name|1-10': /^value$/
+        }, {
+            name: 'valuevaluevaluevaluevalue'
+        }, 0)
+        doit({
+            name: /[a-z][A-Z][0-9]/
+        }, {
+            name: 'yL5'
+        }, 0)
+    })
+    describe('Value - Object', function() {
+        doit({
+            name: 1
+        }, {
+            name: 1
+        }, 0)
+        doit({
+            name1: 1
+        }, {
+            name2: 2
+        }, 1)
+        doit({
+            name1: 1,
+            name2: 2
+        }, {
+            name3: 3
+        }, 1)
+        doit({
+            name1: 1,
+            name2: 2
+        }, {
+            name1: '1',
+            name2: '2'
+        }, 2)
+        doit({
+            a: {
+                b: {
+                    c: {
+                        d: 1
+                    }
+                }
+            }
+        }, {
+            a: {
+                b: {
+                    c: {
+                        d: 2
+                    }
+                }
+            }
+        }, 1)
+    })
+    describe('Value - Array', function() {
+        doit([1, 2, 3], [1, 2, 3], 0)
+
+        doit([1, 2, 3], [1, 2, 3, 4], 1)
+
+        // 'name|1': array
+        doit({
+            'name|1': [1, 2, 3]
+        }, {
+            'name': 1
+        }, 0)
+        doit({
+            'name|1': [1, 2, 3]
+        }, {
+            'name': 2
+        }, 0)
+        doit({
+            'name|1': [1, 2, 3]
+        }, {
+            'name': 3
+        }, 0)
+        doit({ // 不检测
+            'name|1': [1, 2, 3]
+        }, {
+            'name': 4
+        }, 0)
+
+        // 'name|+1': array
+        doit({
+            'name|+1': [1, 2, 3]
+        }, {
+            'name': 1
+        }, 0)
+        doit({
+            'name|+1': [1, 2, 3]
+        }, {
+            'name': 2
+        }, 0)
+        doit({
+            'name|+1': [1, 2, 3]
+        }, {
+            'name': 3
+        }, 0)
+        doit({
+            'name|+1': [1, 2, 3]
+        }, {
+            'name': 4
+        }, 0)
+
+        // 'name|min-max': array
+        doit({
+            'name|2-3': [1]
+        }, {
+            'name': [1, 2, 3, 4]
+        }, 1)
+
+        doit({
+            'name|2-3': [1]
+        }, {
+            'name': [1]
+        }, 1)
+
+        doit({
+            'name|2-3': [1, 2, 3]
+        }, {
+            'name': [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3]
+        }, 1)
+
+        doit({
+            'name|2-3': [1, 2, 3]
+        }, {
+            'name': [1, 2, 3]
+        }, 1)
+
+        doit({
+            'name|2-3': [1]
+        }, {
+            'name': [1, 1, 1]
+        }, 0)
+
+        doit({
+            'name|2-3': [1]
+        }, {
+            'name': [1, 2, 3]
+        }, 2)
+
+        // 'name|count': array
+    })
+    describe('Value - Placeholder', function() {
+        doit({
+            name: '@email'
+        }, {
+            name: 'nuysoft@gmail.com'
+        }, 0)
+        doit({
+            name: '@int'
+        }, {
+            name: 123
+        }, 0)
+    })
+})

+ 264 - 0
node_modules/.1.0.1-beta3@mockjs/test/valid.js

@@ -0,0 +1,264 @@
+module('Mck.valid(template, data)')
+
+if (!window.valid) {
+    window.valid = Mock.valid
+}
+
+test('Name', function() {
+    console.group('Name')
+
+    var result;
+
+    result = valid({
+        name: 1
+    }, {
+        name: 1
+    })
+    equal(result.length, 0, JSON.stringify(result, null, 4))
+
+    result = valid({
+        name1: 1
+    }, {
+        name2: 1
+    })
+    equal(result.length, 1, JSON.stringify(result, null, 4))
+
+    console.groupEnd('Name')
+})
+
+test('Type', function() {
+    console.group('Type')
+
+    var result;
+
+    result = valid(
+        1,
+        '1'
+    )
+    equal(result.length, 1, JSON.stringify(result, null, 4))
+
+    result = valid({}, [])
+    equal(result.length, 1, JSON.stringify(result, null, 4))
+
+    result = valid({
+        name: 1
+    }, {
+        name: 1
+    })
+    equal(result.length, 0, JSON.stringify(result, null, 4))
+
+    result = valid({
+        name: 1
+    }, {
+        name: '1'
+    })
+    equal(result.length, 1, JSON.stringify(result, null, 4))
+
+    console.groupEnd('Type')
+})
+
+test('Value - Number', function() {
+    console.group('Value - Number')
+
+    var result;
+
+    result = valid({
+        name: 1
+    }, {
+        name: 1
+    })
+    equal(result.length, 0, JSON.stringify(result, null, 4))
+
+    result = valid({
+        name: 1
+    }, {
+        name: 2
+    })
+    equal(result.length, 1, JSON.stringify(result, null, 4))
+
+    result = valid({
+        name: 1.1
+    }, {
+        name: 2.2
+    })
+    equal(result.length, 1, JSON.stringify(result, null, 4))
+
+    result = valid({
+        'name|1-10': 1
+    }, {
+        name: 5
+    })
+    equal(result.length, 0, JSON.stringify(result, null, 4))
+
+    result = valid({
+        'name|1-10': 1
+    }, {
+        name: 0
+    })
+    equal(result.length, 1, JSON.stringify(result, null, 4))
+
+    result = valid({
+        'name|1-10': 1
+    }, {
+        name: 11
+    })
+    equal(result.length, 1, JSON.stringify(result, null, 4))
+
+    console.groupEnd('Value - Number')
+})
+
+test('Value - String', function() {
+    console.group('Value - String')
+
+    var result;
+
+    result = valid({
+        name: 'value'
+    }, {
+        name: 'value'
+    })
+    equal(result.length, 0, JSON.stringify(result, null, 4))
+
+    result = valid({
+        name: 'value1'
+    }, {
+        name: 'value2'
+    })
+    equal(result.length, 1, JSON.stringify(result, null, 4))
+
+    result = valid({
+        'name|1': 'value'
+    }, {
+        name: 'value'
+    })
+    equal(result.length, 0, JSON.stringify(result, null, 4))
+
+    result = valid({
+        'name|2': 'value'
+    }, {
+        name: 'valuevalue'
+    })
+    equal(result.length, 0, JSON.stringify(result, null, 4))
+
+    result = valid({
+        'name|2': 'value'
+    }, {
+        name: 'value'
+    })
+    equal(result.length, 1, JSON.stringify(result, null, 4))
+
+    result = valid({
+        'name|2-3': 'value'
+    }, {
+        name: 'value'
+    })
+    equal(result.length, 1, JSON.stringify(result, null, 4))
+
+    result = valid({
+        'name|2-3': 'value'
+    }, {
+        name: 'valuevaluevaluevalue'
+    })
+    equal(result.length, 1, JSON.stringify(result, null, 4))
+
+    console.groupEnd('Value - String')
+})
+
+test('Value - Object', function() {
+    console.group('Value - Object')
+
+    var result;
+
+    result = valid({
+        name: 1
+    }, {
+        name: 1
+    })
+    equal(result.length, 0, JSON.stringify(result, null, 4))
+
+    result = valid({
+        name1: 1
+    }, {
+        name2: 2
+    })
+    equal(result.length, 1, JSON.stringify(result, null, 4))
+
+    result = valid({
+        name1: 1,
+        name2: 2
+    }, {
+        name3: 3
+    })
+    equal(result.length, 1, JSON.stringify(result, null, 4))
+
+    result = valid({
+        name1: 1,
+        name2: 2
+    }, {
+        name1: '1',
+        name2: '2'
+    })
+    equal(result.length, 2, JSON.stringify(result, null, 4))
+
+    console.groupEnd('Value - Object')
+})
+
+test('Value - Array', function() {
+    console.group('Value - Array')
+
+    var result;
+
+    result = valid(
+        [1, 2, 3], [1, 2, 3]
+    )
+    equal(result.length, 0, JSON.stringify(result, null, 4))
+
+    result = valid(
+        [1, 2, 3], [1, 2, 3, 4]
+    )
+    equal(result.length, 1, JSON.stringify(result, null, 4))
+
+    result = valid({
+        'name|2-3': [1]
+    }, {
+        'name': [1, 2, 3, 4]
+    })
+    equal(result.length, 1, JSON.stringify(result, null, 4))
+
+    result = valid({
+        'name|2-3': [1]
+    }, {
+        'name': [1]
+    })
+    equal(result.length, 1, JSON.stringify(result, null, 4))
+
+    result = valid({
+        'name|2-3': [1, 2, 3]
+    }, {
+        'name': [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3]
+    })
+    equal(result.length, 1, JSON.stringify(result, null, 4))
+
+    result = valid({
+        'name|2-3': [1, 2, 3]
+    }, {
+        'name': [1, 2, 3]
+    })
+    equal(result.length, 1, JSON.stringify(result, null, 4))
+
+    result = valid({
+        'name|2-3': [1]
+    }, {
+        'name': [1, 1, 1]
+    })
+    equal(result.length, 0, JSON.stringify(result, null, 4))
+
+    result = valid({
+        'name|2-3': [1]
+    }, {
+        'name': [1, 2, 3]
+    })
+    equal(result.length, 2, JSON.stringify(result, null, 4))
+
+    console.groupEnd('Value - Array')
+})

+ 3 - 0
node_modules/.1.0.1@graceful-readlink/.npmignore

@@ -0,0 +1,3 @@
+.idea/
+.DS_Store
+node_modules/

+ 1 - 0
node_modules/.1.0.1@graceful-readlink/.npminstall.done

@@ -0,0 +1 @@
+Mon Apr 17 2017 19:29:27 GMT+0800 (CST)

+ 5 - 0
node_modules/.1.0.1@graceful-readlink/.travis.yml

@@ -0,0 +1,5 @@
+language: node_js
+node_js:
+  - "0.10"
+  - "0.12"
+  - "io.js"

+ 22 - 0
node_modules/.1.0.1@graceful-readlink/LICENSE

@@ -0,0 +1,22 @@
+The MIT License (MIT)
+
+Copyright (c) 2015 Zhiye Li
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+

+ 17 - 0
node_modules/.1.0.1@graceful-readlink/README.md

@@ -0,0 +1,17 @@
+# graceful-readlink
+[![NPM Version](http://img.shields.io/npm/v/graceful-readlink.svg?style=flat)](https://www.npmjs.org/package/graceful-readlink)
+[![NPM Downloads](https://img.shields.io/npm/dm/graceful-readlink.svg?style=flat)](https://www.npmjs.org/package/graceful-readlink)
+
+
+## Usage
+
+```js
+var readlinkSync = require('graceful-readlink').readlinkSync;
+console.log(readlinkSync(f));
+// output
+//  the file pointed to when `f` is a symbolic link
+//  the `f` itself when `f` is not a symbolic link
+```
+## Licence
+
+MIT License

+ 12 - 0
node_modules/.1.0.1@graceful-readlink/index.js

@@ -0,0 +1,12 @@
+var fs = require('fs')
+  , lstat = fs.lstatSync;
+
+exports.readlinkSync = function (p) {
+  if (lstat(p).isSymbolicLink()) {
+    return fs.readlinkSync(p);
+  } else {
+    return p;
+  }
+};
+
+

+ 20 - 0
node_modules/.1.0.1@graceful-readlink/package.json

@@ -0,0 +1,20 @@
+{
+  "name": "graceful-readlink",
+  "version": "1.0.1",
+  "description": "graceful fs.readlink",
+  "main": "index.js",
+  "repository": "git://github.com/zhiyelee/graceful-readlink.git",
+  "homepage": "https://github.com/zhiyelee/graceful-readlink",
+  "bugs": "https://github.com/zhiyelee/graceful-readlink/issues",
+  "keywords": [
+    "fs.readlink",
+    "readlink"
+  ],
+  "author": "zhiyelee",
+  "license": "MIT",
+  "scripts": {
+    "test": "echo \"Error: no test specified\" && exit 1"
+  },
+  "_from": "graceful-readlink@1.0.1",
+  "_resolved": "http://registry.npm.taobao.org/graceful-readlink/download/graceful-readlink-1.0.1.tgz"
+}

+ 1 - 0
node_modules/.2.9.0@commander/.npminstall.done

@@ -0,0 +1 @@
+Mon Apr 17 2017 19:29:27 GMT+0800 (CST)

+ 261 - 0
node_modules/.2.9.0@commander/History.md

@@ -0,0 +1,261 @@
+
+2.9.0 / 2015-10-13
+==================
+
+  * Add option `isDefault` to set default subcommand #415 @Qix-
+  * Add callback to allow filtering or post-processing of help text #434 @djulien
+  * Fix `undefined` text in help information close #414 #416 @zhiyelee
+
+2.8.1 / 2015-04-22
+==================
+
+ * Back out `support multiline description` Close #396 #397
+
+2.8.0 / 2015-04-07
+==================
+
+  * Add `process.execArg` support, execution args like `--harmony` will be passed to sub-commands #387 @DigitalIO @zhiyelee
+  * Fix bug in Git-style sub-commands #372 @zhiyelee
+  * Allow commands to be hidden from help #383 @tonylukasavage
+  * When git-style sub-commands are in use, yet none are called, display help #382 @claylo
+  * Add ability to specify arguments syntax for top-level command #258 @rrthomas
+  * Support multiline descriptions #208 @zxqfox
+
+2.7.1 / 2015-03-11
+==================
+
+ * Revert #347 (fix collisions when option and first arg have same name) which causes a bug in #367.
+
+2.7.0 / 2015-03-09
+==================
+
+ * Fix git-style bug when installed globally. Close #335 #349 @zhiyelee
+ * Fix collisions when option and first arg have same name. Close #346 #347 @tonylukasavage
+ * Add support for camelCase on `opts()`. Close #353  @nkzawa
+ * Add node.js 0.12 and io.js to travis.yml
+ * Allow RegEx options. #337 @palanik
+ * Fixes exit code when sub-command failing.  Close #260 #332 @pirelenito
+ * git-style `bin` files in $PATH make sense. Close #196 #327  @zhiyelee
+
+2.6.0 / 2014-12-30
+==================
+
+  * added `Command#allowUnknownOption` method. Close #138 #318 @doozr @zhiyelee
+  * Add application description to the help msg. Close #112 @dalssoft
+
+2.5.1 / 2014-12-15
+==================
+
+  * fixed two bugs incurred by variadic arguments. Close #291 @Quentin01 #302 @zhiyelee
+
+2.5.0 / 2014-10-24
+==================
+
+ * add support for variadic arguments. Closes #277 @whitlockjc
+
+2.4.0 / 2014-10-17
+==================
+
+ * fixed a bug on executing the coercion function of subcommands option. Closes #270
+ * added `Command.prototype.name` to retrieve command name. Closes #264 #266 @tonylukasavage
+ * added `Command.prototype.opts` to retrieve all the options as a simple object of key-value pairs. Closes #262 @tonylukasavage
+ * fixed a bug on subcommand name. Closes #248 @jonathandelgado
+ * fixed function normalize doesn’t honor option terminator. Closes #216 @abbr
+
+2.3.0 / 2014-07-16
+==================
+
+ * add command alias'. Closes PR #210
+ * fix: Typos. Closes #99
+ * fix: Unused fs module. Closes #217
+
+2.2.0 / 2014-03-29
+==================
+
+ * add passing of previous option value
+ * fix: support subcommands on windows. Closes #142
+ * Now the defaultValue passed as the second argument of the coercion function.
+
+2.1.0 / 2013-11-21
+==================
+
+ * add: allow cflag style option params, unit test, fixes #174
+
+2.0.0 / 2013-07-18
+==================
+
+ * remove input methods (.prompt, .confirm, etc)
+
+1.3.2 / 2013-07-18
+==================
+
+ * add support for sub-commands to co-exist with the original command
+
+1.3.1 / 2013-07-18
+==================
+
+ * add quick .runningCommand hack so you can opt-out of other logic when running a sub command
+
+1.3.0 / 2013-07-09
+==================
+
+ * add EACCES error handling
+ * fix sub-command --help
+
+1.2.0 / 2013-06-13
+==================
+
+ * allow "-" hyphen as an option argument
+ * support for RegExp coercion
+
+1.1.1 / 2012-11-20
+==================
+
+  * add more sub-command padding
+  * fix .usage() when args are present. Closes #106
+
+1.1.0 / 2012-11-16
+==================
+
+  * add git-style executable subcommand support. Closes #94
+
+1.0.5 / 2012-10-09
+==================
+
+  * fix `--name` clobbering. Closes #92
+  * fix examples/help. Closes #89
+
+1.0.4 / 2012-09-03
+==================
+
+  * add `outputHelp()` method.
+
+1.0.3 / 2012-08-30
+==================
+
+  * remove invalid .version() defaulting
+
+1.0.2 / 2012-08-24
+==================
+
+  * add `--foo=bar` support [arv]
+  * fix password on node 0.8.8. Make backward compatible with 0.6 [focusaurus]
+
+1.0.1 / 2012-08-03
+==================
+
+  * fix issue #56
+  * fix tty.setRawMode(mode) was moved to tty.ReadStream#setRawMode() (i.e. process.stdin.setRawMode())
+
+1.0.0 / 2012-07-05
+==================
+
+  * add support for optional option descriptions
+  * add defaulting of `.version()` to package.json's version
+
+0.6.1 / 2012-06-01
+==================
+
+  * Added: append (yes or no) on confirmation
+  * Added: allow node.js v0.7.x
+
+0.6.0 / 2012-04-10
+==================
+
+  * Added `.prompt(obj, callback)` support. Closes #49
+  * Added default support to .choose(). Closes #41
+  * Fixed the choice example
+
+0.5.1 / 2011-12-20
+==================
+
+  * Fixed `password()` for recent nodes. Closes #36
+
+0.5.0 / 2011-12-04
+==================
+
+  * Added sub-command option support [itay]
+
+0.4.3 / 2011-12-04
+==================
+
+  * Fixed custom help ordering. Closes #32
+
+0.4.2 / 2011-11-24
+==================
+
+  * Added travis support
+  * Fixed: line-buffered input automatically trimmed. Closes #31
+
+0.4.1 / 2011-11-18
+==================
+
+  * Removed listening for "close" on --help
+
+0.4.0 / 2011-11-15
+==================
+
+  * Added support for `--`. Closes #24
+
+0.3.3 / 2011-11-14
+==================
+
+  * Fixed: wait for close event when writing help info [Jerry Hamlet]
+
+0.3.2 / 2011-11-01
+==================
+
+  * Fixed long flag definitions with values [felixge]
+
+0.3.1 / 2011-10-31
+==================
+
+  * Changed `--version` short flag to `-V` from `-v`
+  * Changed `.version()` so it's configurable [felixge]
+
+0.3.0 / 2011-10-31
+==================
+
+  * Added support for long flags only. Closes #18
+
+0.2.1 / 2011-10-24
+==================
+
+  * "node": ">= 0.4.x < 0.7.0". Closes #20
+
+0.2.0 / 2011-09-26
+==================
+
+  * Allow for defaults that are not just boolean. Default peassignment only occurs for --no-*, optional, and required arguments. [Jim Isaacs]
+
+0.1.0 / 2011-08-24
+==================
+
+  * Added support for custom `--help` output
+
+0.0.5 / 2011-08-18
+==================
+
+  * Changed: when the user enters nothing prompt for password again
+  * Fixed issue with passwords beginning with numbers [NuckChorris]
+
+0.0.4 / 2011-08-15
+==================
+
+  * Fixed `Commander#args`
+
+0.0.3 / 2011-08-15
+==================
+
+  * Added default option value support
+
+0.0.2 / 2011-08-15
+==================
+
+  * Added mask support to `Command#password(str[, mask], fn)`
+  * Added `Command#password(str, fn)`
+
+0.0.1 / 2010-01-03
+==================
+
+  * Initial release

+ 22 - 0
node_modules/.2.9.0@commander/LICENSE

@@ -0,0 +1,22 @@
+(The MIT License)
+
+Copyright (c) 2011 TJ Holowaychuk <tj@vision-media.ca>
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+ 351 - 0
node_modules/.2.9.0@commander/Readme.md

@@ -0,0 +1,351 @@
+# Commander.js
+
+
+[![Build Status](https://api.travis-ci.org/tj/commander.js.svg)](http://travis-ci.org/tj/commander.js)
+[![NPM Version](http://img.shields.io/npm/v/commander.svg?style=flat)](https://www.npmjs.org/package/commander)
+[![NPM Downloads](https://img.shields.io/npm/dm/commander.svg?style=flat)](https://www.npmjs.org/package/commander)
+[![Join the chat at https://gitter.im/tj/commander.js](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/tj/commander.js?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
+
+  The complete solution for [node.js](http://nodejs.org) command-line interfaces, inspired by Ruby's [commander](https://github.com/tj/commander).  
+  [API documentation](http://tj.github.com/commander.js/)
+
+
+## Installation
+
+    $ npm install commander
+
+## Option parsing
+
+ Options with commander are defined with the `.option()` method, also serving as documentation for the options. The example below parses args and options from `process.argv`, leaving remaining args as the `program.args` array which were not consumed by options.
+
+```js
+#!/usr/bin/env node
+
+/**
+ * Module dependencies.
+ */
+
+var program = require('commander');
+
+program
+  .version('0.0.1')
+  .option('-p, --peppers', 'Add peppers')
+  .option('-P, --pineapple', 'Add pineapple')
+  .option('-b, --bbq-sauce', 'Add bbq sauce')
+  .option('-c, --cheese [type]', 'Add the specified type of cheese [marble]', 'marble')
+  .parse(process.argv);
+
+console.log('you ordered a pizza with:');
+if (program.peppers) console.log('  - peppers');
+if (program.pineapple) console.log('  - pineapple');
+if (program.bbqSauce) console.log('  - bbq');
+console.log('  - %s cheese', program.cheese);
+```
+
+ Short flags may be passed as a single arg, for example `-abc` is equivalent to `-a -b -c`. Multi-word options such as "--template-engine" are camel-cased, becoming `program.templateEngine` etc.
+
+
+## Coercion
+
+```js
+function range(val) {
+  return val.split('..').map(Number);
+}
+
+function list(val) {
+  return val.split(',');
+}
+
+function collect(val, memo) {
+  memo.push(val);
+  return memo;
+}
+
+function increaseVerbosity(v, total) {
+  return total + 1;
+}
+
+program
+  .version('0.0.1')
+  .usage('[options] <file ...>')
+  .option('-i, --integer <n>', 'An integer argument', parseInt)
+  .option('-f, --float <n>', 'A float argument', parseFloat)
+  .option('-r, --range <a>..<b>', 'A range', range)
+  .option('-l, --list <items>', 'A list', list)
+  .option('-o, --optional [value]', 'An optional value')
+  .option('-c, --collect [value]', 'A repeatable value', collect, [])
+  .option('-v, --verbose', 'A value that can be increased', increaseVerbosity, 0)
+  .parse(process.argv);
+
+console.log(' int: %j', program.integer);
+console.log(' float: %j', program.float);
+console.log(' optional: %j', program.optional);
+program.range = program.range || [];
+console.log(' range: %j..%j', program.range[0], program.range[1]);
+console.log(' list: %j', program.list);
+console.log(' collect: %j', program.collect);
+console.log(' verbosity: %j', program.verbose);
+console.log(' args: %j', program.args);
+```
+
+## Regular Expression
+```js
+program
+  .version('0.0.1')
+  .option('-s --size <size>', 'Pizza size', /^(large|medium|small)$/i, 'medium')
+  .option('-d --drink [drink]', 'Drink', /^(coke|pepsi|izze)$/i)
+  .parse(process.argv);
+  
+console.log(' size: %j', program.size);
+console.log(' drink: %j', program.drink);
+```
+
+## Variadic arguments
+
+ The last argument of a command can be variadic, and only the last argument.  To make an argument variadic you have to
+ append `...` to the argument name.  Here is an example:
+
+```js
+#!/usr/bin/env node
+
+/**
+ * Module dependencies.
+ */
+
+var program = require('commander');
+
+program
+  .version('0.0.1')
+  .command('rmdir <dir> [otherDirs...]')
+  .action(function (dir, otherDirs) {
+    console.log('rmdir %s', dir);
+    if (otherDirs) {
+      otherDirs.forEach(function (oDir) {
+        console.log('rmdir %s', oDir);
+      });
+    }
+  });
+
+program.parse(process.argv);
+```
+
+ An `Array` is used for the value of a variadic argument.  This applies to `program.args` as well as the argument passed
+ to your action as demonstrated above.
+
+## Specify the argument syntax
+
+```js
+#!/usr/bin/env node
+
+var program = require('../');
+
+program
+  .version('0.0.1')
+  .arguments('<cmd> [env]')
+  .action(function (cmd, env) {
+     cmdValue = cmd;
+     envValue = env;
+  });
+
+program.parse(process.argv);
+
+if (typeof cmdValue === 'undefined') {
+   console.error('no command given!');
+   process.exit(1);
+}
+console.log('command:', cmdValue);
+console.log('environment:', envValue || "no environment given");
+```
+
+## Git-style sub-commands
+
+```js
+// file: ./examples/pm
+var program = require('..');
+
+program
+  .version('0.0.1')
+  .command('install [name]', 'install one or more packages')
+  .command('search [query]', 'search with optional query')
+  .command('list', 'list packages installed', {isDefault: true})
+  .parse(process.argv);
+```
+
+When `.command()` is invoked with a description argument, no `.action(callback)` should be called to handle sub-commands, otherwise there will be an error. This tells commander that you're going to use separate executables for sub-commands, much like `git(1)` and other popular tools.  
+The commander will try to search the executables in the directory of the entry script (like `./examples/pm`) with the name `program-command`, like `pm-install`, `pm-search`.
+
+Options can be passed with the call to `.command()`. Specifying `true` for `opts.noHelp` will remove the option from the generated help output. Specifying `true` for `opts.isDefault` will run the subcommand if no other subcommand is specified.
+
+If the program is designed to be installed globally, make sure the executables have proper modes, like `755`.
+
+### `--harmony`
+
+You can enable `--harmony` option in two ways:
+* Use `#! /usr/bin/env node --harmony` in the sub-commands scripts. Note some os version don’t support this pattern.
+* Use the `--harmony` option when call the command, like `node --harmony examples/pm publish`. The `--harmony` option will be preserved when spawning sub-command process.
+
+## Automated --help
+
+ The help information is auto-generated based on the information commander already knows about your program, so the following `--help` info is for free:
+
+```  
+ $ ./examples/pizza --help
+
+   Usage: pizza [options]
+
+   An application for pizzas ordering
+
+   Options:
+
+     -h, --help           output usage information
+     -V, --version        output the version number
+     -p, --peppers        Add peppers
+     -P, --pineapple      Add pineapple
+     -b, --bbq            Add bbq sauce
+     -c, --cheese <type>  Add the specified type of cheese [marble]
+     -C, --no-cheese      You do not want any cheese
+
+```
+
+## Custom help
+
+ You can display arbitrary `-h, --help` information
+ by listening for "--help". Commander will automatically
+ exit once you are done so that the remainder of your program
+ does not execute causing undesired behaviours, for example
+ in the following executable "stuff" will not output when
+ `--help` is used.
+
+```js
+#!/usr/bin/env node
+
+/**
+ * Module dependencies.
+ */
+
+var program = require('commander');
+
+program
+  .version('0.0.1')
+  .option('-f, --foo', 'enable some foo')
+  .option('-b, --bar', 'enable some bar')
+  .option('-B, --baz', 'enable some baz');
+
+// must be before .parse() since
+// node's emit() is immediate
+
+program.on('--help', function(){
+  console.log('  Examples:');
+  console.log('');
+  console.log('    $ custom-help --help');
+  console.log('    $ custom-help -h');
+  console.log('');
+});
+
+program.parse(process.argv);
+
+console.log('stuff');
+```
+
+Yields the following help output when `node script-name.js -h` or `node script-name.js --help` are run:
+
+```
+
+Usage: custom-help [options]
+
+Options:
+
+  -h, --help     output usage information
+  -V, --version  output the version number
+  -f, --foo      enable some foo
+  -b, --bar      enable some bar
+  -B, --baz      enable some baz
+
+Examples:
+
+  $ custom-help --help
+  $ custom-help -h
+
+```
+
+## .outputHelp(cb)
+
+Output help information without exiting.
+Optional callback cb allows post-processing of help text before it is displayed.
+
+If you want to display help by default (e.g. if no command was provided), you can use something like:
+
+```js
+var program = require('commander');
+var colors = require('colors');
+
+program
+  .version('0.0.1')
+  .command('getstream [url]', 'get stream URL')
+  .parse(process.argv);
+
+  if (!process.argv.slice(2).length) {
+    program.outputHelp(make_red);
+  }
+
+function make_red(txt) {
+  return colors.red(txt); //display the help text in red on the console
+}
+```
+
+## .help(cb)
+
+  Output help information and exit immediately.
+  Optional callback cb allows post-processing of help text before it is displayed.
+
+## Examples
+
+```js
+var program = require('commander');
+
+program
+  .version('0.0.1')
+  .option('-C, --chdir <path>', 'change the working directory')
+  .option('-c, --config <path>', 'set config path. defaults to ./deploy.conf')
+  .option('-T, --no-tests', 'ignore test hook')
+
+program
+  .command('setup [env]')
+  .description('run setup commands for all envs')
+  .option("-s, --setup_mode [mode]", "Which setup mode to use")
+  .action(function(env, options){
+    var mode = options.setup_mode || "normal";
+    env = env || 'all';
+    console.log('setup for %s env(s) with %s mode', env, mode);
+  });
+
+program
+  .command('exec <cmd>')
+  .alias('ex')
+  .description('execute the given remote cmd')
+  .option("-e, --exec_mode <mode>", "Which exec mode to use")
+  .action(function(cmd, options){
+    console.log('exec "%s" using %s mode', cmd, options.exec_mode);
+  }).on('--help', function() {
+    console.log('  Examples:');
+    console.log();
+    console.log('    $ deploy exec sequential');
+    console.log('    $ deploy exec async');
+    console.log();
+  });
+
+program
+  .command('*')
+  .action(function(env){
+    console.log('deploying "%s"', env);
+  });
+
+program.parse(process.argv);
+```
+
+More Demos can be found in the [examples](https://github.com/tj/commander.js/tree/master/examples) directory.
+
+## License
+
+MIT
+

文件差異過大導致無法顯示
+ 1110 - 0
node_modules/.2.9.0@commander/index.js


+ 1 - 0
node_modules/.2.9.0@commander/node_modules/graceful-readlink

@@ -0,0 +1 @@
+../../.1.0.1@graceful-readlink

+ 35 - 0
node_modules/.2.9.0@commander/package.json

@@ -0,0 +1,35 @@
+{
+  "name": "commander",
+  "version": "2.9.0",
+  "description": "the complete solution for node.js command-line programs",
+  "keywords": [
+    "command",
+    "option",
+    "parser"
+  ],
+  "author": "TJ Holowaychuk <tj@vision-media.ca>",
+  "license": "MIT",
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/tj/commander.js.git"
+  },
+  "devDependencies": {
+    "should": ">= 0.0.1",
+    "sinon": ">=1.17.1"
+  },
+  "scripts": {
+    "test": "make test"
+  },
+  "main": "index",
+  "engines": {
+    "node": ">= 0.6.x"
+  },
+  "files": [
+    "index.js"
+  ],
+  "dependencies": {
+    "graceful-readlink": ">= 1.0.0"
+  },
+  "_from": "commander@2.9.0",
+  "_resolved": "http://registry.npm.taobao.org/commander/download/commander-2.9.0.tgz"
+}

+ 1 - 0
node_modules/.bin/_mocha

@@ -0,0 +1 @@
+../mocha/bin/_mocha

+ 1 - 0
node_modules/.bin/_mocha-nightwatch

@@ -0,0 +1 @@
+../mocha-nightwatch/bin/_mocha

+ 1 - 0
node_modules/.bin/acorn

@@ -0,0 +1 @@
+../acorn/bin/acorn

+ 1 - 0
node_modules/.bin/ansi-html

@@ -0,0 +1 @@
+../ansi-html/bin/ansi-html

+ 1 - 0
node_modules/.bin/babylon

@@ -0,0 +1 @@
+../babylon/bin/babylon.js

+ 1 - 0
node_modules/.bin/browserslist

@@ -0,0 +1 @@
+../browserslist/cli.js

+ 1 - 0
node_modules/.bin/chromedriver

@@ -0,0 +1 @@
+../chromedriver/bin/chromedriver

+ 0 - 0
node_modules/.bin/commonize


部分文件因文件數量過多而無法顯示