New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-jsx-parser

Package Overview
Dependencies
Maintainers
0
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-jsx-parser - npm Package Compare versions

Comparing version 2.2.0 to 2.2.1

37

dist/components/JsxParser.d.ts

@@ -1,22 +0,50 @@

import React, { ComponentType, ExoticComponent } from 'react';
import React from 'react';
/**
* Props for the JsxParser component
*/
export type TProps = {
/** Whether to allow rendering of unrecognized HTML elements. Defaults to true. */
allowUnknownElements?: boolean;
/**
* Whether to auto-close void elements like <img>, <br>, <hr> etc. in HTML style.
* Defaults to false.
*/
autoCloseVoidElements?: boolean;
/** Object containing values that can be referenced in the JSX string */
bindings?: {
[key: string]: unknown;
};
/**
* Array of attribute names or RegExp patterns to blacklist.
* By default removes 'on*' attributes
*/
blacklistedAttrs?: Array<string | RegExp>;
/**
* Array of HTML tag names to blacklist.
* By default removes 'script' tags
*/
blacklistedTags?: string[];
/** CSS class name(s) to add to the wrapper div */
className?: string;
components?: Record<string, ComponentType | ExoticComponent>;
/** Map of component names to their React component definitions */
components?: Record<string, React.ComponentType | React.ExoticComponent | (() => React.ReactNode)>;
/** If true, only renders custom components defined in the components prop */
componentsOnly?: boolean;
/** If true, disables usage of React.Fragment. May affect whitespace handling */
disableFragments?: boolean;
/** If true, disables automatic generation of key props */
disableKeyGeneration?: boolean;
/** The JSX string to parse and render */
jsx?: string;
/** Callback function when parsing/rendering errors occur */
onError?: (error: Error) => void;
/** If true, shows parsing/rendering warnings in console */
showWarnings?: boolean;
/** Custom error renderer function */
renderError?: (props: {
error: string;
}) => React.ReactNode | null;
/** Whether to wrap output in a div. If false, renders children directly */
renderInWrapper?: boolean;
/** Custom renderer for unrecognized elements */
renderUnrecognized?: (tagName: string) => React.ReactNode | null;

@@ -28,4 +56,9 @@ };

static defaultProps: TProps;
/** Stores the parsed React elements */
private ParsedChildren;
/**
* Renders the parsed JSX content
* @returns The rendered React elements wrapped in a div (if renderInWrapper is true)
*/
render(): string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
}

26

package.json

@@ -13,15 +13,15 @@ {

"devDependencies": {
"@happy-dom/global-registrator": "^14.12.3",
"@types/acorn": "^4.0.6",
"@happy-dom/global-registrator": "^15.7.4",
"@types/acorn": "^6.0.0",
"@types/bun": "^1.1.6",
"@typescript-eslint/eslint-plugin": "^7.15.0",
"@typescript-eslint/parser": "^7.15.0",
"basis": "TroyAlford/basis",
"concurrently": "^8.2.2",
"@typescript-eslint/eslint-plugin": "^8.0.0",
"@typescript-eslint/parser": "^8.0.0",
"basis": "github:TroyAlford/basis#v1.1.0",
"concurrently": "^9.0.1",
"cross-env": "^7.0.3",
"eslint": "^8.57.0",
"eslint": "8.57.1",
"eslint-config-airbnb": "^19.0.4",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-import": "2.31.0",
"eslint-plugin-jsx-a11y": "^6.9.0",
"eslint-plugin-react": "^7.34.3",
"eslint-plugin-react": "7.37.2",
"mkdirp": "^3.0.1",

@@ -59,12 +59,12 @@ "react": "^18.3.1",

"build": "bun build:types && bun build:code",
"build:code": "bun build --target=browser --outfile=./dist/react-jsx-parser.min.js ./source/index.ts",
"build:types": "bun run tsc -p ./tsconfig.json -d --emitDeclarationOnly",
"build:code": "bun build --target=browser --outfile=./dist/react-jsx-parser.min.js ./source/index.ts --external react --external react-dom",
"build:types": "bun run tsc -p ./tsconfig.json -d --emitDeclarationOnly --preserveWatchOutput",
"develop": "NODE_ENV=production concurrently -n build,ts,demo -c green,cyan,yellow \"bun build:code --watch\" \"bun build:types --watch\" \"bun serve\"",
"lint": "bun eslint --ext .js,.ts,.tsx source/",
"prebuild": "mkdirp ./dist && rm -rf ./dist/*",
"serve": "bun serve --port=8080 --open",
"serve": "bun ./demo/server.ts",
"test": "bun lint && bun test"
},
"types": "dist/index.d.ts",
"version": "2.2.0"
"version": "2.2.1"
}

Sorry, the diff of this file is too big to display

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