Skip to content

Commit 7eb92a9

Browse files
Merge pull request #1878 from NativeScript/milanov/update-lodash
Update lodash to 4.13.1
2 parents f5033f9 + 56d2011 commit 7eb92a9

16 files changed

+260
-259
lines changed

lib/android-tools-info.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ export class AndroidToolsInfo implements IAndroidToolsInfo {
137137
if (options && options.validateTargetSdk) {
138138
let targetSdk = toolsInfoData.targetSdkVersion;
139139
let newTarget = `${AndroidToolsInfo.ANDROID_TARGET_PREFIX}-${targetSdk}`;
140-
if (!_.contains(AndroidToolsInfo.SUPPORTED_TARGETS, newTarget)) {
140+
if (!_.includes(AndroidToolsInfo.SUPPORTED_TARGETS, newTarget)) {
141141
let supportedVersions = AndroidToolsInfo.SUPPORTED_TARGETS.sort();
142142
let minSupportedVersion = this.parseAndroidSdkString(_.first(supportedVersions));
143143

@@ -224,7 +224,7 @@ export class AndroidToolsInfo implements IAndroidToolsInfo {
224224
if (userSpecifiedCompileSdk) {
225225
let installedTargets = this.getInstalledTargets().wait();
226226
let androidCompileSdk = `${AndroidToolsInfo.ANDROID_TARGET_PREFIX}-${userSpecifiedCompileSdk}`;
227-
if (!_.contains(installedTargets, androidCompileSdk)) {
227+
if (!_.includes(installedTargets, androidCompileSdk)) {
228228
this.$errors.failWithoutHelp(`You have specified '${userSpecifiedCompileSdk}' for compile sdk, but it is not installed on your system.`);
229229
}
230230

@@ -327,7 +327,7 @@ export class AndroidToolsInfo implements IAndroidToolsInfo {
327327
private getLatestValidAndroidTarget(): IFuture<string> {
328328
return (() => {
329329
let installedTargets = this.getInstalledTargets().wait();
330-
return _.findLast(AndroidToolsInfo.SUPPORTED_TARGETS.sort(), supportedTarget => _.contains(installedTargets, supportedTarget));
330+
return _.findLast(AndroidToolsInfo.SUPPORTED_TARGETS.sort(), supportedTarget => _.includes(installedTargets, supportedTarget));
331331
}).future<string>()();
332332
}
333333

@@ -370,7 +370,7 @@ export class AndroidToolsInfo implements IAndroidToolsInfo {
370370
this.printMessage("The ANDROID_HOME environment variable is not set or it points to a non-existent directory. You will not be able to perform any build-related operations for Android.",
371371
"To be able to perform Android build-related operations, set the `ANDROID_HOME` variable to point to the root of your Android SDK installation directory.");
372372
this._cachedAndroidHomeValidationResult = false;
373-
} else if (!_.any(expectedDirectoriesInAndroidHome.map(dir => this.$fs.exists(path.join(androidHomeEnvVar, dir)).wait()))) {
373+
} else if (!_.some(expectedDirectoriesInAndroidHome.map(dir => this.$fs.exists(path.join(androidHomeEnvVar, dir)).wait()))) {
374374
this.printMessage("The ANDROID_HOME environment variable points to incorrect directory. You will not be able to perform any build-related operations for Android.",
375375
"To be able to perform Android build-related operations, set the `ANDROID_HOME` variable to point to the root of your Android SDK installation directory, " +
376376
"where you will find `tools` and `platform-tools` directories.");

lib/commands/livesync.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export class LivesyncCommand implements ICommand {
1717

1818
let platform = args[0];
1919
if(platform) {
20-
return _.contains(this.$mobileHelper.platformNames, this.$mobileHelper.normalizePlatformName(platform));
20+
return _.includes(this.$mobileHelper.platformNames, this.$mobileHelper.normalizePlatformName(platform));
2121
}
2222

2323
return true;

lib/commands/plugin/add-plugin.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export class AddPluginCommand implements ICommand {
1414

1515
let installedPlugins = this.$pluginsService.getAllInstalledPlugins().wait();
1616
let pluginName = args[0].toLowerCase();
17-
if(_.any(installedPlugins, (plugin: IPluginData) => plugin.name.toLowerCase() === pluginName)) {
17+
if(_.some(installedPlugins, (plugin: IPluginData) => plugin.name.toLowerCase() === pluginName)) {
1818
this.$errors.failWithoutHelp(`Plugin "${pluginName}" is already installed.`);
1919
}
2020

lib/commands/plugin/remove-plugin.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export class RemovePluginCommand implements ICommand {
2525
}
2626

2727
let pluginName = args[0].toLowerCase();
28-
if(!_.any(pluginNames, name => name.toLowerCase() === pluginName)) {
28+
if(!_.some(pluginNames, name => name.toLowerCase() === pluginName)) {
2929
this.$errors.failWithoutHelp(`Plugin "${pluginName}" is not installed.`);
3030
}
3131

lib/providers/livesync-provider.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export class LiveSyncProvider implements ILiveSyncProvider {
5454
public canExecuteFastSync(filePath: string, platform: string): boolean {
5555
let platformData = this.$platformsData.getPlatformData(platform);
5656
let fastSyncFileExtensions = LiveSyncProvider.FAST_SYNC_FILE_EXTENSIONS.concat(platformData.fastLivesyncFileExtensions);
57-
return _.contains(fastSyncFileExtensions, path.extname(filePath));
57+
return _.includes(fastSyncFileExtensions, path.extname(filePath));
5858
}
5959

6060
public transferFiles(deviceAppData: Mobile.IDeviceAppData, localToDevicePaths: Mobile.ILocalToDevicePathData[], projectFilesPath: string, isFullSync: boolean): IFuture<void> {

lib/services/android-project-properties-manager.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export class AndroidProjectPropertiesManager implements IAndroidProjectPropertie
3131
public addProjectReference(referencePath: string): IFuture<void> {
3232
return (() => {
3333
let references = this.getProjectReferences().wait();
34-
let libRefExists = _.any(references, r => path.normalize(r.path) === path.normalize(referencePath));
34+
let libRefExists = _.some(references, r => path.normalize(r.path) === path.normalize(referencePath));
3535
if(!libRefExists) {
3636
this.addToPropertyList("android.library.reference", referencePath).wait();
3737
}
@@ -41,7 +41,7 @@ export class AndroidProjectPropertiesManager implements IAndroidProjectPropertie
4141
public removeProjectReference(referencePath: string): IFuture<void> {
4242
return (() => {
4343
let references = this.getProjectReferences().wait();
44-
let libRefExists = _.any(references, r => path.normalize(r.path) === path.normalize(referencePath));
44+
let libRefExists = _.some(references, r => path.normalize(r.path) === path.normalize(referencePath));
4545
if(libRefExists) {
4646
this.removeFromPropertyList("android.library.reference", referencePath).wait();
4747
} else {

lib/services/emulator-settings-service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export class EmulatorSettingsService implements Mobile.IEmulatorSettingsService
88
let platformService = this.$injector.resolve("platformService"); // this should be resolved here due to cyclic dependency
99

1010
let installedPlatforms = platformService.getInstalledPlatforms().wait();
11-
return _.contains(installedPlatforms, platform.toLowerCase());
11+
return _.includes(installedPlatforms, platform.toLowerCase());
1212
}).future<boolean>()();
1313
}
1414

lib/services/init-service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export class InitService implements IInitService {
5151
let $platformsData = this.$injector.resolve("platformsData");
5252
_.each($platformsData.platformsNames, platform => {
5353
let platformData: IPlatformData = $platformsData.getPlatformData(platform);
54-
if (!platformData.targetedOS || (platformData.targetedOS && _.contains(platformData.targetedOS, process.platform))) {
54+
if (!platformData.targetedOS || (platformData.targetedOS && _.includes(platformData.targetedOS, process.platform))) {
5555
let currentPlatformData = projectData[this.$staticConfig.CLIENT_NAME_KEY_IN_PROJECT_FILE][platformData.frameworkPackageName] || {};
5656

5757
projectData[this.$staticConfig.CLIENT_NAME_KEY_IN_PROJECT_FILE][platformData.frameworkPackageName] = _.extend(currentPlatformData, this.getVersionData(platformData.frameworkPackageName).wait());

0 commit comments

Comments
 (0)