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

refractor

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

refractor - npm Package Compare versions

Comparing version 2.0.0 to 2.1.0

9

core.js

@@ -41,2 +41,3 @@ 'use strict';

refract.register = register;
refract.registered = registered;

@@ -84,2 +85,10 @@ /* Register bundled grammars. */

function registered(language) {
if (typeof language !== 'string') {
throw new Error('Expected `string` for `language`, got `' + language + '`');
}
return own.call(refract.languages, language);
}
function stringify(value, language, parent) {

@@ -86,0 +95,0 @@ var env;

3

package.json
{
"name": "refractor",
"version": "2.0.0",
"version": "2.1.0",
"description": "Lightweight, robust, elegant virtual syntax highlighting using Prism",

@@ -21,2 +21,3 @@ "license": "MIT",

"Titus Wormer <tituswormer@gmail.com> (http://wooorm.com)",
"Conor Hastings <hastings.conorm@gmail.com>",
"Daniel Stefanovic <daniel.stefanovic@gmail.com>",

@@ -23,0 +24,0 @@ "Mike Kruk <tamagokun@gmail.com>"

@@ -24,2 +24,3 @@ # refractor [![Build Status][travis-badge]][travis] [![Coverage Status][codecov-badge]][codecov]

* [refractor.highlight(value, language)](#refractorhighlightvalue-language)
* [refractor.registered(language)](#refractorregisteredlanguage)
* [Browser](#browser)

@@ -139,2 +140,25 @@ * [Plugins](#plugins)

### `refractor.registered(language)`
Check if a `language` ([name or alias][syntax]) is registered.
###### Example
```js
var refractor = require('refractor/core.js');
console.log(refractor.registered('markdown'));
refractor.register(require('refractor/lang/markdown.js'));
console.log(refractor.registered('markdown'));
```
Yields:
```js
false
true
```
## Browser

@@ -141,0 +165,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