AMD support

This commit is contained in:
Milk Lee 2015-05-06 15:27:03 -07:00 committed by SheetJS
parent 6cdecfeb22
commit b1d8309717
6 changed files with 83 additions and 17 deletions

@ -1,8 +1,8 @@
language: node_js
node_js:
- "iojs"
- "0.11"
- "0.10"
- "0.8"
before_install:
- "npm install -g mocha crc-32 benchmark ansi"
- "npm install blanket"

@ -1,5 +1,22 @@
/* crc32.js (C) 2014 SheetJS -- http://sheetjs.com */
/* crc32.js (C) 2014-2015 SheetJS -- http://sheetjs.com */
/* vim: set ts=2: */
var CRC32 = {};
var CRC32;
/*:: declare var DO_NOT_EXPORT_CRC: any; */
(function(CRC32) {
/*:: declare var define: any; */
(function (factory) {
if(typeof DO_NOT_EXPORT_CRC === 'undefined') {
if('object' === typeof exports) {
factory(exports);
} else if ('function' === typeof define && define.amd) {
define(function () {
var module = {};
factory(module);
return module;
});
} else {
factory(CRC32 = {});
}
} else {
factory(CRC32 = {});
}
}(function(CRC32) {

@ -1 +1 @@
})(typeof exports !== "undefined" && typeof DO_NOT_EXPORT_CRC === 'undefined' ? exports : CRC32);
}));

@ -1,8 +1,25 @@
/* crc32.js (C) 2014 SheetJS -- http://sheetjs.com */
/* crc32.js (C) 2014-2015 SheetJS -- http://sheetjs.com */
/* vim: set ts=2: */
var CRC32 = {};
var CRC32;
/*:: declare var DO_NOT_EXPORT_CRC: any; */
(function(CRC32) {
/*:: declare var define: any; */
(function (factory) {
if(typeof DO_NOT_EXPORT_CRC === 'undefined') {
if('object' === typeof exports) {
factory(exports);
} else if ('function' === typeof define && define.amd) {
define(function () {
var module = {};
factory(module);
return module;
});
} else {
factory(CRC32 = {});
}
} else {
factory(CRC32 = {});
}
}(function(CRC32) {
CRC32.version = '0.3.0';
/*::
type CRC32Type = number;
@ -97,4 +114,4 @@ CRC32.table = table;
CRC32.bstr = crc32_bstr;
CRC32.buf = crc32_buf;
CRC32.str = crc32_str;
})(typeof exports !== "undefined" && typeof DO_NOT_EXPORT_CRC === 'undefined' ? exports : CRC32);
}));

@ -1,7 +1,23 @@
/* crc32.js (C) 2014 SheetJS -- http://sheetjs.com */
/* crc32.js (C) 2014-2015 SheetJS -- http://sheetjs.com */
/* vim: set ts=2: */
var CRC32 = {};
(function(CRC32) {
var CRC32;
(function (factory) {
if(typeof DO_NOT_EXPORT_CRC === 'undefined') {
if('object' === typeof exports) {
factory(exports);
} else if ('function' === typeof define && define.amd) {
define(function () {
var module = {};
factory(module);
return module;
});
} else {
factory(CRC32 = {});
}
} else {
factory(CRC32 = {});
}
}(function(CRC32) {
CRC32.version = '0.3.0';
/* see perf/crc32table.js */
function signed_crc_table() {
@ -91,4 +107,4 @@ CRC32.table = table;
CRC32.bstr = crc32_bstr;
CRC32.buf = crc32_buf;
CRC32.str = crc32_str;
})(typeof exports !== "undefined" && typeof DO_NOT_EXPORT_CRC === 'undefined' ? exports : CRC32);
}));

@ -1,7 +1,23 @@
/* crc32.js (C) 2014 SheetJS -- http://sheetjs.com */
/* crc32.js (C) 2014-2015 SheetJS -- http://sheetjs.com */
/* vim: set ts=2: */
var CRC32 = {};
(function(CRC32) {
var CRC32;
(function (factory) {
if(typeof DO_NOT_EXPORT_CRC === 'undefined') {
if('object' === typeof exports) {
factory(exports);
} else if ('function' === typeof define && define.amd) {
define(function () {
var module = {};
factory(module);
return module;
});
} else {
factory(CRC32 = {});
}
} else {
factory(CRC32 = {});
}
}(function(CRC32) {
CRC32.version = '0.3.0';
/* see perf/crc32table.js */
function signed_crc_table() {
@ -91,4 +107,4 @@ CRC32.table = table;
CRC32.bstr = crc32_bstr;
CRC32.buf = crc32_buf;
CRC32.str = crc32_str;
})(typeof exports !== "undefined" && typeof DO_NOT_EXPORT_CRC === 'undefined' ? exports : CRC32);
}));