mirror of
https://github.com/Microsoft/vscode
synced 2024-11-05 18:29:38 +00:00
git: remove denodeify dependency
This commit is contained in:
parent
5690a47892
commit
42e938f979
7 changed files with 8 additions and 51 deletions
|
@ -350,7 +350,6 @@
|
|||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"denodeify": "^1.2.1",
|
||||
"vscode-nls": "^2.0.1"
|
||||
}
|
||||
}
|
|
@ -9,14 +9,13 @@ import * as fs from 'fs';
|
|||
import * as path from 'path';
|
||||
import * as os from 'os';
|
||||
import * as cp from 'child_process';
|
||||
import * as denodeify from 'denodeify';
|
||||
import { assign, uniqBy, groupBy, IDisposable, toDisposable, dispose } from './util';
|
||||
import { assign, uniqBy, groupBy, denodeify, IDisposable, toDisposable, dispose } from './util';
|
||||
import { EventEmitter, Event } from 'vscode';
|
||||
import * as nls from 'vscode-nls';
|
||||
|
||||
const localize = nls.loadMessageBundle();
|
||||
const readdir = denodeify(fs.readdir);
|
||||
const readfile = denodeify<string, string, string>(fs.readFile);
|
||||
const readdir = denodeify<string[]>(fs.readdir);
|
||||
const readfile = denodeify<string>(fs.readFile);
|
||||
|
||||
export interface IGit {
|
||||
path: string;
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
{
|
||||
"globalDependencies": {
|
||||
"denodeify": "registry:dt/denodeify#1.2.1+20160316155526"
|
||||
}
|
||||
}
|
|
@ -1,31 +0,0 @@
|
|||
// Generated by typings
|
||||
// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/56295f5058cac7ae458540423c50ac2dcf9fc711/denodeify/denodeify.d.ts
|
||||
declare module "denodeify" {
|
||||
function _<R>(fn: _.F0<R>, transformer?: _.M): () => Promise<R>;
|
||||
function _<A,R>(fn: _.F1<A,R>, transformer?: _.M): (a:A) => Promise<R>;
|
||||
function _<A,B,R>(fn: _.F2<A,B,R>, transformer?: _.M): (a:A, b:B) => Promise<R>;
|
||||
function _<A,B,C,R>(fn: _.F3<A,B,C,R>, transformer?: _.M): (a:A, b:B, c:C) => Promise<R>;
|
||||
function _<A,B,C,D,R>(fn: _.F4<A,B,C,D,R>, transformer?: _.M): (a:A, b:B, c:C, d:D) => Promise<R>;
|
||||
function _<A,B,C,D,E,R>(fn: _.F5<A,B,C,D,E,R>, transformer?: _.M): (a:A, b:B, c:C, d:D, e:E) => Promise<R>;
|
||||
function _<A,B,C,D,E,F,R>(fn: _.F6<A,B,C,D,E,F,R>, transformer?: _.M): (a:A, b:B, c:C, d:D, e:E, f:F) => Promise<R>;
|
||||
function _<A,B,C,D,E,F,G,R>(fn: _.F7<A,B,C,D,E,F,G,R>, transformer?: _.M): (a:A, b:B, c:C, d:D, e:E, f:F, g:G) => Promise<R>;
|
||||
function _<A,B,C,D,E,F,G,H,R>(fn: _.F8<A,B,C,D,E,F,G,H,R>, transformer?: _.M): (a:A, b:B, c:C, d:D, e:E, f:F, g:G, h:H) => Promise<R>;
|
||||
function _(fn: _.F, transformer?: _.M): (...args: any[]) => Promise<any>;
|
||||
|
||||
module _ {
|
||||
type Callback<R> = (err: Error, result: R) => any;
|
||||
type F0<R> = (cb: Callback<R>) => any;
|
||||
type F1<A,R> = (a:A, cb: Callback<R>) => any;
|
||||
type F2<A,B,R> = (a:A, b:B, cb: Callback<R>) => any;
|
||||
type F3<A,B,C,R> = (a:A, b:B, c:C, cb: Callback<R>) => any;
|
||||
type F4<A,B,C,D,R> = (a:A, b:B, c:C, d:D, cb: Callback<R>) => any;
|
||||
type F5<A,B,C,D,E,R> = (a:A, b:B, c:C, d:D, e:E, cb: Callback<R>) => any;
|
||||
type F6<A,B,C,D,E,F,R> = (a:A, b:B, c:C, d:D, e:E, f:F, cb: Callback<R>) => any;
|
||||
type F7<A,B,C,D,E,F,G,R> = (a:A, b:B, c:C, d:D, e:E, f:F, g:G, cb: Callback<R>) => any;
|
||||
type F8<A,B,C,D,E,F,G,H,R> = (a:A, b:B, c:C, d:D, e:E, f:F, g:G, h:H, cb: Callback<R>) => any;
|
||||
type F = (...args: any[]) => any;
|
||||
type M = (err: Error, ...args: any[]) => any[];
|
||||
}
|
||||
|
||||
export = _;
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
{
|
||||
"resolution": "main",
|
||||
"tree": {
|
||||
"src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/56295f5058cac7ae458540423c50ac2dcf9fc711/denodeify/denodeify.d.ts",
|
||||
"raw": "registry:dt/denodeify#1.2.1+20160316155526",
|
||||
"typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/56295f5058cac7ae458540423c50ac2dcf9fc711/denodeify/denodeify.d.ts"
|
||||
}
|
||||
}
|
1
extensions/git/src/typings/index.d.ts
vendored
1
extensions/git/src/typings/index.d.ts
vendored
|
@ -1 +0,0 @@
|
|||
/// <reference path="globals/denodeify/index.d.ts" />
|
|
@ -88,4 +88,8 @@ export function groupBy<T>(arr: T[], fn: (el: T) => string): { [key: string]: T[
|
|||
result[key] = [...(result[key] || []), el];
|
||||
return result;
|
||||
}, Object.create(null));
|
||||
}
|
||||
}
|
||||
|
||||
export function denodeify<R>(fn: Function): (...args) => Promise<R> {
|
||||
return (...args) => new Promise((c, e) => fn(...args, (err, r) => err ? e(err) : c(r)));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue