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

@codemirror/language

Package Overview
Dependencies
Maintainers
2
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@codemirror/language - npm Package Compare versions

Comparing version 0.19.3 to 0.19.4

6

CHANGELOG.md

@@ -0,1 +1,7 @@

## 0.19.4 (2021-11-13)
### New features
`LanguageDescription.of` now takes an optional already-loaded extension.
## 0.19.3 (2021-09-13)

@@ -2,0 +8,0 @@

10

dist/index.d.ts

@@ -301,3 +301,4 @@ import { NodeProp, NodeType, Parser, Tree, TreeFragment, Input, PartialParse, SyntaxNode } from '@lezer/common';

/**
An optional array of extensions associated with this language.
An optional array of filename extensions associated with this
language.
*/

@@ -312,3 +313,8 @@ extensions?: readonly string[];

*/
load: () => Promise<LanguageSupport>;
load?: () => Promise<LanguageSupport>;
/**
Alternatively to `load`, you can provide an already loaded
support object. Either this or `load` should be provided.
*/
support?: LanguageSupport;
}): LanguageDescription;

@@ -315,0 +321,0 @@ /**

21

dist/index.js
import { NodeProp, Tree, TreeFragment, Parser, NodeType } from '@lezer/common';
import { Facet, EditorState, StateEffect, StateField } from '@codemirror/state';
import { StateEffect, StateField, Facet, EditorState } from '@codemirror/state';
import { ViewPlugin } from '@codemirror/view';

@@ -610,3 +610,7 @@ import { countColumn } from '@codemirror/text';

*/
filename, loadFunc) {
filename, loadFunc,
/**
If the language has been loaded, this will hold its value.
*/
support = undefined) {
this.name = name;

@@ -617,6 +621,3 @@ this.alias = alias;

this.loadFunc = loadFunc;
/**
If the language has been loaded, this will hold its value.
*/
this.support = undefined;
this.support = support;
this.loading = null;

@@ -636,3 +637,9 @@ }

static of(spec) {
return new LanguageDescription(spec.name, (spec.alias || []).concat(spec.name).map(s => s.toLowerCase()), spec.extensions || [], spec.filename, spec.load);
let { load, support } = spec;
if (!load) {
if (!support)
throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");
load = () => Promise.resolve(support);
}
return new LanguageDescription(spec.name, (spec.alias || []).concat(spec.name).map(s => s.toLowerCase()), spec.extensions || [], spec.filename, load, support);
}

@@ -639,0 +646,0 @@ /**

{
"name": "@codemirror/language",
"version": "0.19.3",
"version": "0.19.4",
"description": "Language support infrastructure for the CodeMirror code editor",

@@ -5,0 +5,0 @@ "scripts": {

Sorry, the diff of this file is not supported yet

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