Skip to content

Commit

Permalink
Auto-generated commit
Browse files Browse the repository at this point in the history
  • Loading branch information
stdlib-bot committed May 13, 2023
1 parent 65ea0df commit 39875d4
Show file tree
Hide file tree
Showing 16 changed files with 42 additions and 28 deletions.
16 changes: 11 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ jobs:
exit 0
fi
rm -rf ./bin/cli
rm test/test.cli.js
rm etc/cli_opts.json
rm docs/usage.txt
rm -f test/test.cli.js
rm -f etc/cli_opts.json
rm -f docs/usage.txt
# For all dependencies, check in all *.js files if they are still used; if not, remove them:
jq -r '.dependencies | keys[]' ./package.json | while read -r dep; do
Expand Down Expand Up @@ -149,6 +149,12 @@ jobs:
# Add link definition for CLI package to README.md:
find . -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/<section class=\"links\">/<section class=\"links\">\n\n[$escapedPkg]: https:\/\/www.npmjs.com\/package\/$escapedPkg/"
# Replace GitHub MathJax equations with SVGs:
- name: 'Replace GitHub MathJax equations with SVGs'
run: |
find . -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe 's/```math\n([\s\S]+?)\n```\n\n//g'
find . -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe 's/<!-- <div class="equation"(.*)(<\/div>\s*-->)/<div class="equation"$1<\/div>/sg'
# Replace GitHub links to individual packages with npm links:
- name: 'Replace all GitHub links to individual packages with npm links'
run: |
Expand All @@ -162,8 +168,8 @@ jobs:
# Remove unnecessary files:
- name: 'Remove unnecessary files'
run: |
rm docs/repl.txt
rm docs/types/test.ts
rm -f docs/repl.txt
rm -f docs/types/test.ts
# Replace all stdlib GitHub dependencies with the respective npm packages:
- name: 'Replace all stdlib GitHub dependencies with the respective npm packages'
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -182,3 +182,7 @@ jsconfig.json
################
*.sublime-workspace
*.sublime-project

# Other editor files #
######################
.idea/
4 changes: 4 additions & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ Bruno Fenzl <[email protected]>
Christopher Dambamuromo <[email protected]>
Dominik Moritz <[email protected]>
Frank Kovacs <[email protected]>
Harshita Kalani <[email protected]>
James <[email protected]>
Jithin KS <[email protected]>
Joey Reed <[email protected]>
Jordan-Gallivan <[email protected]>
Joris Labie <[email protected]>
Justin Dennison <[email protected]>
Marcus <[email protected]>
Expand All @@ -26,5 +28,7 @@ Ryan Seal <[email protected]>
Seyyed Parsa Neshaei <[email protected]>
Shraddheya Shendre <[email protected]>
Stephannie Jiménez Gacha <[email protected]>
Yernar Yergaziyev <[email protected]>
dorrin-sot <[email protected]>
orimiles5 <[email protected]>
rei2hu <[email protected]>
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ Copyright &copy; 2016-2023. The Stdlib [Authors][stdlib-authors].
-->

[chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg
[chat-url]: https://gitter.im/stdlib-js/stdlib/
[chat-url]: https://app.gitter.im/#/room/#stdlib-js_stdlib:gitter.im

[stdlib]: https://github.com/stdlib-js/stdlib

Expand Down
2 changes: 1 addition & 1 deletion constant-function/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
* v = fcn();
* // returns 3.14
*/
declare function constantFunction( value?: any ): Function;
declare function constantFunction<T = undefined>( value?: T ): () => T;


// EXPORTS //
Expand Down
4 changes: 2 additions & 2 deletions constant-function/docs/types/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import constantFunction = require( './index' );

// The function returns a function...
{
constantFunction(); // $ExpectType Function
constantFunction( 3.12 ); // $ExpectType Function
constantFunction(); // $ExpectType () => undefined
constantFunction( 3.12 ); // $ExpectType () => number
}

// The compiler throws an error if the function is provided more than one argument...
Expand Down
2 changes: 1 addition & 1 deletion identity-function/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* var v = identity( 3.14 );
* // returns 3.14
*/
declare function identity( x: any ): any;
declare function identity<T>( x: T ): T;


// EXPORTS //
Expand Down
6 changes: 3 additions & 3 deletions identity-function/docs/types/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ import identity = require( './index' );

// The function returns the supplied value...
{
identity( 3.12 ); // $ExpectType any
identity( true ); // $ExpectType any
identity( [] ); // $ExpectType any
identity( 3.12 ); // $ExpectType 3.12
identity( true ); // $ExpectType true
identity( [] ); // $ExpectType never[]
}

// The compiler throws an error if the function is provided an incorrect number of arguments...
Expand Down
2 changes: 1 addition & 1 deletion if-else/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* var z = ifelse( randu() > 0.5, 1.0, -1.0 );
* // returns <number>
*/
declare function ifelse( bool: boolean, x: any, y: any ): any;
declare function ifelse<T, U>( bool: boolean, x: T, y: U ): T | U;


// EXPORTS //
Expand Down
8 changes: 4 additions & 4 deletions if-else/docs/types/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ import ifelse = require( './index' );

// The function returns either the `x` or `y` value...
{
ifelse( true, 0, 1 ); // $ExpectType any
ifelse( true, 'a', 'b' ); // $ExpectType any
ifelse( false, 0, 1 ); // $ExpectType any
ifelse( false, 'a', 'b' ); // $ExpectType any
ifelse( true, 0, 1 ); // $ExpectType 0 | 1
ifelse( true, 'a', 'b' ); // $ExpectType "a" | "b"
ifelse( false, 0, 1 ); // $ExpectType 0 | 1
ifelse( false, 'a', 'b' ); // $ExpectType "a" | "b"
}

// The compiler throws an error if the function is not provided a boolean as its first argument...
Expand Down
2 changes: 1 addition & 1 deletion if-then/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
* var z = ifthen( randu() > 0.5, x, y );
* // returns <number>
*/
declare function ifthen( bool: boolean, x: Function, y: Function ): any;
declare function ifthen<T, U>( bool: boolean, x: () => T, y: () => U ): T | U;


// EXPORTS //
Expand Down
4 changes: 2 additions & 2 deletions if-then/docs/types/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ function zero(): number {

// The function returns the return value of either the `x` or `y` function...
{
ifthen( true, zero, one ); // $ExpectType any
ifthen( false, zero, one ); // $ExpectType any
ifthen( true, zero, one ); // $ExpectType number
ifthen( false, zero, one ); // $ExpectType number
}

// The compiler throws an error if the function is not provided a function as its first argument...
Expand Down
2 changes: 1 addition & 1 deletion try-catch/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
* var z = trycatch( x, -1.0 );
* // returns <number>
*/
declare function trycatch( x: Function, y: any ): any;
declare function trycatch<T, U>( x: () => T, y: U ): T | U;


// EXPORTS //
Expand Down
2 changes: 1 addition & 1 deletion try-catch/docs/types/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function x(): number {

// The function returns a value...
{
trycatch( x, -1 ); // $ExpectType any
trycatch( x, -1 ); // $ExpectType number
}

// The compiler throws an error if the function is provided a first argument other than a function...
Expand Down
8 changes: 4 additions & 4 deletions try-then/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,23 @@
*
* @returns return value of `trythen` function
*/
type Nullary = () => any;
type Nullary<T> = () => T;

/**
* Function invoked if initial function throws an error.
*
* @param err - the error thrown by `x`
* @returns return value of `trythen` function
*/
type Unary = ( err: Error ) => any;
type Unary<T> = ( err: Error ) => T;

/**
* Function invoked if initial function throws an error.
*
* @param err - the error thrown by `x`
* @returns return value of `trythen` function
*/
type ErrorHandler = Nullary | Unary;
type ErrorHandler<T> = Nullary<T> | Unary<T>;


/**
Expand Down Expand Up @@ -72,7 +72,7 @@ type ErrorHandler = Nullary | Unary;
* var z = trythen( x, y );
* // returns <number>
*/
declare function trythen( x: Function, y: ErrorHandler ): any;
declare function trythen<T>( x: () => T, y: ErrorHandler<T> ): T;


// EXPORTS //
Expand Down
2 changes: 1 addition & 1 deletion try-then/docs/types/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function y(): number {

// The function returns a value...
{
trythen( x, y ); // $ExpectType any
trythen( x, y ); // $ExpectType number
}

// The compiler throws an error if the function is provided a first argument other than a function...
Expand Down

0 comments on commit 39875d4

Please sign in to comment.