From 39875d4edce73423e1fc15b5000933cc559d3ae1 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sat, 13 May 2023 18:27:25 +0000 Subject: [PATCH] Auto-generated commit --- .github/workflows/publish.yml | 16 +++++++++++----- .gitignore | 4 ++++ CONTRIBUTORS | 4 ++++ README.md | 2 +- constant-function/docs/types/index.d.ts | 2 +- constant-function/docs/types/test.ts | 4 ++-- identity-function/docs/types/index.d.ts | 2 +- identity-function/docs/types/test.ts | 6 +++--- if-else/docs/types/index.d.ts | 2 +- if-else/docs/types/test.ts | 8 ++++---- if-then/docs/types/index.d.ts | 2 +- if-then/docs/types/test.ts | 4 ++-- try-catch/docs/types/index.d.ts | 2 +- try-catch/docs/types/test.ts | 2 +- try-then/docs/types/index.d.ts | 8 ++++---- try-then/docs/types/test.ts | 2 +- 16 files changed, 42 insertions(+), 28 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 6adf06a8..f56d473a 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -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 @@ -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/
/
\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/)/
/sg' + # Replace GitHub links to individual packages with npm links: - name: 'Replace all GitHub links to individual packages with npm links' run: | @@ -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' diff --git a/.gitignore b/.gitignore index 96412149..49b206b8 100644 --- a/.gitignore +++ b/.gitignore @@ -182,3 +182,7 @@ jsconfig.json ################ *.sublime-workspace *.sublime-project + +# Other editor files # +###################### +.idea/ diff --git a/CONTRIBUTORS b/CONTRIBUTORS index f97b6ef9..a9844390 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -9,9 +9,11 @@ Bruno Fenzl Christopher Dambamuromo Dominik Moritz Frank Kovacs +Harshita Kalani <95532771+HarshitaKalani@users.noreply.github.com> James Jithin KS Joey Reed +Jordan-Gallivan <115050475+Jordan-Gallivan@users.noreply.github.com> Joris Labie Justin Dennison Marcus @@ -26,5 +28,7 @@ Ryan Seal Seyyed Parsa Neshaei Shraddheya Shendre Stephannie JimĂ©nez Gacha +Yernar Yergaziyev dorrin-sot <59933477+dorrin-sot@users.noreply.github.com> +orimiles5 <97595296+orimiles5@users.noreply.github.com> rei2hu diff --git a/README.md b/README.md index 223de2ac..bd13756b 100644 --- a/README.md +++ b/README.md @@ -450,7 +450,7 @@ Copyright © 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 diff --git a/constant-function/docs/types/index.d.ts b/constant-function/docs/types/index.d.ts index 22fb2c33..04709397 100644 --- a/constant-function/docs/types/index.d.ts +++ b/constant-function/docs/types/index.d.ts @@ -40,7 +40,7 @@ * v = fcn(); * // returns 3.14 */ -declare function constantFunction( value?: any ): Function; +declare function constantFunction( value?: T ): () => T; // EXPORTS // diff --git a/constant-function/docs/types/test.ts b/constant-function/docs/types/test.ts index e001647d..c352cae3 100644 --- a/constant-function/docs/types/test.ts +++ b/constant-function/docs/types/test.ts @@ -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... diff --git a/identity-function/docs/types/index.d.ts b/identity-function/docs/types/index.d.ts index dae27056..b19c8f11 100644 --- a/identity-function/docs/types/index.d.ts +++ b/identity-function/docs/types/index.d.ts @@ -28,7 +28,7 @@ * var v = identity( 3.14 ); * // returns 3.14 */ -declare function identity( x: any ): any; +declare function identity( x: T ): T; // EXPORTS // diff --git a/identity-function/docs/types/test.ts b/identity-function/docs/types/test.ts index 404833e1..079de0e2 100644 --- a/identity-function/docs/types/test.ts +++ b/identity-function/docs/types/test.ts @@ -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... diff --git a/if-else/docs/types/index.d.ts b/if-else/docs/types/index.d.ts index 62855c2d..0bff9554 100644 --- a/if-else/docs/types/index.d.ts +++ b/if-else/docs/types/index.d.ts @@ -32,7 +32,7 @@ * var z = ifelse( randu() > 0.5, 1.0, -1.0 ); * // returns */ -declare function ifelse( bool: boolean, x: any, y: any ): any; +declare function ifelse( bool: boolean, x: T, y: U ): T | U; // EXPORTS // diff --git a/if-else/docs/types/test.ts b/if-else/docs/types/test.ts index c0512389..a6b812f5 100644 --- a/if-else/docs/types/test.ts +++ b/if-else/docs/types/test.ts @@ -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... diff --git a/if-then/docs/types/index.d.ts b/if-then/docs/types/index.d.ts index 7e7df4d0..f69793cc 100644 --- a/if-then/docs/types/index.d.ts +++ b/if-then/docs/types/index.d.ts @@ -40,7 +40,7 @@ * var z = ifthen( randu() > 0.5, x, y ); * // returns */ -declare function ifthen( bool: boolean, x: Function, y: Function ): any; +declare function ifthen( bool: boolean, x: () => T, y: () => U ): T | U; // EXPORTS // diff --git a/if-then/docs/types/test.ts b/if-then/docs/types/test.ts index 48243e4a..32045de8 100644 --- a/if-then/docs/types/test.ts +++ b/if-then/docs/types/test.ts @@ -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... diff --git a/try-catch/docs/types/index.d.ts b/try-catch/docs/types/index.d.ts index 2871d282..3350ceda 100644 --- a/try-catch/docs/types/index.d.ts +++ b/try-catch/docs/types/index.d.ts @@ -37,7 +37,7 @@ * var z = trycatch( x, -1.0 ); * // returns */ -declare function trycatch( x: Function, y: any ): any; +declare function trycatch( x: () => T, y: U ): T | U; // EXPORTS // diff --git a/try-catch/docs/types/test.ts b/try-catch/docs/types/test.ts index e08fd8bd..f0f90217 100644 --- a/try-catch/docs/types/test.ts +++ b/try-catch/docs/types/test.ts @@ -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... diff --git a/try-then/docs/types/index.d.ts b/try-then/docs/types/index.d.ts index 33fc8c6a..0d9e3a5d 100644 --- a/try-then/docs/types/index.d.ts +++ b/try-then/docs/types/index.d.ts @@ -23,7 +23,7 @@ * * @returns return value of `trythen` function */ -type Nullary = () => any; +type Nullary = () => T; /** * Function invoked if initial function throws an error. @@ -31,7 +31,7 @@ type Nullary = () => any; * @param err - the error thrown by `x` * @returns return value of `trythen` function */ -type Unary = ( err: Error ) => any; +type Unary = ( err: Error ) => T; /** * Function invoked if initial function throws an error. @@ -39,7 +39,7 @@ type Unary = ( err: Error ) => any; * @param err - the error thrown by `x` * @returns return value of `trythen` function */ -type ErrorHandler = Nullary | Unary; +type ErrorHandler = Nullary | Unary; /** @@ -72,7 +72,7 @@ type ErrorHandler = Nullary | Unary; * var z = trythen( x, y ); * // returns */ -declare function trythen( x: Function, y: ErrorHandler ): any; +declare function trythen( x: () => T, y: ErrorHandler ): T; // EXPORTS // diff --git a/try-then/docs/types/test.ts b/try-then/docs/types/test.ts index 1af86ecd..6634d7b7 100644 --- a/try-then/docs/types/test.ts +++ b/try-then/docs/types/test.ts @@ -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...