From 99e6f2cc4a8105e5b82221a0f4db3a0cadc79f99 Mon Sep 17 00:00:00 2001 From: Alexey Mulyukin Date: Tue, 7 May 2019 19:12:33 +0300 Subject: [PATCH] Expose detectVersion function --- index.js | 8 +++++++- typings.d.ts | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index c0e0117..e9d159d 100644 --- a/index.js +++ b/index.js @@ -103,4 +103,10 @@ module.exports.parse = (options) => new Promise((resolve, reject) => { } catch (error) { reject(error); } -}); \ No newline at end of file +}); + +module.exports.detectVersion = (options) => { + validateOptions(options); + + return SvelteVersionDetector.detectVersionFromOptions(options); +}; diff --git a/typings.d.ts b/typings.d.ts index 523bd79..260e4c3 100644 --- a/typings.d.ts +++ b/typings.d.ts @@ -161,6 +161,10 @@ export interface SvelteComponentDoc { * The name of the parsed component. */ name?: string|null; + /** + * The Svelte compiler version that used for this document. + */ + version?: number, /** * The component description. */