Socket
Socket
Sign inDemoInstall

jsxte

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsxte - npm Package Compare versions

Comparing version 3.0.1 to 3.1.0

.prettierrc.mjs

25

CHANGELOG.md

@@ -0,1 +1,26 @@

## 3.1.0 (August 22, 2023)
### Features
- #### feat: added a json renderer ([#185](https://github.com/ncpa0/jsxte/pull/185))
Added a new renderer that can generate a JSON structure instead of html. Api for it looks similar to `renderToHtml` with the only difference being it does not accept any indentation option.
- #### feat: optimized the code (for..let loops over for..of, faster string join algo, etc.) ([#184](https://github.com/ncpa0/jsxte/pull/184))
Added code optimizations:
1. Instead of `for..of` loops that rely on iterators used the good ol' `for..let i = 0;` loops which are much faster
2. Replaced all usages of `String.join()` with a much faster custom implementation
3. Reduced the amount of needless object instantiations, (there were some places where a new object or array was created for convenience reasons, but was not really necessary) - this should slightly reduce the required GC time for cases where a lot of JSX is being processed.
4. JSX Elements props and children are made immutable up-front via `Object.freeze`
- #### feat: improvements to the `renderToStringTemplateTag` ([#183](https://github.com/ncpa0/jsxte/pull/183))
Multiple improvements to the render function for string template tags:
- New `<Interpolate>` and `<InterpolateTag>` components. Contents of those will be interpolated into the string template as is for Interpolate, and as a rendered tag for InterpolateTag (see JSDoc comments on those for more details.
- Falsy values passed to the attributes will prevent those attributes from being added at all, while truthy values will cause those attributes to be added with their names as values.
- Caching mechanism to allow for the same input to provide the exact same TemplateStringArray reference to the tag on every call.
## 3.0.1 (August 19, 2023)

@@ -2,0 +27,0 @@

53

dist/legacy/component-api/component-api.js

@@ -30,2 +30,3 @@ "use strict";

var import_jsx_elem_to_html = require("../html-parser/jsx-elem-to-html.js");
var import_jsx_elem_to_json = require("../json-renderer/jsx-elem-to-json.js");
var import_jsx_runtime = require("../jsx-runtime.js");

@@ -40,5 +41,4 @@ var ContextAccessor = class _ContextAccessor {

/**
* Retrieve the context data for the specified context. If the
* context has never been set by any of this component
* ancestors an error will be thrown.
* Retrieve the context data for the specified context. If the context has
* never been set by any of this component ancestors an error will be thrown.
*/

@@ -54,3 +54,5 @@ getOrFail(ref) {

}
/** Retrieve the context data for the specified context. */
/**
* Retrieve the context data for the specified context.
*/
get(ref) {

@@ -61,8 +63,7 @@ const value = this.map.get(ref.id);

/**
* Partially update the state of the context data. Works only
* for objects and can only be used if some context data is
* already set beforehand.
* Partially update the state of the context data. Works only for objects and
* can only be used if some context data is already set beforehand.
*
* Updates to the context made with this method are only
* visible to this component and it's descendants.
* Updates to the context made with this method are only visible to this
* component and it's descendants.
*/

@@ -74,3 +75,5 @@ update(ref, updateData) {

const arr = Array.from(data);
for (const [key, value] of Object.entries(updateData)) {
const entries = Object.entries(updateData);
for (let i = 0; i < entries.length; i++) {
const [key, value] = entries[i];
const index = Number(key);

@@ -93,4 +96,4 @@ if (!isNaN(index))

*
* Changes to the context made with this method are only
* visible to this component and it's descendants.
* Changes to the context made with this method are only visible to this
* component and it's descendants.
*/

@@ -100,3 +103,5 @@ set(ref, data) {

}
/** Check if the context data for the specified context is set. */
/**
* Check if the context data for the specified context is set.
*/
has(ref) {

@@ -106,4 +111,3 @@ return this.map.has(ref.id);

/**
* Replaces this context entries with the entries of the
* context provided.
* Replaces this context entries with the entries of the context provided.
*

@@ -131,5 +135,5 @@ * @internal

/**
* Renders the given JSX component to pure html as if it was a
* child of this component. All context available to this
* component will be available to the given component as well.
* Renders the given JSX component to pure html as if it was a child of this
* component. All context available to this component will be available to the
* given component as well.
*/

@@ -149,2 +153,15 @@ render(component) {

}
renderToJson(component) {
return (0, import_jsx_elem_to_json.jsxElemToJsonSync)(component, this, {
attributeMap: this.attributeMap
});
}
async renderToJsonAsync(component) {
const thisCopy = _ComponentApi.clone(this);
return Promise.resolve(component).then(
(c) => (0, import_jsx_elem_to_json.jsxElemToJsonAsync)(c, thisCopy, {
attributeMap: thisCopy.attributeMap
})
);
}
};

@@ -151,0 +168,0 @@ var ContextDefinition = class {

@@ -37,3 +37,10 @@ "use strict";

var mapAttributesToHtmlTagString = (attributes) => {
return attributes.map(attributeToHtmlTagString).filter((e) => e);
const results = [];
for (let i = 0; i < attributes.length; i++) {
const attribute = attributes[i];
const html = attributeToHtmlTagString(attribute);
if (html.length > 0)
results.push(html);
}
return results;
};

@@ -34,3 +34,5 @@ "use strict";

const attributes = [];
for (const [key, prop] of Object.entries(element.props)) {
const entries = Object.entries(element.props);
for (let i = 0; i < entries.length; i++) {
const [key, prop] = entries[i];
if (key !== "children") {

@@ -37,0 +39,0 @@ attributes.push([(0, import_map_attribute_name.mapAttributeName)(key, this.attributeMap), prop]);

@@ -29,3 +29,3 @@ "use strict";

var import_error_boundary = require("../error-boundary/error-boundary.js");
var import_pad = require("../utilities/pad.js");
var import_join = require("../utilities/join.js");
var import_attribute_to_html_tag_string = require("./attribute-to-html-tag-string.js");

@@ -36,3 +36,5 @@ var import_get_html_struct = require("./get-html-struct.js");

var jsxElemToHtmlSync = (element, _componentApi, options) => {
const { attributeMap = {}, currentIndent = 0, indent = 2 } = options ?? {};
const attributeMap = options?.attributeMap ?? {};
const currentIndent = options?.currentIndent ?? 0;
const indent = options?.indent ?? 2;
const componentApi = _componentApi ? import_component_api.ComponentApi.clone(_componentApi) : import_component_api.ComponentApi.create(options);

@@ -42,3 +44,3 @@ if (!isSyncElem(element))

if (element.type === "textNode") {
const indentPadding = (0, import_pad.pad)(currentIndent);
const indentPadding = " ".repeat(currentIndent);
return indentPadding + element.text;

@@ -96,3 +98,4 @@ }

const results = [];
for (const child of htmlStruct.children) {
for (let i = 0; i < htmlStruct.children.length; i++) {
const child = htmlStruct.children[i];
const renderedChild = jsxElemToHtmlSync(child, componentApi, {

@@ -106,13 +109,15 @@ indent,

}
return results.join("\n");
return (0, import_join.join)(results);
} else {
const inlineTag = htmlStruct.children.length === 0 || htmlStruct.children.every(isTextNode);
const indentPadding = (0, import_pad.pad)(currentIndent);
const startTag = [
`${indentPadding}<${htmlStruct.tag}`,
...(0, import_attribute_to_html_tag_string.mapAttributesToHtmlTagString)(htmlStruct.attributes)
].join(" ") + ">";
const indentPadding = " ".repeat(currentIndent);
const attrString = (0, import_join.join)(
(0, import_attribute_to_html_tag_string.mapAttributesToHtmlTagString)(htmlStruct.attributes),
" "
);
const startTag = `${indentPadding}<${htmlStruct.tag}` + (attrString.length ? " " : "") + (0, import_join.join)((0, import_attribute_to_html_tag_string.mapAttributesToHtmlTagString)(htmlStruct.attributes), " ") + ">";
const endTag = `${inlineTag ? "" : indentPadding}</${htmlStruct.tag}>`;
const children = [];
for (const child of htmlStruct.children) {
for (let i = 0; i < htmlStruct.children.length; i++) {
const child = htmlStruct.children[i];
const renderedChild = jsxElemToHtmlSync(child, componentApi, {

@@ -127,5 +132,5 @@ indent: inlineTag ? 0 : indent,

if (inlineTag) {
return startTag + children.join("") + endTag;
return startTag + (0, import_join.join)(children, "") + endTag;
}
return [startTag, ...children, endTag].join("\n");
return (0, import_join.join)([startTag, ...children, endTag]);
}

@@ -140,3 +145,3 @@ }

if (element.type === "textNode") {
const indentPadding = (0, import_pad.pad)(currentIndent);
const indentPadding = " ".repeat(currentIndent);
return indentPadding + element.text;

@@ -183,3 +188,4 @@ }

const results = [];
for (const child of htmlStruct.children) {
for (let i = 0; i < htmlStruct.children.length; i++) {
const child = htmlStruct.children[i];
const renderedChild = await jsxElemToHtmlAsync(child, componentApi, {

@@ -193,13 +199,15 @@ indent,

}
return results.join("\n");
return (0, import_join.join)(results);
} else {
const inlineTag = htmlStruct.children.length === 0 || htmlStruct.children.every(isTextNode);
const indentPadding = (0, import_pad.pad)(currentIndent);
const startTag = [
`${indentPadding}<${htmlStruct.tag}`,
...(0, import_attribute_to_html_tag_string.mapAttributesToHtmlTagString)(htmlStruct.attributes)
].join(" ") + ">";
const indentPadding = " ".repeat(currentIndent);
const attrString = (0, import_join.join)(
(0, import_attribute_to_html_tag_string.mapAttributesToHtmlTagString)(htmlStruct.attributes),
" "
);
const startTag = `${indentPadding}<${htmlStruct.tag}` + (attrString.length ? " " : "") + attrString + ">";
const endTag = `${inlineTag ? "" : indentPadding}</${htmlStruct.tag}>`;
const children = [];
for (const child of htmlStruct.children) {
for (let i = 0; i < htmlStruct.children.length; i++) {
const child = htmlStruct.children[i];
const renderedChild = await jsxElemToHtmlAsync(child, componentApi, {

@@ -214,7 +222,7 @@ indent: inlineTag ? 0 : indent,

if (inlineTag) {
return startTag + children.join("") + endTag;
return startTag + (0, import_join.join)(children, "") + endTag;
}
return [startTag, ...children, endTag].join("\n");
return (0, import_join.join)([startTag, ...children, endTag]);
}
}
};

@@ -24,3 +24,6 @@ "use strict";

__export(src_exports, {
DefaultTemplateArrayCache: () => import_default_cache.DefaultTemplateArrayCache,
ErrorBoundary: () => import_error_boundary.ErrorBoundary,
Interpolate: () => import_interpolate.Interpolate,
InterpolateTag: () => import_interpolate.InterpolateTag,
defineContext: () => import_component_api.defineContext,

@@ -30,2 +33,4 @@ memo: () => import_memo.memo,

renderToHtmlAsync: () => import_render_to_html.renderToHtmlAsync,
renderToJson: () => import_render_to_json.renderToJson,
renderToJsonAsync: () => import_render_to_json.renderToJsonAsync,
renderToStringTemplateTag: () => import_render_to_string_template_tag.renderToStringTemplateTag

@@ -38,6 +43,9 @@ });

__reExport(src_exports, require("./jsx/prop-types/index.js"), module.exports);
var import_interpolate = require("./string-template-parser/interpolate.js");
var import_default_cache = require("./string-template-parser/default-cache.js");
var import_error_boundary = require("./error-boundary/error-boundary.js");
var import_component_api = require("./component-api/component-api.js");
var import_render_to_html = require("./html-parser/render-to-html.js");
var import_render_to_json = require("./json-renderer/render-to-json.js");
var import_render_to_string_template_tag = require("./string-template-parser/render-to-string-template-tag.js");
var import_memo = require("./utilities/memo.js");

@@ -32,39 +32,35 @@ "use strict";

module.exports = __toCommonJS(jsx_runtime_exports);
var mapChildren = (children, accumulator) => {
switch (typeof children) {
case "string":
accumulator.push({ type: "textNode", text: children });
break;
case "number":
accumulator.push({ type: "textNode", text: children.toString() });
break;
case "object":
if (Array.isArray(children)) {
for (let i = 0; i < children.length; i++) {
const child = children[i];
mapChildren(child, accumulator);
}
} else if (children != null) {
accumulator.push(children);
}
break;
}
return accumulator;
};
var createElement = (tag, props, ...children) => {
props ?? (props = {});
if (children) {
props.children = [
...props.children ? Array.isArray(props.children) ? props.children.flat(2) : [props.children] : [],
...children.flat(2)
];
const finalChildren = [];
for (let i = 0; i < children.length; i++) {
mapChildren(children[i], finalChildren);
}
if (props?.children) {
if (typeof props.children === "string") {
props.children = { type: "textNode", text: props.children };
} else if (typeof props.children === "number") {
props.children = {
type: "textNode",
text: props.children.toString()
};
} else if (Array.isArray(props.children)) {
props.children = props.children.reduce(
(cl, child) => {
if (typeof child === "boolean" || child === null || child === void 0) {
return cl;
} else if (typeof child === "string") {
cl.push({ type: "textNode", text: child });
return cl;
} else if (typeof child === "number") {
cl.push({ type: "textNode", text: child.toString() });
return cl;
}
cl.push(child);
return cl;
},
[]
);
} else if (typeof props.children === "boolean" || props.children === null || props.children === void 0) {
props.children = [];
}
mapChildren(props.children, finalChildren);
}
props.children = finalChildren;
Object.freeze(finalChildren);
Object.freeze(props);
return {

@@ -71,0 +67,0 @@ type: "tag",

@@ -28,4 +28,7 @@ "use strict";

var import_error_boundary = require("../error-boundary/error-boundary.js");
var import_jsx_runtime = require("../jsx-runtime.js");
var import_interpolate = require("./interpolate.js");
var import_map_attribute_name = require("./map-attribute-name.js");
var import_resolve_element = require("./resolve-element.js");
var import_to_template_string_array = require("./to-template-string-array.js");
var isSyncElem = (e) => true;

@@ -41,3 +44,4 @@ var concatToLastStringOrPush = (a, s) => {

};
var jsxElemToTagFuncArgsSync = (element, attributeMap, _componentApi = import_component_api.ComponentApi.create()) => {
var jsxElemToTagFuncArgsSync = (element, options, _componentApi = import_component_api.ComponentApi.create()) => {
const { attributeMap = {} } = options;
const componentApi = _componentApi ? import_component_api.ComponentApi.clone(_componentApi) : import_component_api.ComponentApi.create({ attributeMap });

@@ -62,3 +66,3 @@ if (!isSyncElem(element))

}
return jsxElemToTagFuncArgsSync(subElem2, attributeMap, componentApi);
return jsxElemToTagFuncArgsSync(subElem2, options, componentApi);
} catch (e) {

@@ -75,9 +79,22 @@ const fallbackElem = boundary.onError(

}
return jsxElemToTagFuncArgsSync(
fallbackElem,
attributeMap,
componentApi
);
return jsxElemToTagFuncArgsSync(fallbackElem, options, componentApi);
}
}
if (import_interpolate.Interpolate._isInterpolate(element.tag)) {
const results = [[], []];
results[0].push("", "");
results[1].push(element.props.children);
return results;
}
if (import_interpolate.InterpolateTag._isInterpolateRender(element.tag)) {
const results = [[], []];
const [tmpTsa, params] = jsxElemToTagFuncArgsSync(
(0, import_jsx_runtime.createElement)("", element.props),
options
);
const templateStringArray = (0, import_to_template_string_array.toTemplateStringArray)(tmpTsa);
results[0].push("", "");
results[1].push(options.tag(templateStringArray, ...params));
return results;
}
const subElem = element.tag(

@@ -92,3 +109,3 @@ element.props,

}
return jsxElemToTagFuncArgsSync(subElem, attributeMap, componentApi);
return jsxElemToTagFuncArgsSync(subElem, options, componentApi);
} else {

@@ -98,11 +115,12 @@ const { attributes, children } = (0, import_resolve_element.resolveElement)(element);

const results = [[], []];
for (const child of children) {
for (let i = 0; i < children.length; i++) {
const child = children[i];
const [[first, ...strings], tagParams] = jsxElemToTagFuncArgsSync(
child,
attributeMap,
options,
componentApi
);
concatToLastStringOrPush(results, first);
results[0].push(...strings);
results[1].push(...tagParams);
results[0] = results[0].concat(strings);
results[1] = results[1].concat(tagParams);
}

@@ -117,4 +135,7 @@ return results;

const attrList = Object.entries(attributes);
for (const index in attrList) {
for (let index = 0; index < attrList.length; index++) {
const [attrName, value] = attrList[index];
if (value === false || value === null || value === void 0) {
continue;
}
concatToLastStringOrPush(

@@ -124,15 +145,16 @@ results,

);
results[1].push(value);
results[1].push(value === true ? attrName : value);
results[0].push('"');
}
concatToLastStringOrPush(results, part2);
for (const child of children) {
for (let i = 0; i < children.length; i++) {
const child = children[i];
const [[first, ...strings], tagParams] = jsxElemToTagFuncArgsSync(
child,
attributeMap,
options,
componentApi
);
concatToLastStringOrPush(results, first);
results[0].push(...strings);
results[1].push(...tagParams);
results[0] = results[0].concat(strings);
results[1] = results[1].concat(tagParams);
}

@@ -139,0 +161,0 @@ concatToLastStringOrPush(results, part3);

@@ -27,9 +27,15 @@ "use strict";

var import_jsx_elem_to_strings = require("./jsx-elem-to-strings.js");
var renderToStringTemplateTag = (tag, Component, options) => {
const [templateStringArray, params] = (0, import_jsx_elem_to_strings.jsxElemToTagFuncArgsSync)(
Component,
options?.attributeMap ?? {}
);
Object.assign(templateStringArray, { raw: [...templateStringArray] });
var import_to_template_string_array = require("./to-template-string-array.js");
var renderToStringTemplateTag = (tag, Component, options = {}) => {
const [tmpTsa, params] = (0, import_jsx_elem_to_strings.jsxElemToTagFuncArgsSync)(Component, {
...options,
tag
});
const templateStringArray = (0, import_to_template_string_array.toTemplateStringArray)(tmpTsa);
const cached = options?.cache?.get(templateStringArray);
if (cached) {
return tag(cached, ...params);
}
options?.cache?.set(templateStringArray);
return tag(templateStringArray, ...params);
};

@@ -23,2 +23,3 @@ "use strict";

__export(resolve_element_exports, {
asArray: () => asArray,
resolveElement: () => resolveElement

@@ -25,0 +26,0 @@ });

import { type RendererInternalOptions } from "../html-parser/jsx-elem-to-html";
import { type JsxteJson } from "../json-renderer/jsx-elem-to-json";
export declare class ContextAccessor {

@@ -7,16 +8,16 @@ private map;

/**
* Retrieve the context data for the specified context. If the
* context has never been set by any of this component
* ancestors an error will be thrown.
* Retrieve the context data for the specified context. If the context has
* never been set by any of this component ancestors an error will be thrown.
*/
getOrFail<T>(ref: ContextDefinition<T>): T;
/** Retrieve the context data for the specified context. */
/**
* Retrieve the context data for the specified context.
*/
get<T>(ref: ContextDefinition<T>): T | undefined;
/**
* Partially update the state of the context data. Works only
* for objects and can only be used if some context data is
* already set beforehand.
* Partially update the state of the context data. Works only for objects and
* can only be used if some context data is already set beforehand.
*
* Updates to the context made with this method are only
* visible to this component and it's descendants.
* Updates to the context made with this method are only visible to this
* component and it's descendants.
*/

@@ -27,7 +28,9 @@ update<T extends object>(ref: ContextDefinition<T>, updateData: Partial<T>): void;

*
* Changes to the context made with this method are only
* visible to this component and it's descendants.
* Changes to the context made with this method are only visible to this
* component and it's descendants.
*/
set<T>(ref: ContextDefinition<T>, data: T): void;
/** Check if the context data for the specified context is set. */
/**
* Check if the context data for the specified context is set.
*/
has<T>(ref: ContextDefinition<T>): boolean;

@@ -39,12 +42,16 @@ }

static clone(original: ComponentApi): ComponentApi;
/** Access to the current context data. */
/**
* Access to the current context data.
*/
ctx: ContextAccessor;
private constructor();
/**
* Renders the given JSX component to pure html as if it was a
* child of this component. All context available to this
* component will be available to the given component as well.
* Renders the given JSX component to pure html as if it was a child of this
* component. All context available to this component will be available to the
* given component as well.
*/
render(component: JSX.Element): string;
renderAsync(component: JSX.Element | Promise<JSX.Element>): Promise<string>;
renderToJson(component: JSX.Element): JsxteJson | string;
renderToJsonAsync(component: JSX.Element | Promise<JSX.Element>): Promise<JsxteJson | string>;
}

@@ -51,0 +58,0 @@ export declare class ContextDefinition<T> {

@@ -5,5 +5,8 @@ import "./utilities/array-flat-polyfill";

export * from "./jsx/prop-types/index";
export { Interpolate, InterpolateTag, } from "./string-template-parser/interpolate";
export { DefaultTemplateArrayCache } from "./string-template-parser/default-cache";
export { ErrorBoundary } from "./error-boundary/error-boundary";
export { defineContext } from "./component-api/component-api";
export { renderToHtml, renderToHtmlAsync } from "./html-parser/render-to-html";
export { renderToJson, renderToJsonAsync, } from "./json-renderer/render-to-json";
export { renderToStringTemplateTag } from "./string-template-parser/render-to-string-template-tag";

@@ -17,1 +20,2 @@ export { memo } from "./utilities/memo";

export type { Target } from "./jsx/prop-types/shared/target";
export type { JsxteJson } from "./json-renderer/jsx-elem-to-json";
import { ComponentApi } from "../component-api/component-api";
import type { StringTemplateParserOptions } from "./render-to-string-template-tag";
import type { StringTemplateTag } from "./string-template-tag-type";
export type StringTemplateParserInternalOptions = StringTemplateParserOptions & {
tag: StringTemplateTag<any>;
};
type TagFunctionArgs = [string[], any[]];
export declare const jsxElemToTagFuncArgsSync: (element: JSX.Element, attributeMap: Record<string, string>, _componentApi?: ComponentApi) => TagFunctionArgs;
export declare const jsxElemToTagFuncArgsSync: (element: JSX.Element, options: StringTemplateParserInternalOptions, _componentApi?: ComponentApi) => TagFunctionArgs;
export {};
import type { StringTemplateTag } from "./string-template-tag-type";
export interface TemplateLiteralCache {
get: (templateStringsArray: TemplateStringsArray) => TemplateStringsArray | undefined;
set: (templateStringsArray: TemplateStringsArray) => void;
}
export type StringTemplateParserOptions = {
/**
* Mappings for html attribute names. Attributes defined in
* here will get renamed during the rendering to whatever is set.
* Mappings for html attribute names. Attributes defined in here
* will get renamed during the rendering to whatever is set.
*
* @example
* const options = {
* attributeMap: { onclick: "@click" },
* attributeMap: { onclick: "@click" },
* };
*
* renderToStringTemplateTag(
* html,
* <button onclick={handle}>Click Me</button>,
* options
* html,
* <button onclick={handle}>Click Me</button>,
* options
* );

@@ -21,3 +25,25 @@ * // Will give the same result as

attributeMap?: Record<string, string>;
/**
* Template literal tags have a specific behavior to them, the
* `TemplateStringsArray` is memoized for evaluations of the same
* template literal. This is possible because the
* `TemplateStringsArray` contains only parts of the template
* literal that are not dynamic, and will never change.
*
* JSXTE templates can produce different `TemplateStringsArray` so
* similar behavior is not possible.
*
* By providing a cache object you can simulate a similar behavior
* to real template literals. Cache object is expected to be an
* object with a `get` and `set` method.
*
* The `get` method shall compare the given `TemplateStringsArray`
* to the ones in the cache and if a value that is deeply equal to
* it exists, return it.
*
* The `set` method shall store the given `TemplateStringsArray` in
* the cache.
*/
cache?: TemplateLiteralCache;
};
export declare const renderToStringTemplateTag: <R>(tag: StringTemplateTag<R>, Component: JSX.Element, options?: StringTemplateParserOptions) => R;

@@ -0,1 +1,6 @@

type GetArrayFromUnion<U> = Exclude<U, Exclude<U, Array<any>>>;
type GetNonArraysFromUnion<U> = Exclude<U, Array<any>>;
type ArrayType<A> = A extends Array<infer T> ? T : never;
type AsArray<T> = [GetArrayFromUnion<T>] extends [never] ? GetNonArraysFromUnion<T>[] : Array<ArrayType<GetArrayFromUnion<T>> | GetNonArraysFromUnion<T>>;
export declare function asArray<T>(v: T): AsArray<T>;
export declare const resolveElement: (element: JSXTE.TagElement) => {

@@ -7,1 +12,2 @@ attributes: {

};
export {};
{
"name": "jsxte",
"version": "3.0.1",
"version": "3.1.0",
"description": "JSX-based html templating engine for browsers or Node environments.",

@@ -5,0 +5,0 @@ "license": "MIT",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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