Skip to content

Commit 51c4743

Browse files
committed
单独 require underscore.
1 parent e4b5ae5 commit 51c4743

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed

src/cloudfunction.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ module.exports = function(AV) {
109109
if(!code)
110110
throw "Missing sms code.";
111111
var params = {};
112-
if(AV._.isString(phone)) {
112+
if(_.isString(phone)) {
113113
params['mobilePhoneNumber'] = phone;
114114
} else {
115115
// To be compatible with old versions.

src/file.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@
55

66
'use strict';
77

8+
const _ = require('underscore');
9+
810
// port from browserify path module
911
// since react-native packager won't shim node modules.
1012
function extname(path) {
1113
return path.match(/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/)[4];
1214
}
1315

1416
module.exports = function(AV) {
15-
const _ = AV._;
1617

1718
// 挂载一些配置
1819
let avConfig = AV._config;

src/object.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1362,7 +1362,7 @@ module.exports = function(AV) {
13621362
if (_.isString(arg0) || (arg0 && _.has(arg0, "className"))) {
13631363
return AV.Object.extend.apply(NewClassObject, arguments);
13641364
}
1365-
var newArguments = [className].concat(AV._.toArray(arguments));
1365+
var newArguments = [className].concat(_.toArray(arguments));
13661366
return AV.Object.extend.apply(NewClassObject, newArguments);
13671367
};
13681368
NewClassObject['new'] = function(attributes, options){

src/query.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ module.exports = function(AV) {
199199
self.equalTo('objectId', objectId);
200200

201201
return self.first().then(function(response) {
202-
if (!AV._.isEmpty(response)) {
202+
if (!_.isEmpty(response)) {
203203
return response;
204204
}
205205

@@ -903,7 +903,7 @@ module.exports = function(AV) {
903903
}, function() {
904904
return query.find().then(function(results) {
905905
var callbacksDone = AV.Promise.as();
906-
AV._.each(results, function(result) {
906+
_.each(results, function(result) {
907907
callbacksDone = callbacksDone.then(function() {
908908
return callback(result);
909909
});

src/status.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ module.exports = function(AV) {
7171
return AV.Object.createWithoutData('_Status', this.id);
7272
},
7373
_getDataJSON: function() {
74-
var json = AV._.clone(this.data);
74+
var json = _.clone(this.data);
7575
return AV._encode(json);
7676
},
7777
/**

0 commit comments

Comments
 (0)