We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent0c7b687 commit7726b7dCopy full SHA for 7726b7d
lib/index.js
@@ -3,15 +3,15 @@ var ReactDOM = require('react-dom');
3
varSidePanel_1=require('./components/SidePanel');
4
varStatusBar_1=require('./components/StatusBar');
5
varsetup_1=require('./modules/setup');
6
-varpolyfills_1=require('./polyfills');
7
varstore_1=require('./store');
8
varsubscriptions_1=require('./subscriptions');
+varutils_1=require('./utils');
9
varinjectTapEventPlugin=require('react-tap-event-plugin');
10
process.env.NODE_ENV='production';
11
varMain=(function(){
12
functionMain(){
13
injectTapEventPlugin();
14
-polyfills_1.default();
+utils_1.default();
15
store_1.default.dispatch(setup_1.setupVerify());
16
this.side=SidePanel_1.sideElement.init();
17
this.subscriptions=newsubscriptions_1.default();
lib/modules/tests/test-run/config-path.js
@@ -1,6 +1,6 @@
1
"use strict";
2
varpath_1=require('path');
-varsystem_1=require('../../../polyfills/system');
+varsystem_1=require('../../../utils/system');
functionconfigPath(_a){
vardir=_a.dir,tutorial=_a.tutorial,testPath=_a.testPath;
if(system_1.isWindows){
lib/modules/tutorial/utils/config-runner.js
varnode_file_exists_1=require('node-file-exists');
functionconfigRunner(name,runner,dir){
varflatDep=path_1.join(dir,'node_modules',runner,'package.json');
lib/modules/tutorials/latest-version.js
@@ -0,0 +1,13 @@
+"use strict";
+varfetch_1=require('../../utils/fetch');
+varapiCall=function(name){return("https://registry.npmjs.org/"+name);};
+functiongetLatestVersion(name,current){
+returnfetch_1.default(apiCall(name))
+.then(function(res){
+if(res){
+JSON.parse(res)['dist-tags'].latest;
+returntrue;
+}
+returnfalse;
+});
lib/utils/fetch.js
@@ -0,0 +1,17 @@
+varfetch=function(url){
+returnnewPromise(function(resolve,reject){
+varlib=url.startsWith('https') ?require('https') :require('http');
+varrequest=lib.get(url,function(response){
+if(response.statusCode<200||response.statusCode>299){
+reject(newError('Failed to load page, status code: '+response.statusCode));
+varbody=[];
+response.on('data',function(chunk){returnbody.push(chunk);});
+response.on('end',function(){returnresolve(body.join(''));});
+request.on('error',function(err){returnreject(err);});
+};
+Object.defineProperty(exports,"__esModule",{value:true});
+exports.default=fetch;
lib/utils/index.js
@@ -0,0 +1,7 @@
+varobject_values_1=require('./object-values');
+functionloadPolyfills(){
+object_values_1.default();
+exports.default=loadPolyfills;
lib/utils/object-values.js
@@ -0,0 +1,14 @@
+functionpolyfillObjectValues(){
+if(typeofObject.values!=='function'){
+Object.values=function(obj){
+varvals=newSet();
+for(varkeyinobj){
+vals.add(obj[key]);
+returnArray.from(vals);
+exports.default=polyfillObjectValues;
lib/utils/system.js
@@ -0,0 +1,2 @@
+exports.isWindows=window.navigator.appVersion.indexOf('Win')>-1||false;
src/index.ts
@@ -4,9 +4,9 @@ import * as ReactDOM from 'react-dom';
import{SideRoot,sideElement}from'./components/SidePanel';
importaddToStatusBarfrom'./components/StatusBar';
import{setupVerify}from'./modules/setup';
-importloadPolyfillsfrom'./polyfills';
importstorefrom'./store';
importSubscriptionsfrom'./subscriptions';
+importloadPolyfillsfrom'./utils/polyfills';
import*asinjectTapEventPluginfrom'react-tap-event-plugin';
// React optimization
src/modules/tests/test-run/config-path.ts
import{join}from'path';
-import{isWindows}from'../../../polyfills/system';
+import{isWindows}from'../../../utils/system';
/**
* set paths to tests as absolute paths