Skip to content

Commit 0371c46

Browse files
committed
fix: add missing thisArg parameter
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: passed - task: lint_license_headers status: passed ---
1 parent 32672ca commit 0371c46

File tree

1 file changed

+7
-6
lines changed
  • lib/node_modules/@stdlib/object/some-own-by/docs/types

1 file changed

+7
-6
lines changed

lib/node_modules/@stdlib/object/some-own-by/docs/types/index.d.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@
2525
*
2626
* @returns boolean indicating whether an own property in an object passes a test
2727
*/
28-
type Nullary = () => boolean;
28+
type Nullary<U> = ( this: U ) => boolean;
2929

3030
/**
3131
* Checks whether an own property in an object passes a test.
3232
*
3333
* @param value - object value
3434
* @returns boolean indicating whether an own property in an object passes a test
3535
*/
36-
type Unary<T> = ( value: T ) => boolean;
36+
type Unary<T, U> = ( this: U, value: T ) => boolean;
3737

3838
/**
3939
* Checks whether an own property in an object passes a test.
@@ -42,7 +42,7 @@ type Unary<T> = ( value: T ) => boolean;
4242
* @param key - object key
4343
* @returns boolean indicating whether an own property in an object passes a test
4444
*/
45-
type Binary<T> = ( value: T, key: keyof any ) => boolean;
45+
type Binary<T, U> = ( this: U, value: T, key: keyof any ) => boolean;
4646

4747
/**
4848
* Checks whether an own property in an object passes a test.
@@ -52,7 +52,7 @@ type Binary<T> = ( value: T, key: keyof any ) => boolean;
5252
* @param obj - input object
5353
* @returns boolean indicating whether an own property in an object passes a test
5454
*/
55-
type Ternary<T> = ( value: T, key: keyof any, obj: Record<keyof any, any> ) => boolean;
55+
type Ternary<T, U> = ( this: U, value: T, key: keyof any, obj: Record<keyof any, any> ) => boolean;
5656

5757
/**
5858
* Checks whether an own property in an object passes a test.
@@ -62,7 +62,7 @@ type Ternary<T> = ( value: T, key: keyof any, obj: Record<keyof any, any> ) => b
6262
* @param obj - input object
6363
* @returns boolean indicating whether an own property in an object passes a test
6464
*/
65-
type Predicate<T> = Nullary | Unary<T> | Binary<T> | Ternary<T>;
65+
type Predicate<T, U> = Nullary<U> | Unary<T, U> | Binary<T, U> | Ternary<T, U>;
6666

6767
/**
6868
* Tests whether an object contains at least `n` own properties which pass a test implemented by a predicate function.
@@ -82,6 +82,7 @@ type Predicate<T> = Nullary | Unary<T> | Binary<T> | Ternary<T>;
8282
* @param obj - input object
8383
* @param n - number of properties
8484
* @param predicate - test function
85+
* @param thisArg - execution context
8586
* @returns boolean indicating whether an object contains at least `n` own properties which pass a test
8687
*
8788
* @example
@@ -94,7 +95,7 @@ type Predicate<T> = Nullary | Unary<T> | Binary<T> | Ternary<T>;
9495
* var bool = someOwnBy( obj, 2, isNegative );
9596
* // returns true
9697
*/
97-
declare function someOwnBy<T = unknown>( obj: Record<keyof any, any>, n: number, predicate: Predicate<T> ): boolean;
98+
declare function someOwnBy<T = unknown, U = unknown>( obj: Record<keyof any, any>, n: number, predicate: Predicate<T, U>, thisArg?: ThisParameterType<Predicate<T, U>> ): boolean;
9899

99100

100101
// EXPORTS //

0 commit comments

Comments
 (0)