Comparing version 1.3.1 to 1.3.2
@@ -1,2 +0,2 @@ | ||
/* eslint-disable @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unused-expressions */ | ||
/* eslint-disable @typescript-eslint/no-unused-expressions */ | ||
/** | ||
@@ -3,0 +3,0 @@ * Grows a buffer if it isn't large enough |
@@ -35,1 +35,3 @@ import type { UnionToTuple } from './types.js'; | ||
export declare function setByString(object: Record<string, any>, path: string, value: unknown, separator?: RegExp): Record<string, any>; | ||
/** Binds a class member to the instance */ | ||
export declare function bound(value: unknown, { name, addInitializer }: ClassMethodDecoratorContext): void; |
@@ -21,3 +21,3 @@ export function filterObject(object, predicate) { | ||
} | ||
catch (e) { | ||
catch { | ||
// Do nothing | ||
@@ -32,3 +32,3 @@ } | ||
} | ||
catch (e) { | ||
catch { | ||
return false; | ||
@@ -61,1 +61,9 @@ } | ||
} | ||
/** Binds a class member to the instance */ | ||
// eslint-disable-next-line @typescript-eslint/unbound-method | ||
export function bound(value, { name, addInitializer }) { | ||
addInitializer(function () { | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-call | ||
this[name] = this[name].bind(this); | ||
}); | ||
} |
{ | ||
"name": "utilium", | ||
"version": "1.3.1", | ||
"version": "1.3.2", | ||
"description": "Typescript utilities", | ||
@@ -5,0 +5,0 @@ "funding": { |
@@ -1,2 +0,2 @@ | ||
/* eslint-disable @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unused-expressions */ | ||
/* eslint-disable @typescript-eslint/no-unused-expressions */ | ||
@@ -3,0 +3,0 @@ /** |
@@ -29,3 +29,3 @@ import type { UnionToTuple } from './types.js'; | ||
to[key] = from[key] ?? defaults[key] ?? to[key]; | ||
} catch (e) { | ||
} catch { | ||
// Do nothing | ||
@@ -50,3 +50,3 @@ } | ||
return true; | ||
} catch (e) { | ||
} catch { | ||
return false; | ||
@@ -94,1 +94,10 @@ } | ||
} | ||
/** Binds a class member to the instance */ | ||
// eslint-disable-next-line @typescript-eslint/unbound-method | ||
export function bound(value: unknown, { name, addInitializer }: ClassMethodDecoratorContext) { | ||
addInitializer(function (this: any) { | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-call | ||
this[name] = this[name].bind(this); | ||
}); | ||
} |
136606
3865