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

babel-plugin-prismjs

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-prismjs - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

12

lib/getComponents.js

@@ -28,2 +28,6 @@ "use strict";

var isPlugin = function isPlugin(dep) {
return _components["default"].plugins[dep] != null;
};
var getNoCSS = function getNoCSS(type, name) {

@@ -44,2 +48,3 @@ return _components["default"][type][name].noCSS;

var getPluginPath = getPath('plugins');
var getLanguagePath = getPath('languages');

@@ -56,6 +61,7 @@ var _default = function _default() {

return [].concat(_toConsumableArray((0, _dependencies["default"])(_components["default"], languages).getIds().map(getPath('languages'))), _toConsumableArray((0, _dependencies["default"])(_components["default"], plugins).getIds().reduce(function (deps, dep) {
var add = [getPluginPath(dep)];
return [].concat(_toConsumableArray((0, _dependencies["default"])(_components["default"], [].concat(_toConsumableArray(languages), _toConsumableArray(plugins))).getIds().reduce(function (deps, dep) {
// Plugins can have language dependencies.
var add = [isPlugin(dep) ? getPluginPath(dep) : getLanguagePath(dep)];
if (css && !getNoCSS('plugins', dep)) {
if (css && isPlugin(dep) && !getNoCSS('plugins', dep)) {
add.unshift(getPluginPath(dep) + '.css');

@@ -62,0 +68,0 @@ }

{
"name": "babel-plugin-prismjs",
"version": "2.0.0",
"version": "2.0.1",
"description": "A babel plugin to use PrismJS with standard bundlers.",

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

@@ -7,2 +7,3 @@ import config from 'prismjs/components.js';

const isPlugin = dep => config.plugins[dep] != null;
const getNoCSS = (type, name) => config[type][name].noCSS;

@@ -21,9 +22,10 @@

const getPluginPath = getPath('plugins');
const getLanguagePath = getPath('languages');
export default ({ languages = [], plugins = [], theme, css = false } = {}) => [
...getLoader(config, languages).getIds().map(getPath('languages')),
...getLoader(config, plugins).getIds().reduce((deps, dep) => {
const add = [getPluginPath(dep)];
...getLoader(config, [...languages, ...plugins]).getIds().reduce((deps, dep) => {
// Plugins can have language dependencies.
const add = [isPlugin(dep) ? getPluginPath(dep) : getLanguagePath(dep)];
if (css && !getNoCSS('plugins', dep)) {
if (css && isPlugin(dep) && !getNoCSS('plugins', dep)) {
add.unshift(getPluginPath(dep) + '.css');

@@ -30,0 +32,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