os.tmpDir() is deprecated

Summary:
According to [5e5ec2cd1e](https://github.com/nodejs/node/commit/5e5ec2cd1e) os.tmpDir() is now deprecated in node.js 7 and `os.tmpdir()` is preferred :)

Current status:
Bundler shows annoying warning every time it runs :)
Closes https://github.com/facebook/react-native/pull/10620

Differential Revision: D4101498

fbshipit-source-id: 0de8cc30f684f1f22191c64fa2c7ce73c5abf9ea
This commit is contained in:
Pooya Parsa 2016-10-29 13:43:49 -07:00 committed by Facebook Github Bot
parent 2a43487faa
commit be244f3a72
2 changed files with 2 additions and 3 deletions

View File

@ -15,7 +15,7 @@ jest
jest jest
.mock('fs') .mock('fs')
.setMock('os', { .setMock('os', {
tmpDir() { return 'tmpDir'; }, tmpdir() { return 'tmpdir'; },
}); });
jest.useRealTimers(); jest.useRealTimers();

View File

@ -16,8 +16,7 @@ const denodeify = require('denodeify');
const fs = require('graceful-fs'); const fs = require('graceful-fs');
const isAbsolutePath = require('absolute-path'); const isAbsolutePath = require('absolute-path');
const path = require('path'); const path = require('path');
/* $FlowFixMe: missing function definition. */ const tmpDir = require('os').tmpdir();
const tmpDir = require('os').tmpDir();
function getObjectValues<T>(object: {[key: string]: T}): Array<T> { function getObjectValues<T>(object: {[key: string]: T}): Array<T> {
return Object.keys(object).map(key => object[key]); return Object.keys(object).map(key => object[key]);