From 3467c722bdb2fab166ec142071c2b2e62171d17c Mon Sep 17 00:00:00 2001 From: Glen Date: Thu, 7 Jan 2016 16:23:59 +0200 Subject: [PATCH] Add new "has" method --- browser-sync/browser-sync-tests.ts | 2 ++ browser-sync/browser-sync.d.ts | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/browser-sync/browser-sync-tests.ts b/browser-sync/browser-sync-tests.ts index 2d254ac3d..822c941d9 100644 --- a/browser-sync/browser-sync-tests.ts +++ b/browser-sync/browser-sync-tests.ts @@ -78,6 +78,8 @@ evt.on("init", function () { browserSync(config); +var has = browserSync.has("My server"); + var bs = browserSync.create(); bs.init({ diff --git a/browser-sync/browser-sync.d.ts b/browser-sync/browser-sync.d.ts index 58c1dbf65..50c00d9b9 100644 --- a/browser-sync/browser-sync.d.ts +++ b/browser-sync/browser-sync.d.ts @@ -335,6 +335,11 @@ declare module "browser-sync" { * @param name the identifier used for retrieval */ get(name: string): BrowserSyncInstance; + /** + * Check if an instance has been created. + * @param name the name of the instance + */ + has(name: string): boolean; } interface BrowserSyncInstance {