Adding some typings in npm scripts
parent
63d0559cff
commit
a3fa7ad178
|
@ -2,7 +2,8 @@
|
|||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es2017",
|
||||
"jsx": "preserve"
|
||||
"jsx": "preserve",
|
||||
"checkJs": true
|
||||
},
|
||||
"include": [
|
||||
"**/*.js"
|
||||
|
|
|
@ -8,6 +8,10 @@ const path = require('path');
|
|||
const fs = require('fs');
|
||||
const yarn = process.platform === 'win32' ? 'yarn.cmd' : 'yarn';
|
||||
|
||||
/**
|
||||
* @param {string} location
|
||||
* @param {*} [opts]
|
||||
*/
|
||||
function yarnInstall(location, opts) {
|
||||
opts = opts || {};
|
||||
opts.cwd = location;
|
||||
|
|
|
@ -7,6 +7,9 @@ const cp = require('child_process');
|
|||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
/**
|
||||
* @param {string} location
|
||||
*/
|
||||
function updateGrammar(location) {
|
||||
const npm = process.platform === 'win32' ? 'npm.cmd' : 'npm';
|
||||
const result = cp.spawnSync(npm, ['run', 'update-grammar'], {
|
||||
|
|
|
@ -12,6 +12,9 @@ var cson = require('cson-parser');
|
|||
var https = require('https');
|
||||
var url = require('url');
|
||||
|
||||
/**
|
||||
* @param {string} urlString
|
||||
*/
|
||||
function getOptions(urlString) {
|
||||
var _url = url.parse(urlString);
|
||||
var headers = {
|
||||
|
@ -19,7 +22,7 @@ function getOptions(urlString) {
|
|||
};
|
||||
var token = process.env['GITHUB_TOKEN'];
|
||||
if (token) {
|
||||
headers['Authorization'] = 'token ' + token
|
||||
headers['Authorization'] = 'token ' + token;
|
||||
}
|
||||
return {
|
||||
protocol: _url.protocol,
|
||||
|
@ -30,6 +33,10 @@ function getOptions(urlString) {
|
|||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} url
|
||||
* @param {number} redirectCount
|
||||
*/
|
||||
function download(url, redirectCount) {
|
||||
return new Promise((c, e) => {
|
||||
var content = '';
|
||||
|
|
Loading…
Reference in New Issue