Skip to content

Commit

Permalink
Release 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
qiu8310 committed Apr 25, 2015
1 parent 9500a94 commit d29e1d1
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 3 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
@@ -1,4 +1,11 @@

2.0.0 / 2015-04-25
==================

* 不定义 rules 就原样返回

- 1.x.x 版本中如果没有定义 rules 就会抛出异常

1.3.0 / 2015-04-24
==================

Expand Down
2 changes: 1 addition & 1 deletion bower.json
@@ -1,6 +1,6 @@
{
"name": "elegant.def",
"version": "1.3.0",
"version": "2.0.0",
"homepage": "https://github.com/qiu8310/elegant.def",
"authors": [
"Zhonglei Qiu <zhongleiqiu@gmail.com>"
Expand Down
7 changes: 6 additions & 1 deletion browser/full.js
Expand Up @@ -145,7 +145,8 @@
}

if (!cfg || !cfg.rules || !cfg.rules.length) {
throw new Error('No rules.');
//throw new Error('No rules.');
return fn;
}

cfg.rules = base.map(cfg.rules, Rule.parse);
Expand Down Expand Up @@ -988,6 +989,10 @@
*/
function def(fn, cfg) {

if (!cfg) {
return fn;
}

cfg.rules = base.map(cfg.rules, Rule.decompress);
cfg.options = base.merge({}, option.all, cfg.options);
cfg.defaults = base.merge({}, cfg.defaults);
Expand Down
4 changes: 4 additions & 0 deletions browser/simple.js
Expand Up @@ -608,6 +608,10 @@
*/
function def(fn, cfg) {

if (!cfg) {
return fn;
}

cfg.rules = base.map(cfg.rules, Rule.decompress);
cfg.options = base.merge({}, option.all, cfg.options);
cfg.defaults = base.merge({}, cfg.defaults);
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "elegant.def",
"version": "1.3.0",
"version": "2.0.0",
"description": "Elegant define javascript function",
"main": "src/full.js",
"scripts": {
Expand Down

0 comments on commit d29e1d1

Please sign in to comment.