universal-device
Version:
System info.
51 lines (48 loc) • 977 B
JavaScript
;
exports.__esModule = true;
exports.default = void 0;
var systemInfo;
function getSystemInfo() {
if (!systemInfo) return systemInfo = tt.getSystemInfoSync();
return systemInfo;
}
var _module = {};
[{
key: 'appName',
getFn: function getFn() {
return 'bytedance';
}
}, {
key: 'platform',
getFn: function getFn() {
return getSystemInfo().platform;
}
}, {
key: 'screenWidth',
getFn: function getFn() {
return getSystemInfo().screenWidth;
}
}, {
key: 'screenHeight',
getFn: function getFn() {
return getSystemInfo().screenHeight;
}
}, {
key: 'appVersion',
getFn: function getFn() {
return getSystemInfo().version;
}
}, {
key: 'devicePixelRatio',
getFn: function getFn() {
return getSystemInfo().pixelRatio;
}
}].forEach(function (_ref) {
var key = _ref.key,
getFn = _ref.getFn;
Object.defineProperty(_module, key, {
get: getFn
});
});
var _default = _module;
exports.default = _default;