MCPcopy
hub / github.com/cure53/DOMPurify / unapply

Function unapply

src/utils.ts:76–86  ·  view source on GitHub ↗

* Creates a new function that calls the given function with a specified thisArg and arguments. * * @param func - The function to be wrapped and called. * @returns A new function that calls the given function with a specified thisArg and arguments.

(
  func: (thisArg: any, ...args: any[]) => T
)

Source from the content-addressed store, hash-verified

74 * @returns A new function that calls the given function with a specified thisArg and arguments.
75 */
76function unapply<T>(
77 func: (thisArg: any, ...args: any[]) => T
78): (thisArg: any, ...args: any[]) => T {
79 return (thisArg: any, ...args: any[]): T => {
80 if (thisArg instanceof RegExp) {
81 thisArg.lastIndex = 0;
82 }
83
84 return apply(func, thisArg, args);
85 };
86}
87
88/**
89 * Creates a new function that constructs an instance of the given constructor function with the provided arguments.

Callers 2

utils.tsFile · 0.85
lookupGetterFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…