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

bright

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bright - npm Package Compare versions

Comparing version 0.8.0 to 0.8.1

26

dist/index.js

@@ -532,15 +532,15 @@ "use strict";

function parseChildren(children, lang, code) {
var _a, _b, _c, _d;
var _a, _b, _c;
if (typeof children === "object" && (children == null ? void 0 : children.type) === "code") {
return {
code: (_b = (_a = children.props) == null ? void 0 : _a.children) == null ? void 0 : _b.trim(),
lang: ((_d = (_c = children.props) == null ? void 0 : _c.className) == null ? void 0 : _d.replace("language-", "")) || "text"
...getLanguageAndTitle((_c = children.props) == null ? void 0 : _c.className)
};
} else if (typeof children === "object") {
const subProps = import_react.default.Children.toArray(children).map((c) => {
var _a2, _b2, _c2, _d2;
var _a2, _b2, _c2;
const codeProps = (_b2 = (_a2 = c.props) == null ? void 0 : _a2.children) == null ? void 0 : _b2.props;
return {
code: (_c2 = codeProps.children) == null ? void 0 : _c2.trim(),
lang: ((_d2 = codeProps.className) == null ? void 0 : _d2.replace("language-", "")) || "text"
...getLanguageAndTitle(codeProps.className)
};

@@ -558,2 +558,20 @@ });

}
function getLanguageAndTitle(className) {
if (!className) {
return {
lang: "text"
};
}
const metastring = className.replace("language-", "");
const lang = metastring.split(".").pop();
if (lang !== metastring) {
return {
lang,
title: metastring
};
}
return {
lang
};
}
// Annotate the CommonJS export names for ESM import in node:

@@ -560,0 +578,0 @@ 0 && (module.exports = {

2

package.json
{
"name": "bright",
"version": "0.8.0",
"version": "0.8.1",
"main": "./dist/index.js",

@@ -5,0 +5,0 @@ "module": "./dist/index.mjs",

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