From dfa1042f2bc5e620e4aa86f5a4c295010715e7f2 Mon Sep 17 00:00:00 2001 From: tony-sull Date: Mon, 18 Apr 2022 16:31:07 +0000 Subject: [PATCH] [ci] format --- packages/astro/components/Shiki.js | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/packages/astro/components/Shiki.js b/packages/astro/components/Shiki.js index 9e8e60bc2..2d0644653 100644 --- a/packages/astro/components/Shiki.js +++ b/packages/astro/components/Shiki.js @@ -4,19 +4,21 @@ import { getHighlighter as getShikiHighlighter } from 'shiki'; const _resolvedHighlighters = new Map(); function stringify(opts) { - // Always sort keys before stringifying to make sure objects match regardless of parameter ordering - return JSON.stringify(opts, Object.keys(opts).sort()); + // Always sort keys before stringifying to make sure objects match regardless of parameter ordering + return JSON.stringify(opts, Object.keys(opts).sort()); } export function getHighlighter(opts) { - const key = stringify(opts); + const key = stringify(opts); - // Highlighter has already been requested, reuse the same instance - if (_resolvedHighlighters.has(key)) { return _resolvedHighlighters.get(key) } + // Highlighter has already been requested, reuse the same instance + if (_resolvedHighlighters.has(key)) { + return _resolvedHighlighters.get(key); + } - // Start the async getHighlighter call and cache the Promise - const highlighter = getShikiHighlighter(opts); - _resolvedHighlighters.set(key, highlighter); + // Start the async getHighlighter call and cache the Promise + const highlighter = getShikiHighlighter(opts); + _resolvedHighlighters.set(key, highlighter); - return highlighter; -} \ No newline at end of file + return highlighter; +}