Skip to content

Commit a591ea1

Browse files
committed
fix bin/random; + 1.0.0-beta1
1 parent 9606d33 commit a591ea1

File tree

6 files changed

+770
-756
lines changed

6 files changed

+770
-756
lines changed

bin/random

+10-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,13 @@ program
3131
var FN_ARGS = /^function\s*[^\(]*\(\s*([^\)]*)\)/m
3232
var FN_ARG_SPLIT = /,/
3333
var FN_ARG = /^\s*(_?)(\S+?)\1\s*$/
34-
var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg;
34+
var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg
35+
var EXCLUDE = [
36+
'extend',
37+
'dataImage', // mock/random/image
38+
'capitalize', 'upper', 'lower', 'pick', 'shuffle', 'order', // mock/random/helper.js
39+
'increment', 'inc' // mock/random/misc.js
40+
]
3541

3642
function parseArgs(fn) {
3743
var fnText = fn.toString().replace(STRIP_COMMENTS, '')
@@ -40,6 +46,9 @@ program
4046
}
4147

4248
Object.keys(Random).forEach(function(key) {
49+
if (key[0] === '_') return
50+
if (EXCLUDE.indexOf(key) !== -1) return
51+
4352
var fn = Random[key]
4453
if (typeof fn === 'function') {
4554
var argDecl = parseArgs(fn)

dist/mock-min.js

+9-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/mock-min.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)