Comparing version 5.2.3 to 5.2.4
@@ -22,2 +22,4 @@ /** | ||
* | ||
* Pending tests. Please report bugs. | ||
* | ||
* @module | ||
@@ -31,2 +33,4 @@ */ | ||
* Creates a function to be called with listener functions to return `apply | ||
* Pending tests. Please report bugs. | ||
* | ||
* @param event | ||
@@ -37,7 +41,19 @@ * @param options | ||
export declare function listener(event: keyof HTMLElementEventMap, options?: AddEventListenerOptions): (listener: EventListener) => (elements: Element | Iterable<Element>, key: IKey) => void; | ||
/** | ||
* Sets a property on 1 or more elements. | ||
* | ||
* Pending tests. Please report bugs. | ||
* | ||
* @example | ||
* | ||
* @param prop | ||
* @returns | ||
*/ | ||
export declare function setter(prop: keyof Element): (value: any) => (elements: Element | Iterable<Element>, key: IKey) => void; | ||
/** | ||
* Returns a component for setting multiple element properties or | ||
* nested properties (such as properties within Element.style | ||
* nested properties (such as properties within Element.style. | ||
* | ||
* Pending tests. Please report bugs. | ||
* | ||
* @example | ||
@@ -52,2 +68,4 @@ * ) | ||
* | ||
* Pending tests. Please report bugs. | ||
* | ||
* @example | ||
@@ -62,2 +80,4 @@ * | ||
* | ||
* Pending tests. Please report bugs. | ||
* | ||
* @example | ||
@@ -64,0 +84,0 @@ * |
@@ -23,2 +23,4 @@ "use strict"; | ||
* | ||
* Pending tests. Please report bugs. | ||
* | ||
* @module | ||
@@ -31,2 +33,4 @@ */ | ||
* Creates a function to be called with listener functions to return `apply | ||
* Pending tests. Please report bugs. | ||
* | ||
* @param event | ||
@@ -45,2 +49,12 @@ * @param options | ||
exports.listener = listener; | ||
/** | ||
* Sets a property on 1 or more elements. | ||
* | ||
* Pending tests. Please report bugs. | ||
* | ||
* @example | ||
* | ||
* @param prop | ||
* @returns | ||
*/ | ||
function setter(prop) { | ||
@@ -57,4 +71,6 @@ return (value) => (elements, key) => { | ||
* Returns a component for setting multiple element properties or | ||
* nested properties (such as properties within Element.style | ||
* nested properties (such as properties within Element.style. | ||
* | ||
* Pending tests. Please report bugs. | ||
* | ||
* @example | ||
@@ -77,2 +93,4 @@ * ) | ||
* | ||
* Pending tests. Please report bugs. | ||
* | ||
* @example | ||
@@ -95,2 +113,4 @@ * | ||
* | ||
* Pending tests. Please report bugs. | ||
* | ||
* @example | ||
@@ -97,0 +117,0 @@ * |
@@ -0,5 +1,12 @@ | ||
/** | ||
* Contains functions for caching function results. Pending tests. | ||
* Please report bugs. | ||
* | ||
* @module | ||
*/ | ||
import { ICallable } from "../../types"; | ||
/** | ||
* Caches the return value of calling a function. Repeat calls | ||
* will simply return the cached value. | ||
* will simply return the cached value. Pending tests. | ||
* Please report bugs. | ||
* | ||
@@ -10,1 +17,10 @@ * @example | ||
export declare function cache<T extends ICallable>(func: T): T; | ||
/** | ||
* Caches the return value of calling a function. using the arguments as keys. | ||
* This is also called memoization. Please don't abuse this function to avoid | ||
* memory inefficiencies. Pending tests. Please report bugs. | ||
* | ||
* @example | ||
* | ||
*/ | ||
export declare function cacheWith<T extends ICallable>(func: T): T; |
"use strict"; | ||
/** | ||
* Contains functions for caching function results. Pending tests. | ||
* Please report bugs. | ||
* | ||
* @module | ||
*/ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.cache = void 0; | ||
exports.cacheWith = exports.cache = void 0; | ||
/** | ||
* Caches the return value of calling a function. Repeat calls | ||
* will simply return the cached value. | ||
* will simply return the cached value. Pending tests. | ||
* Please report bugs. | ||
* | ||
@@ -21,1 +28,30 @@ * @example | ||
exports.cache = cache; | ||
/** | ||
* Caches the return value of calling a function. using the arguments as keys. | ||
* This is also called memoization. Please don't abuse this function to avoid | ||
* memory inefficiencies. Pending tests. Please report bugs. | ||
* | ||
* @example | ||
* | ||
*/ | ||
function cacheWith(func) { | ||
let results = []; | ||
return Object.assign((...args) => { | ||
let count, i, arg; | ||
for (let result of results) { | ||
count = 0; | ||
for ([i, arg] of args.entries()) { | ||
if (result[i] === arg) | ||
count++; | ||
else | ||
break; | ||
} | ||
if (count === args.length) | ||
return result[i + 1]; | ||
} | ||
const result = func(...args); | ||
results.push([...args, result]); | ||
return result; | ||
}, { reset: () => { results = []; } }); | ||
} | ||
exports.cacheWith = cacheWith; |
@@ -17,2 +17,4 @@ export interface IContext { | ||
* | ||
* Pending tests. Please report bugs. | ||
* | ||
* @example | ||
@@ -19,0 +21,0 @@ * |
@@ -17,2 +17,4 @@ "use strict"; | ||
* | ||
* Pending tests. Please report bugs. | ||
* | ||
* @example | ||
@@ -19,0 +21,0 @@ * |
@@ -13,7 +13,4 @@ /** | ||
* | ||
* API Table of Contents | ||
* Pending tests. Please report bugs. | ||
* | ||
* {@link Return} | ||
* {@link R} | ||
* | ||
* @module | ||
@@ -20,0 +17,0 @@ */ |
@@ -14,7 +14,4 @@ "use strict"; | ||
* | ||
* API Table of Contents | ||
* Pending tests. Please report bugs. | ||
* | ||
* {@link Return} | ||
* {@link R} | ||
* | ||
* @module | ||
@@ -21,0 +18,0 @@ */ |
@@ -17,4 +17,7 @@ /** | ||
/** | ||
* Similar to `Array.flat`. | ||
* Similar to `Array.flat`. Pending tests. Please report bugs. | ||
* | ||
* @example | ||
* | ||
* | ||
* @param it | ||
@@ -21,0 +24,0 @@ */ |
@@ -20,4 +20,7 @@ "use strict"; | ||
/** | ||
* Similar to `Array.flat`. | ||
* Similar to `Array.flat`. Pending tests. Please report bugs. | ||
* | ||
* @example | ||
* | ||
* | ||
* @param it | ||
@@ -24,0 +27,0 @@ */ |
@@ -9,2 +9,4 @@ /** | ||
* | ||
* Pending tests. Please report bugs. | ||
* | ||
* @example | ||
@@ -11,0 +13,0 @@ * |
@@ -10,2 +10,4 @@ "use strict"; | ||
* | ||
* Pending tests. Please report bugs. | ||
* | ||
* @example | ||
@@ -12,0 +14,0 @@ * |
@@ -22,2 +22,4 @@ /** | ||
* | ||
* Pending tests. Please report bugs. | ||
* | ||
* @module | ||
@@ -31,2 +33,4 @@ */ | ||
* Creates a function to be called with listener functions to return `apply | ||
* Pending tests. Please report bugs. | ||
* | ||
* @param event | ||
@@ -37,7 +41,19 @@ * @param options | ||
export declare function listener(event: keyof HTMLElementEventMap, options?: AddEventListenerOptions): (listener: EventListener) => (elements: Element | Iterable<Element>, key: IKey) => void; | ||
/** | ||
* Sets a property on 1 or more elements. | ||
* | ||
* Pending tests. Please report bugs. | ||
* | ||
* @example | ||
* | ||
* @param prop | ||
* @returns | ||
*/ | ||
export declare function setter(prop: keyof Element): (value: any) => (elements: Element | Iterable<Element>, key: IKey) => void; | ||
/** | ||
* Returns a component for setting multiple element properties or | ||
* nested properties (such as properties within Element.style | ||
* nested properties (such as properties within Element.style. | ||
* | ||
* Pending tests. Please report bugs. | ||
* | ||
* @example | ||
@@ -52,2 +68,4 @@ * ) | ||
* | ||
* Pending tests. Please report bugs. | ||
* | ||
* @example | ||
@@ -62,2 +80,4 @@ * | ||
* | ||
* Pending tests. Please report bugs. | ||
* | ||
* @example | ||
@@ -64,0 +84,0 @@ * |
@@ -22,2 +22,4 @@ /** | ||
* | ||
* Pending tests. Please report bugs. | ||
* | ||
* @module | ||
@@ -28,2 +30,4 @@ */ | ||
* Creates a function to be called with listener functions to return `apply | ||
* Pending tests. Please report bugs. | ||
* | ||
* @param event | ||
@@ -41,2 +45,12 @@ * @param options | ||
} | ||
/** | ||
* Sets a property on 1 or more elements. | ||
* | ||
* Pending tests. Please report bugs. | ||
* | ||
* @example | ||
* | ||
* @param prop | ||
* @returns | ||
*/ | ||
export function setter(prop) { | ||
@@ -52,4 +66,6 @@ return (value) => (elements, key) => { | ||
* Returns a component for setting multiple element properties or | ||
* nested properties (such as properties within Element.style | ||
* nested properties (such as properties within Element.style. | ||
* | ||
* Pending tests. Please report bugs. | ||
* | ||
* @example | ||
@@ -71,2 +87,4 @@ * ) | ||
* | ||
* Pending tests. Please report bugs. | ||
* | ||
* @example | ||
@@ -88,2 +106,4 @@ * | ||
* | ||
* Pending tests. Please report bugs. | ||
* | ||
* @example | ||
@@ -90,0 +110,0 @@ * |
@@ -0,5 +1,12 @@ | ||
/** | ||
* Contains functions for caching function results. Pending tests. | ||
* Please report bugs. | ||
* | ||
* @module | ||
*/ | ||
import { ICallable } from "../../types"; | ||
/** | ||
* Caches the return value of calling a function. Repeat calls | ||
* will simply return the cached value. | ||
* will simply return the cached value. Pending tests. | ||
* Please report bugs. | ||
* | ||
@@ -10,1 +17,10 @@ * @example | ||
export declare function cache<T extends ICallable>(func: T): T; | ||
/** | ||
* Caches the return value of calling a function. using the arguments as keys. | ||
* This is also called memoization. Please don't abuse this function to avoid | ||
* memory inefficiencies. Pending tests. Please report bugs. | ||
* | ||
* @example | ||
* | ||
*/ | ||
export declare function cacheWith<T extends ICallable>(func: T): T; |
/** | ||
* Contains functions for caching function results. Pending tests. | ||
* Please report bugs. | ||
* | ||
* @module | ||
*/ | ||
/** | ||
* Caches the return value of calling a function. Repeat calls | ||
* will simply return the cached value. | ||
* will simply return the cached value. Pending tests. | ||
* Please report bugs. | ||
* | ||
@@ -17,1 +24,29 @@ * @example | ||
} | ||
/** | ||
* Caches the return value of calling a function. using the arguments as keys. | ||
* This is also called memoization. Please don't abuse this function to avoid | ||
* memory inefficiencies. Pending tests. Please report bugs. | ||
* | ||
* @example | ||
* | ||
*/ | ||
export function cacheWith(func) { | ||
let results = []; | ||
return Object.assign((...args) => { | ||
let count, i, arg; | ||
for (let result of results) { | ||
count = 0; | ||
for ([i, arg] of args.entries()) { | ||
if (result[i] === arg) | ||
count++; | ||
else | ||
break; | ||
} | ||
if (count === args.length) | ||
return result[i + 1]; | ||
} | ||
const result = func(...args); | ||
results.push([...args, result]); | ||
return result; | ||
}, { reset: () => { results = []; } }); | ||
} |
@@ -17,2 +17,4 @@ export interface IContext { | ||
* | ||
* Pending tests. Please report bugs. | ||
* | ||
* @example | ||
@@ -19,0 +21,0 @@ * |
@@ -14,2 +14,4 @@ /** | ||
* | ||
* Pending tests. Please report bugs. | ||
* | ||
* @example | ||
@@ -16,0 +18,0 @@ * |
@@ -13,7 +13,4 @@ /** | ||
* | ||
* API Table of Contents | ||
* Pending tests. Please report bugs. | ||
* | ||
* {@link Return} | ||
* {@link R} | ||
* | ||
* @module | ||
@@ -20,0 +17,0 @@ */ |
@@ -13,7 +13,4 @@ /** | ||
* | ||
* API Table of Contents | ||
* Pending tests. Please report bugs. | ||
* | ||
* {@link Return} | ||
* {@link R} | ||
* | ||
* @module | ||
@@ -20,0 +17,0 @@ */ |
@@ -17,4 +17,7 @@ /** | ||
/** | ||
* Similar to `Array.flat`. | ||
* Similar to `Array.flat`. Pending tests. Please report bugs. | ||
* | ||
* @example | ||
* | ||
* | ||
* @param it | ||
@@ -21,0 +24,0 @@ */ |
@@ -17,4 +17,7 @@ /** | ||
/** | ||
* Similar to `Array.flat`. | ||
* Similar to `Array.flat`. Pending tests. Please report bugs. | ||
* | ||
* @example | ||
* | ||
* | ||
* @param it | ||
@@ -21,0 +24,0 @@ */ |
@@ -9,2 +9,4 @@ /** | ||
* | ||
* Pending tests. Please report bugs. | ||
* | ||
* @example | ||
@@ -11,0 +13,0 @@ * |
@@ -9,2 +9,4 @@ /** | ||
* | ||
* Pending tests. Please report bugs. | ||
* | ||
* @example | ||
@@ -11,0 +13,0 @@ * |
{ | ||
"name": "deleight", | ||
"version": "5.2.3", | ||
"version": "5.2.4", | ||
"description": "A library with 9 modules for writing more expressive web applications with traditional HTML, CSS and JavaScript.", | ||
@@ -5,0 +5,0 @@ "type": "module", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
433495
12938