Skip to content

Commit c603108

Browse files
committed
build
1 parent 3091b1f commit c603108

File tree

5 files changed

+42
-29
lines changed

5 files changed

+42
-29
lines changed

dist/av-es6.js

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9721,30 +9721,35 @@ module.exports = function(AV) {
97219721
};
97229722

97239723
/**
9724-
* Call this method first to set up your authentication tokens for LC.
9725-
* You can get your keys from the Data Browser on http://leancloud.cn .
9726-
* @param {Object} incloud appId, appKey, masterKey
9727-
*/
9724+
* Call this method first to set up your authentication tokens for AV.
9725+
* You can get your app keys from the LeanCloud dashboard on http://leancloud.cn .
9726+
* @function AV.init
9727+
* @param args initialize options.
9728+
* @param args.appId application id
9729+
* @param args.appKey application key
9730+
* @param args.masterKey application master key
9731+
*/
97289732

9729-
AV.init = (...options) => {
9730-
switch (options.length) {
9733+
AV.init = (...args) => {
9734+
switch (args.length) {
97319735
case 1:
9736+
const options = args[0];
97329737
if (typeof options === 'object') {
97339738
if (!AV._config.isNode && options.masterKey) {
97349739
throw new Error('AV.init(): Master Key is only used in Node.js.');
97359740
}
9736-
initialize(options[0].appId, options[0].appKey, options[0].masterKey);
9741+
initialize(options.appId, options.appKey, options.masterKey);
97379742
} else {
97389743
throw new Error('AV.init(): Parameter is not correct.');
97399744
}
97409745
break;
97419746
// 兼容旧版本的初始化方法
97429747
case 2:
97439748
case 3:
9744-
if (!AV._config.isNode && options.length === 3) {
9749+
if (!AV._config.isNode && args.length === 3) {
97459750
throw new Error('AV.init(): Master Key is only used in Node.js.');
97469751
}
9747-
initialize(...options);
9752+
initialize(...args);
97489753
break;
97499754
}
97509755
};
@@ -9769,6 +9774,7 @@ module.exports = function(AV) {
97699774

97709775
/**
97719776
* Call this method to set production environment variable.
9777+
* @function AV.setProduction
97729778
* @param {Boolean} production True is production environment,and
97739779
* it's true by default.
97749780
*/

dist/av-mini.js renamed to dist/av-min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/av-es5.js renamed to dist/av.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2834,11 +2834,15 @@ child.__super__=parent.prototype;return child;}; /**
28342834
* @param {String} applicationId Your AV Application ID.
28352835
* @param {String} applicationKey Your AV Application Key
28362836
*/var initialize=function initialize(applicationId,applicationKey,masterKey){if(AV.applicationId!==undefined&&applicationId!==AV.applicationId&&applicationKey!==AV.applicationKey&&masterKey!==AV.masterKey){console.warn('AVOSCloud SDK is already initialized, please don\'t reinitialize it.');}AV.applicationId=applicationId;AV.applicationKey=applicationKey;AV.masterKey=masterKey;AV._useMasterKey=false;}; /**
2837-
* Call this method first to set up your authentication tokens for LC.
2838-
* You can get your keys from the Data Browser on http://leancloud.cn .
2839-
* @param {Object} incloud appId, appKey, masterKey
2840-
*/AV.init=function(){for(var _len=arguments.length,options=Array(_len),_key=0;_key<_len;_key++){options[_key]=arguments[_key];}switch(options.length){case 1:if((typeof options==="undefined"?"undefined":_typeof(options))==='object'){if(!AV._config.isNode&&options.masterKey){throw new Error('AV.init(): Master Key is only used in Node.js.');}initialize(options[0].appId,options[0].appKey,options[0].masterKey);}else {throw new Error('AV.init(): Parameter is not correct.');}break; // 兼容旧版本的初始化方法
2841-
case 2:case 3:if(!AV._config.isNode&&options.length===3){throw new Error('AV.init(): Master Key is only used in Node.js.');}initialize.apply(undefined,options);break;}}; // If we're running in node.js, allow using the master key.
2837+
* Call this method first to set up your authentication tokens for AV.
2838+
* You can get your app keys from the LeanCloud dashboard on http://leancloud.cn .
2839+
* @function AV.init
2840+
* @param args initialize options.
2841+
* @param args.appId application id
2842+
* @param args.appKey application key
2843+
* @param args.masterKey application master key
2844+
*/AV.init=function(){switch(arguments.length){case 1:var options=arguments.length<=0?undefined:arguments[0];if((typeof options==="undefined"?"undefined":_typeof(options))==='object'){if(!AV._config.isNode&&options.masterKey){throw new Error('AV.init(): Master Key is only used in Node.js.');}initialize(options.appId,options.appKey,options.masterKey);}else {throw new Error('AV.init(): Parameter is not correct.');}break; // 兼容旧版本的初始化方法
2845+
case 2:case 3:if(!AV._config.isNode&&arguments.length===3){throw new Error('AV.init(): Master Key is only used in Node.js.');}initialize.apply(undefined,arguments);break;}}; // If we're running in node.js, allow using the master key.
28422846
if(AV._config.isNode){AV.Cloud=AV.Cloud||{}; /**
28432847
* Switches the AVOSCloud SDK to using the Master key. The Master key grants
28442848
* priveleged access to the data in AVOSCloud and can be used to bypass ACLs and
@@ -2848,6 +2852,7 @@ if(AV._config.isNode){AV.Cloud=AV.Cloud||{}; /**
28482852
*/AV.Cloud.useMasterKey=function(){AV._useMasterKey=true;};} // 兼容老版本的初始化方法
28492853
AV.initialize=AV.init; /**
28502854
* Call this method to set production environment variable.
2855+
* @function AV.setProduction
28512856
* @param {Boolean} production True is production environment,and
28522857
* it's true by default.
28532858
*/AV.setProduction=function(production){if(!AV._isNullOrUndefined(production)){ //make sure it's a number

dist/node/browserify-wrapper/ajax.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ module.exports = function _ajax(method, resourceUrl, data, success, error) {
5353
promise.reject(err);
5454
}
5555
} else {
56-
promise.reject(JSON.parse(responseText));
56+
promise.reject({ responseText: responseText });
5757
}
5858
});
5959
});

