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

@domql/utils

Package Overview
Dependencies
Maintainers
0
Versions
195
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@domql/utils - npm Package Compare versions

Comparing version 2.5.167 to 2.5.168

9

dist/cjs/string.js

@@ -49,10 +49,11 @@ "use strict";

};
const replaceLiteralsWithObjectFields = (str, state, options = {}) => {
function replaceLiteralsWithObjectFields(str, options = {}, forcedState) {
if (!str.includes(options.bracketsLength === 3 ? "{{{" : "{{"))
return str;
const reg = brackRegex[options.bracketsLength || 2];
const obj = forcedState || this.state || {};
return str.replace(reg, (_, parentPath, variable) => {
if (parentPath) {
const parentLevels = parentPath.match(options.bracketsLength === 3 ? /\.\.\.\//g : /\.\.\//g).length;
let parentState = state;
let parentState = obj;
for (let i = 0; i < parentLevels; i++) {

@@ -67,7 +68,7 @@ parentState = parentState.parent;

} else {
const value = state[variable.trim()];
const value = obj[variable.trim()];
return value !== void 0 ? `${value}` : "";
}
});
};
}
const lowercaseFirstLetter = (inputString) => {

@@ -74,0 +75,0 @@ return `${inputString.charAt(0).toLowerCase()}${inputString.slice(1)}`;

@@ -17,10 +17,11 @@ const stringIncludesAny = (str, characters) => {

};
const replaceLiteralsWithObjectFields = (str, state, options = {}) => {
function replaceLiteralsWithObjectFields(str, options = {}, forcedState) {
if (!str.includes(options.bracketsLength === 3 ? "{{{" : "{{"))
return str;
const reg = brackRegex[options.bracketsLength || 2];
const obj = forcedState || this.state || {};
return str.replace(reg, (_, parentPath, variable) => {
if (parentPath) {
const parentLevels = parentPath.match(options.bracketsLength === 3 ? /\.\.\.\//g : /\.\.\//g).length;
let parentState = state;
let parentState = obj;
for (let i = 0; i < parentLevels; i++) {

@@ -35,7 +36,7 @@ parentState = parentState.parent;

} else {
const value = state[variable.trim()];
const value = obj[variable.trim()];
return value !== void 0 ? `${value}` : "";
}
});
};
}
const lowercaseFirstLetter = (inputString) => {

@@ -42,0 +43,0 @@ return `${inputString.charAt(0).toLowerCase()}${inputString.slice(1)}`;

{
"name": "@domql/utils",
"version": "2.5.167",
"version": "2.5.168",
"license": "MIT",

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

},
"gitHead": "3851b6d1029397dcf61c44682be5b9c234993e74",
"gitHead": "6c935c3d1ff70096bb532e9c5426ffc5af0677dc",
"devDependencies": {

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

@@ -32,9 +32,10 @@ 'use strict'

export const replaceLiteralsWithObjectFields = (str, state, options = {}) => {
export function replaceLiteralsWithObjectFields (str, options = {}, forcedState) {
if (!str.includes(options.bracketsLength === 3 ? '{{{' : '{{')) return str
const reg = brackRegex[options.bracketsLength || 2]
const obj = forcedState || this.state || {}
return str.replace(reg, (_, parentPath, variable) => {
if (parentPath) {
const parentLevels = parentPath.match(options.bracketsLength === 3 ? /\.\.\.\//g : /\.\.\//g).length
let parentState = state
let parentState = obj
for (let i = 0; i < parentLevels; i++) {

@@ -49,3 +50,3 @@ parentState = parentState.parent

} else {
const value = state[variable.trim()]
const value = obj[variable.trim()]
return value !== undefined ? `${value}` : ''

@@ -52,0 +53,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