Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@neocodemirror/svelte

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@neocodemirror/svelte - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

16

./dist/index.js

@@ -20,2 +20,3 @@ import { defaultKeymap, indentWithTab } from '@codemirror/commands';

lang,
langMap,
instanceStore,

@@ -45,2 +46,3 @@ useTabs = false,

lang,
langMap,
setup,

@@ -82,2 +84,3 @@ useTabs,

lang,
langMap,
setup,

@@ -116,3 +119,3 @@ useTabs,

};
async function make_extensions(lang, setup, useTabs = false, tabSize = 2, theme, styles, extensions) {
async function make_extensions(lang, langMap, setup, useTabs = false, tabSize = 2, theme, styles, extensions) {
const internal_extensions = [

@@ -125,3 +128,12 @@ keymap.of([...defaultKeymap, ...useTabs ? [indentWithTab] : []]),

if (lang) {
internal_extensions.push(lang);
if (typeof lang === "string") {
if (!langMap)
throw new Error("`langMap` is required when `lang` is a string.");
if (!(lang in langMap))
throw new Error(`Language "${lang}" is not defined in \`langMap\`.`);
const lang_support = await langMap[lang]();
internal_extensions.push(lang_support);
} else {
internal_extensions.push(lang);
}
}

@@ -128,0 +140,0 @@ if (theme)

4

dist/index.d.ts

@@ -63,2 +63,3 @@ import { LanguageSupport } from '@codemirror/language';

type MaybePromise<T> = T | Promise<T>;
type Styles = {

@@ -70,3 +71,4 @@ [val: string]: Properties | Styles;

setup?: 'basic' | 'minimal';
lang?: LanguageSupport;
lang?: LanguageSupport | string;
langMap?: Record<string, () => MaybePromise<LanguageSupport>>;
useTabs?: boolean;

@@ -73,0 +75,0 @@ styles?: Styles;

@@ -20,2 +20,3 @@ import { defaultKeymap, indentWithTab } from '@codemirror/commands';

lang,
langMap,
instanceStore,

@@ -45,2 +46,3 @@ useTabs = false,

lang,
langMap,
setup,

@@ -82,2 +84,3 @@ useTabs,

lang,
langMap,
setup,

@@ -116,3 +119,3 @@ useTabs,

};
async function make_extensions(lang, setup, useTabs = false, tabSize = 2, theme, styles, extensions) {
async function make_extensions(lang, langMap, setup, useTabs = false, tabSize = 2, theme, styles, extensions) {
const internal_extensions = [

@@ -125,3 +128,12 @@ keymap.of([...defaultKeymap, ...useTabs ? [indentWithTab] : []]),

if (lang) {
internal_extensions.push(lang);
if (typeof lang === "string") {
if (!langMap)
throw new Error("`langMap` is required when `lang` is a string.");
if (!(lang in langMap))
throw new Error(`Language "${lang}" is not defined in \`langMap\`.`);
const lang_support = await langMap[lang]();
internal_extensions.push(lang_support);
} else {
internal_extensions.push(lang);
}
}

@@ -128,0 +140,0 @@ if (theme)

{
"name": "@neocodemirror/svelte",
"version": "0.0.1",
"version": "0.0.2",
"description": "Svelte Action to add codemirro to your apps 😉",

@@ -5,0 +5,0 @@ "main": "./dist/index.js",

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