dist/node/utils.js

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -98,34 +98,35 @@ module.exports = function (AV) {
9898
};
9999

100100
/**
101-
* Call this method first to set up your authentication tokens for LC.
102-
* You can get your keys from the Data Browser on http://leancloud.cn .
103-
* @param {Object} incloud appId, appKey, masterKey
104-
*/
101+
* Call this method first to set up your authentication tokens for AV.
102+
* You can get your app keys from the LeanCloud dashboard on http://leancloud.cn .
103+
* @function AV.init
104+
* @param args initialize options.
105+
* @param args.appId application id
106+
* @param args.appKey application key
107+
* @param args.masterKey application master key
108+
*/
105109

106110
AV.init = function () {
107-
for (var _len = arguments.length, options = Array(_len), _key = 0; _key < _len; _key++) {
108-
options[_key] = arguments[_key];
109-
}
110-
111-
switch (options.length) {
111+
switch (arguments.length) {
112112
case 1:
113+
var options = arguments.length <= 0 ? undefined : arguments[0];
113114
if ((typeof options === 'undefined' ? 'undefined' : _typeof(options)) === 'object') {
114115
if (!AV._config.isNode && options.masterKey) {
115116
throw new Error('AV.init(): Master Key is only used in Node.js.');
116117
}
117-
initialize(options[0].appId, options[0].appKey, options[0].masterKey);
118+
initialize(options.appId, options.appKey, options.masterKey);
118119
} else {
119120
throw new Error('AV.init(): Parameter is not correct.');
120121
}
121122
break;
122123
// 兼容旧版本的初始化方法
123124
case 2:
124125
case 3:
125-
if (!AV._config.isNode && options.length === 3) {
126+
if (!AV._config.isNode && arguments.length === 3) {
126127
throw new Error('AV.init(): Master Key is only used in Node.js.');
127128
}
128-
initialize.apply(undefined, options);
129+
initialize.apply(undefined, arguments);
129130
break;
130131
}
131132
};
@@ -150,6 +151,7 @@ module.exports = function (AV) {
150151

151152
/**
152153
* Call this method to set production environment variable.
154+
* @function AV.setProduction
153155
* @param {Boolean} production True is production environment,and
154156
* it's true by default.
155157
*/

0 commit comments

Comments
 (0)