Socket
Socket
Sign inDemoInstall

@domql/element

Package Overview
Dependencies
Maintainers
1
Versions
126
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.5.52 to 2.5.53

5

create.js

@@ -37,2 +37,3 @@ 'use strict'

checkIfKeyIsComponent,
createValidDomqlObjectFromSugar,
isVariant

@@ -155,3 +156,5 @@ } from './utils/component'

if (checkIfKeyIsComponent(key)) {
if (options.syntaxv3 || element.props?.syntaxv3) {
return createValidDomqlObjectFromSugar(element, parent, key, options)
} else if (checkIfKeyIsComponent(key)) {
return applyKeyComponentAsExtend(elementWrapper, parent, key)

@@ -158,0 +161,0 @@ }

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

const redefineElement = (element, parent, key, options) => {
var _a;
const elementWrapper = createBasedOnType(element, parent, key, options);
if ((0, import_component.checkIfKeyIsComponent)(key)) {
if (options.syntaxv3 || ((_a = element.props) == null ? void 0 : _a.syntaxv3)) {
return (0, import_component.createValidDomqlObjectFromSugar)(element, parent, key, options);
} else if ((0, import_component.checkIfKeyIsComponent)(key)) {
return (0, import_component.applyKeyComponentAsExtend)(elementWrapper, parent, key);

@@ -122,0 +125,0 @@ }

20

dist/cjs/utils/component.js

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

const ENV = "development";
const DOMQL_BUILTINS = ["extend", "childExtend", "childExtendRecursive", "define", "props", "state", "on", "if", "attr", "key", "tag"];
const DOMQL_BUILTINS = [
"extend",
"childExtend",
"childExtendRecursive",
"define",
"props",
"state",
"on",
"if",
"attr",
"key",
"tag"
];
const checkIfKeyIsComponent = (key) => {

@@ -61,3 +73,3 @@ const isFirstKeyString = (0, import_utils.isString)(key);

const replaceOnKeys = (key) => key.replace(/on\w+/g, (match) => match.substring(2));
const createValidDomqlObjectFromSugar = (el) => {
const createValidDomqlObjectFromSugar = (el, parent, key, options) => {
const newElem = {

@@ -77,2 +89,6 @@ props: {},

newElem.props[k] = prop;
} else if (checkIfKeyIsComponent(k)) {
newElem[k] = prop;
} else {
newElem[k] = prop;
}

@@ -79,0 +95,0 @@ }

{
"name": "@domql/element",
"version": "2.5.52",
"version": "2.5.53",
"license": "MIT",

@@ -34,3 +34,3 @@ "type": "module",

},
"gitHead": "d417eb4852233ff71f790eae23b67b521e80c4f9",
"gitHead": "aafcffa2ebe3d9c2fb96bd3adcb05325b62e68ff",
"devDependencies": {

@@ -37,0 +37,0 @@ "@babel/core": "^7.12.0"

@@ -7,3 +7,15 @@ 'use strict'

const DOMQL_BUILTINS = ['extend', 'childExtend', 'childExtendRecursive', 'define', 'props', 'state', 'on', 'if', 'attr', 'key', 'tag']
const DOMQL_BUILTINS = [
'extend',
'childExtend',
'childExtendRecursive',
'define',
'props',
'state',
'on',
'if',
'attr',
'key',
'tag'
]

@@ -16,2 +28,3 @@ export const checkIfKeyIsComponent = (key) => {

}
export const checkIfKeyIsProperty = (key) => {

@@ -34,3 +47,3 @@ const isFirstKeyString = isString(key)

export const createValidDomqlObjectFromSugar = el => {
export const createValidDomqlObjectFromSugar = (el, parent, key, options) => {
const newElem = {

@@ -49,2 +62,6 @@ props: {},

if (!DOMQL_BUILTINS.includes(k)) newElem.props[k] = prop
} else if (checkIfKeyIsComponent(k)) {
newElem[k] = prop
} else {
newElem[k] = prop
}

@@ -51,0 +68,0 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc