Update methods to reflect platform information

This updates the implementations of the os.type() and os.platform()
methods to reflect more accurate system/platform information.

os.type() has been updated to simply return 'React Native'
os.platform() has been updated to return the current platform, either
'android', 'ios', or whatever else might be returned by Platform.OS
This commit is contained in:
Giles Van Gruisen 2016-12-06 14:40:48 -05:00
parent c998f8322b
commit a7b7b41956
1 changed files with 5 additions and 4 deletions

View File

@ -1,7 +1,8 @@
// original: https://github.com/CoderPuppy/os-browserify
var {
DeviceEventEmitter,
NativeModules
NativeModules,
Platform
} = require('react-native');
var RNOS = NativeModules.RNOS;
@ -34,7 +35,7 @@ exports.totalmem = function () {
exports.cpus = function () { return [] };
exports.type = function () { return 'Browser' };
exports.type = function () { return 'React Native' };
exports.release = function () {
if (typeof navigator !== 'undefined') {
@ -51,10 +52,10 @@ exports.networkInterfaces
exports.arch = function () { return 'javascript' };
exports.platform = function () { return 'browser' };
exports.platform = function () { return Platform.OS };
exports.tmpdir = exports.tmpDir = function () {
return '/tmp';
};
exports.EOL = '\n';
exports.EOL = '\n';