Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
1. module模块,对外只暴露exports的变量
2. binary-parser进行格式规范
3. 集成promise模块
  • Loading branch information
wh1100717 committed Nov 3, 2014
1 parent df4deda commit 20af6bd
Show file tree
Hide file tree
Showing 4 changed files with 392 additions and 4 deletions.
6 changes: 4 additions & 2 deletions Gruntfile.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ module.exports = (grunt) ->
contents = contents.replace(/(var.*), *;/, "$1;")
contents = contents.replace(/(.+) = require\('.+'\).*\n/, "")
contents = contents.replace(/.*Generated by CoffeeScript.*\n/, "")
contents = contents.replace(/(return )?module.exports = .*\n/, "")
contents = contents.replace(/return module.exports = (.*);\n/, "self.$1 = $1;")
contents = contents.replace(/(.+) = require\(['"]$/, "")
contents = contents.replace(/define\([^{]*?{/, "").replace(/\}\);[^}\w]*$/, "")
contents = contents.replace(/define\(\[[^\]]+\]\)[\W\n]+$/, "")
contents = contents.replace(/define\(\[[^\]]+\]\)[\W\n]+$/, "")
contents = "(function(self){\n" + contents
contents += "\n})(this);\n"
return contents


Expand Down
4 changes: 3 additions & 1 deletion Gruntfile.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/lib/binary-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,5 +117,5 @@ define(function(require, exports, module) {

BinaryParser.Buffer = BinaryParserBuffer;

module.exports = BinaryParser
return module.exports = BinaryParser;
});
Loading

0 comments on commit 20af6bd

Please sign in to comment.