File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -157,7 +157,7 @@ export function updateRecordValue<T>(
157157 * @param o - The object to check
158158 * @returns true if the object has at least one own enumerable property, false otherwise
159159 */
160- export function hasKeys ( o : Record < string , any > | null | undefined ) : boolean {
160+ export function hasKeys ( o : Record < string , any > | null | undefined ) : o is Record < string , any > {
161161 for ( const k in o ) {
162162 if ( Object . hasOwn ( o , k ) ) return true ;
163163 }
@@ -170,7 +170,10 @@ export function hasKeys(o: Record<string, any> | null | undefined): boolean {
170170 * @param required - The minimum number of truthy values required (default: 1)
171171 * @returns true if the object has at least the required number of properties with truthy values
172172 */
173- export function hasTruthyKeys ( o : Record < string , any > | null | undefined , required : number = 1 ) : boolean {
173+ export function hasTruthyKeys (
174+ o : Record < string , any > | null | undefined ,
175+ required : number = 1 ,
176+ ) : o is Record < string , any > {
174177 let count = 0 ;
175178 for ( const k in o ) {
176179 if ( Object . hasOwn ( o , k ) && o [ k ] ) {
You can’t perform that action at this time.
0 commit comments