Skip to content

Commit fd7af7e

Browse files
committed
fix: remove types from jsdoc
1 parent 4092e55 commit fd7af7e

File tree

5 files changed

+79
-77
lines changed

5 files changed

+79
-77
lines changed

dist/purify.cjs.js

Lines changed: 15 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/purify.es.mjs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ const typeErrorCreate = unconstruct(TypeError);
5151
/**
5252
* Creates a new function that calls the given function with a specified thisArg and arguments.
5353
*
54-
* @param {(thisArg: any, ...args: any[]) => T} func - The function to be wrapped and called.
55-
* @returns {(thisArg: any, ...args: any[]) => T} A new function that calls the given function with a specified thisArg and arguments.
54+
* @param func - The function to be wrapped and called.
55+
* @returns A new function that calls the given function with a specified thisArg and arguments.
5656
*/
5757
function unapply(func) {
5858
return function (thisArg) {
@@ -65,8 +65,8 @@ function unapply(func) {
6565
/**
6666
* Creates a new function that constructs an instance of the given constructor function with the provided arguments.
6767
*
68-
* @param {(...args: any[]) => T} func - The constructor function to be wrapped and called.
69-
* @returns { (...args: any[]) => T} A new function that constructs an instance of the given constructor function with the provided arguments.
68+
* @param func - The constructor function to be wrapped and called.
69+
* @returns A new function that constructs an instance of the given constructor function with the provided arguments.
7070
*/
7171
function unconstruct(func) {
7272
return function () {
@@ -79,10 +79,10 @@ function unconstruct(func) {
7979
/**
8080
* Add properties to a lookup table
8181
*
82-
* @param {Record<string, any>} set - The set to which elements will be added.
83-
* @param {readonly any[]} array - The array containing elements to be added to the set.
84-
* @param {ReturnType<typeof unapply<string>>} transformCaseFunc - An optional function to transform the case of each element before adding to the set.
85-
* @returns {Record<string, any>} The modified set with added elements.
82+
* @param set - The set to which elements will be added.
83+
* @param array - The array containing elements to be added to the set.
84+
* @param transformCaseFunc - An optional function to transform the case of each element before adding to the set.
85+
* @returns The modified set with added elements.
8686
*/
8787
function addToSet(set, array) {
8888
let transformCaseFunc = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : stringToLowerCase;
@@ -112,8 +112,8 @@ function addToSet(set, array) {
112112
/**
113113
* Clean up an array to harden against CSPP
114114
*
115-
* @param {T[]} array - The array to be cleaned.
116-
* @returns {Array<T | null>} The cleaned version of the array
115+
* @param array - The array to be cleaned.
116+
* @returns The cleaned version of the array
117117
*/
118118
function cleanArray(array) {
119119
for (let index = 0; index < array.length; index++) {
@@ -127,8 +127,8 @@ function cleanArray(array) {
127127
/**
128128
* Shallow clone an object
129129
*
130-
* @param {T} object - The object to be cloned.
131-
* @returns {T} A new object that copies the original.
130+
* @param object - The object to be cloned.
131+
* @returns A new object that copies the original.
132132
*/
133133
function clone(object) {
134134
const newObject = create(null);
@@ -149,9 +149,9 @@ function clone(object) {
149149
/**
150150
* This method automatically checks if the prop is function or getter and behaves accordingly.
151151
*
152-
* @param {T} object - The object to look up the getter function in its prototype chain.
153-
* @param {string} prop - The property name for which to find the getter function.
154-
* @returns {ReturnType<typeof unapply<any>> | (() => null)} The getter function found in the prototype chain or a fallback function.
152+
* @param object - The object to look up the getter function in its prototype chain.
153+
* @param prop - The property name for which to find the getter function.
154+
* @returns The getter function found in the prototype chain or a fallback function.
155155
*/
156156
function lookupGetter(object, prop) {
157157
while (object !== null) {

dist/purify.js

Lines changed: 15 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/purify.min.js

Lines changed: 15 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/utils.ts

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -55,30 +55,32 @@ const typeErrorCreate = unconstruct(TypeError);
5555
/**
5656
* Creates a new function that calls the given function with a specified thisArg and arguments.
5757
*
58-
* @param {(thisArg: any, ...args: any[]) => T} func - The function to be wrapped and called.
59-
* @returns {(thisArg: any, ...args: any[]) => T} A new function that calls the given function with a specified thisArg and arguments.
58+
* @param func - The function to be wrapped and called.
59+
* @returns A new function that calls the given function with a specified thisArg and arguments.
6060
*/
61-
function unapply<T>(func: (thisArg: any, ...args: any[]) => T) {
61+
function unapply<T>(
62+
func: (thisArg: any, ...args: any[]) => T
63+
): (thisArg: any, ...args: any[]) => T {
6264
return (thisArg: any, ...args: any[]): T => apply(func, thisArg, args);
6365
}
6466

6567
/**
6668
* Creates a new function that constructs an instance of the given constructor function with the provided arguments.
6769
*
68-
* @param {(...args: any[]) => T} func - The constructor function to be wrapped and called.
69-
* @returns { (...args: any[]) => T} A new function that constructs an instance of the given constructor function with the provided arguments.
70+
* @param func - The constructor function to be wrapped and called.
71+
* @returns A new function that constructs an instance of the given constructor function with the provided arguments.
7072
*/
71-
function unconstruct<T>(func: (...args: any[]) => T) {
73+
function unconstruct<T>(func: (...args: any[]) => T): (...args: any[]) => T {
7274
return (...args: any[]): T => construct(func, args);
7375
}
7476

7577
/**
7678
* Add properties to a lookup table
7779
*
78-
* @param {Record<string, any>} set - The set to which elements will be added.
79-
* @param {readonly any[]} array - The array containing elements to be added to the set.
80-
* @param {ReturnType<typeof unapply<string>>} transformCaseFunc - An optional function to transform the case of each element before adding to the set.
81-
* @returns {Record<string, any>} The modified set with added elements.
80+
* @param set - The set to which elements will be added.
81+
* @param array - The array containing elements to be added to the set.
82+
* @param transformCaseFunc - An optional function to transform the case of each element before adding to the set.
83+
* @returns The modified set with added elements.
8284
*/
8385
function addToSet(
8486
set: Record<string, any>,
@@ -116,8 +118,8 @@ function addToSet(
116118
/**
117119
* Clean up an array to harden against CSPP
118120
*
119-
* @param {T[]} array - The array to be cleaned.
120-
* @returns {Array<T | null>} The cleaned version of the array
121+
* @param array - The array to be cleaned.
122+
* @returns The cleaned version of the array
121123
*/
122124
function cleanArray<T>(array: T[]): Array<T | null> {
123125
for (let index = 0; index < array.length; index++) {
@@ -134,8 +136,8 @@ function cleanArray<T>(array: T[]): Array<T | null> {
134136
/**
135137
* Shallow clone an object
136138
*
137-
* @param {T} object - The object to be cloned.
138-
* @returns {T} A new object that copies the original.
139+
* @param object - The object to be cloned.
140+
* @returns A new object that copies the original.
139141
*/
140142
function clone<T extends Record<string, any>>(object: T): T {
141143
const newObject = create(null);
@@ -164,9 +166,9 @@ function clone<T extends Record<string, any>>(object: T): T {
164166
/**
165167
* This method automatically checks if the prop is function or getter and behaves accordingly.
166168
*
167-
* @param {T} object - The object to look up the getter function in its prototype chain.
168-
* @param {string} prop - The property name for which to find the getter function.
169-
* @returns {ReturnType<typeof unapply<any>> | (() => null)} The getter function found in the prototype chain or a fallback function.
169+
* @param object - The object to look up the getter function in its prototype chain.
170+
* @param prop - The property name for which to find the getter function.
171+
* @returns The getter function found in the prototype chain or a fallback function.
170172
*/
171173
function lookupGetter<T extends Record<string, any>>(
172174
object: T,

0 commit comments

Comments
 (0)