8000 Auto-generated commit · stdlib-js/utils-some-by-right@2ef9465 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2ef9465

Browse files
committed
Auto-generated commit
1 parent 3c6b365 commit 2ef9465

File tree

6 files changed

+21
-22
lines changed

6 files changed

+21
-22
lines changed

.github/.keepalive

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/workflows/productionize.yml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -82,21 +82,6 @@ jobs:
8282
id: transform-error-messages
8383
uses: stdlib-js/transform-errors-action@main
8484

85-
# Format error messages:
86-
- name: 'Replace double quotes with single quotes in rewritten format string error messages'
87-
run: |
88-
find . -name "*.js" -exec sed -E -i "s/Error\( format\( \"([a-zA-Z0-9]+)\"/Error\( format\( '\1'/g" {} \;
89-
90-
# Format string literal error messages:
91-
- name: 'Replace double quotes with single quotes in rewritten string literal error messages'
92-
run: |
93-
find . -name "*.js" -exec sed -E -i "s/Error\( format\(\"([a-zA-Z0-9]+)\"\)/Error\( format\( '\1' \)/g" {} \;
94-
95-
# Format code:
96-
- name: 'Replace double quotes with single quotes in inserted `require` calls'
97-
run: |
98-
find . -name "*.js" -exec sed -E -i "s/require\( ?\"@stdlib\/error-tools-fmtprodmsg\" ?\);/require\( '@stdlib\/error-tools-fmtprodmsg' \);/g" {} \;
99-
10085
# Change `@stdlib/string-format` to `@stdlib/error-tools-fmtprodmsg` in package.json if the former is a dependency, otherwise insert it as a dependency:
10186
- name: 'Update dependencies in package.json'
10287
run: |

dist/index.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/// <reference path="../docs/types/index.d.ts" />
2+
import someByRight from '../docs/types/index';
3+
export = someByRight;

dist/index.js

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

dist/index.js.map

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

docs/types/index.d.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
/// <reference types="@stdlib/types"/>
2222

23-
import { Collection } from '@stdlib/types/object';
23+
import { Collection } from '@stdlib/types/array';
2424

2525
/**
2626
* Checks whether an element in a collection passes a test.
@@ -35,7 +35,7 @@ type Nullary = () => boolean;
3535
* @param value - collection value
3636
* @returns boolean indicating whether an element in a collection passes a test
3737
*/
38-
type Unary = ( value: any ) => boolean;
38+
type Unary<T> = ( value: T ) => boolean;
3939

4040
/**
4141
* Checks whether an element in a collection passes a test.
@@ -44,7 +44,7 @@ type Unary = ( value: any ) => boolean;
4444
* @param index - collection index
4545
* @returns boolean indicating whether an element in a collection passes a test
4646
*/
47-
type Binary = ( value: any, index: number ) => boolean;
47+
type Binary<T> = ( value: T, index: number ) => boolean;
4848

4949
/**
5050
* Checks whether an element in a collection passes a test.
@@ -54,7 +54,7 @@ type Binary = ( value: any, index: number ) => boolean;
5454
* @param collection - input collection
5555
* @returns boolean indicating whether an element in a collection passes a test
5656
*/
57-
type Ternary = ( value: any, index: number, collection: Collection ) => boolean;
57+
type Ternary<T> = ( value: T, index: number, collection: Collection<T> ) => boolean;
5858

5959
/**
6060
* Checks whether an element in a collection passes a test.
@@ -64,7 +64,7 @@ type Ternary = ( value: any, index: number, collection: Collection ) => boolean;
6464
* @param collection - input collection
6565
* @returns boolean indicating whether an element in a collection passes a test
6666
*/
67-
type Predicate = Nullary | Unary | Binary | Ternary;
67+
type Predicate<T> = Nullary | Unary<T> | Binary<T> | Ternary<T>;
6868

6969
/**
7070
* Tests whether a collection contains at least `n` elements which pass a test implemented by a predicate function, iterating from right to left.
@@ -98,7 +98,7 @@ type Predicate = Nullary | Unary | Binary | Ternary;
9898
* var bool = someByRight( arr, 2, isNegative );
9999
* // returns true
100100
*/
101-
declare function someByRight( collection: Collection, n: number, predicate: Predicate, thisArg?: any ): boolean; // tslint-disable-line max-line-length
101+
declare function someByRight<T = unknown>( collection: Collection<T>, n: number, predicate: Predicate<T>, thisArg?: ThisParameterType<Predicate<T>> ): boolean;
102102

103103

104104
// EXPORTS //

0 commit comments

Comments
 (0)
0