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

deleight

Package Overview
Dependencies
Maintainers
0
Versions
113
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

deleight - npm Package Compare versions

Comparing version

to
5.7.1

16

dist/cjs/dom/esc/esc.d.ts

@@ -27,1 +27,17 @@ /**

export declare function escString(unsafe: string): string;
/**
* Unified form of {@link escString} and {@link escObject}.
*
* @param value
* @returns
*/
export declare function esc<T extends string | object>(value: T): T;
/**
* The reverse process to escString. This can be important to
* get back a value that was previously escaped to allow transport
* within markup, for example as data attributes.
*
* @param unsafe
* @returns
*/
export declare function unEsc(unsafe: string): string;

62

dist/cjs/dom/esc/esc.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.escString = exports.escObject = void 0;
exports.unEsc = exports.esc = exports.escString = exports.escObject = void 0;
/**

@@ -24,2 +24,18 @@ * Returns an object which escapes properties sourced from it. Escaping markup is a key component of template rendering,

exports.escObject = escObject;
class EscTrap {
constructor() {
this.children = {};
}
get(target, p) {
if (this.children.hasOwnProperty(p))
return this.children[p];
const result = target[p];
if (typeof result === 'string')
return this.children[p] = escString(result);
else if (typeof result === 'object')
return this.children[p] = escObject(result);
else
return this.children[p] = result;
}
}
/**

@@ -42,17 +58,31 @@ * Escapes special HTML characters in the input (unsafe) string.

exports.escString = escString;
class EscTrap {
constructor() {
this.children = {};
}
get(target, p) {
if (this.children.hasOwnProperty(p))
return this.children[p];
const result = target[p];
if (typeof result === 'string')
return this.children[p] = escString(result);
else if (typeof result === 'object')
return this.children[p] = escObject(result);
else
return this.children[p] = result;
}
/**
* Unified form of {@link escString} and {@link escObject}.
*
* @param value
* @returns
*/
function esc(value) {
if (typeof value === 'string')
return escString(value);
else
return escObject(value);
}
exports.esc = esc;
/**
* The reverse process to escString. This can be important to
* get back a value that was previously escaped to allow transport
* within markup, for example as data attributes.
*
* @param unsafe
* @returns
*/
function unEsc(unsafe) {
return unsafe
.replace(/&amp;/g, "&")
.replace(/&lt;/g, "<")
.replace(/&gt;/g, ">")
.replace(/&quot;/g, '"')
.replace(/&#039;/g, "'");
}
exports.unEsc = unEsc;

@@ -27,2 +27,18 @@ /**

export declare function escString(unsafe: string): string;
/**
* Unified form of {@link escString} and {@link escObject}.
*
* @param value
* @returns
*/
export declare function esc<T extends string | object>(value: T): T;
/**
* The reverse process to escString. This can be important to
* get back a value that was previously escaped to allow transport
* within markup, for example as data attributes.
*
* @param unsafe
* @returns
*/
export declare function unEsc(unsafe: string): string;
//# sourceMappingURL=esc.d.ts.map

@@ -20,2 +20,18 @@ /**

}
class EscTrap {
constructor() {
this.children = {};
}
get(target, p) {
if (this.children.hasOwnProperty(p))
return this.children[p];
const result = target[p];
if (typeof result === 'string')
return this.children[p] = escString(result);
else if (typeof result === 'object')
return this.children[p] = escObject(result);
else
return this.children[p] = result;
}
}
/**

@@ -37,17 +53,29 @@ * Escapes special HTML characters in the input (unsafe) string.

}
class EscTrap {
constructor() {
this.children = {};
}
get(target, p) {
if (this.children.hasOwnProperty(p))
return this.children[p];
const result = target[p];
if (typeof result === 'string')
return this.children[p] = escString(result);
else if (typeof result === 'object')
return this.children[p] = escObject(result);
else
return this.children[p] = result;
}
/**
* Unified form of {@link escString} and {@link escObject}.
*
* @param value
* @returns
*/
export function esc(value) {
if (typeof value === 'string')
return escString(value);
else
return escObject(value);
}
/**
* The reverse process to escString. This can be important to
* get back a value that was previously escaped to allow transport
* within markup, for example as data attributes.
*
* @param unsafe
* @returns
*/
export function unEsc(unsafe) {
return unsafe
.replace(/&amp;/g, "&")
.replace(/&lt;/g, "<")
.replace(/&gt;/g, ">")
.replace(/&quot;/g, '"')
.replace(/&#039;/g, "'");
}
{
"name": "deleight",
"version": "5.7.0",
"version": "5.7.1",
"description": "A library with 9 modules for writing more expressive web applications with traditional HTML, CSS and JavaScript.",

@@ -5,0 +5,0 @@ "type": "module",

@@ -1,2 +0,2 @@

# Deleight (v5.7.0)
# Deleight (v5.7.1)

@@ -3,0 +3,0 @@ ![Logo](https://github.com/mksunny1/deleight/blob/main/docs/assets/logos/logo.png?raw=true)

Sorry, the diff of this file is not supported yet