Socket
Socket
Sign inDemoInstall

shiki

Package Overview
Dependencies
Maintainers
1
Versions
115
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

shiki - npm Package Compare versions

Comparing version 0.0.6 to 0.1.0

4

dist/highlighter.d.ts
import { TLang } from 'shiki-languages';
import { IThemedToken } from './themedTokenizer';
import { TTheme } from 'shiki-themes';
import { TTheme, IShikiTheme } from 'shiki-themes';
export interface HighlighterOptions {
theme: TTheme;
theme: TTheme | IShikiTheme;
langs?: TLang[];

@@ -7,0 +7,0 @@ }

@@ -51,3 +51,11 @@ "use strict";

case 0:
t = shiki_themes_1.getTheme(options.theme);
if (typeof options.theme === 'string') {
t = shiki_themes_1.getTheme(options.theme);
}
else if (options.theme.name) {
t = options.theme;
}
{
t = shiki_themes_1.getTheme('nord');
}
langs = shiki_languages_1.commonLangIds.concat(shiki_languages_1.commonLangAliases);

@@ -54,0 +62,0 @@ if (options.langs) {

@@ -6,2 +6,2 @@ import { IThemedToken } from "./themedTokenizer";

}
export declare function renderToHtml(lines: IThemedToken[][], options: HtmlRendererOptions): string;
export declare function renderToHtml(lines: IThemedToken[][], options?: HtmlRendererOptions): string;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function renderToHtml(lines, options) {
if (options === void 0) { options = {}; }
var bg = options.bg || '#fff';

@@ -5,0 +6,0 @@ var html = '';

{
"name": "shiki",
"version": "0.0.6",
"version": "0.1.0",
"description": "shiki",

@@ -21,7 +21,7 @@ "keywords": [

"onigasm": "^2.2.1",
"shiki-languages": "^0.0.6",
"shiki-themes": "^0.0.6",
"shiki-languages": "^0.1.0",
"shiki-themes": "^0.1.0",
"vscode-textmate": "https://github.com/octref/vscode-textmate"
},
"gitHead": "6c638d9958e7d4031ee9bb29bf4f1cb027725eba"
"gitHead": "35e2ea87154bb333789bb24f52cd65fc9cc15ce9"
}

@@ -13,3 +13,3 @@ import { Registry, IRawTheme } from 'vscode-textmate'

export interface HighlighterOptions {
theme: TTheme
theme: TTheme | IShikiTheme
langs?: TLang[]

@@ -19,3 +19,10 @@ }

export async function getHighlighter(options: HighlighterOptions) {
const t = getTheme(options.theme)
let t: IShikiTheme;
if (typeof options.theme === 'string') {
t = getTheme(options.theme)
} else if (options.theme.name) {
t = options.theme
} {
t = getTheme('nord')
}

@@ -22,0 +29,0 @@ let langs: TLang[] = [

@@ -8,3 +8,3 @@ import { IThemedToken } from "./themedTokenizer";

export function renderToHtml(lines: IThemedToken[][], options: HtmlRendererOptions) {
export function renderToHtml(lines: IThemedToken[][], options: HtmlRendererOptions = {}) {
const bg = options.bg || '#fff'

@@ -11,0 +11,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc