Skip to content

feat: migrate utils/thunk to function/thunk #5458

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ limitations under the License.
## Usage

```javascript
var thunk = require( '@stdlib/utils/thunk' );
var thunk = require( '@stdlib/function/thunk' );
```

#### thunk( fcn\[, ...args] )
Expand Down Expand Up @@ -83,7 +83,7 @@ v = f();
var add = require( '@stdlib/number/float64/base/add' );
var decorateAfter = require( '@stdlib/utils/decorate-after' );
var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory;
var thunk = require( '@stdlib/utils/thunk' );
var thunk = require( '@stdlib/function/thunk' );

function log( v ) {
console.log( v );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
/**
* Generate a thunk.
*
* @module @stdlib/utils/thunk
* @module @stdlib/function/thunk
*
* @example
* var add = require( '@stdlib/number/float64/base/add' );
* var thunk = require( '@stdlib/utils/thunk' );
* var thunk = require( '@stdlib/function/thunk' );
*
* var f = thunk( add, 2, 3 );
* // returns <Function>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@stdlib/utils/thunk",
"name": "@stdlib/function/thunk",
"version": "0.0.0",
"description": "Generate a thunk.",
"license": "Apache-2.0",
Expand Down
22 changes: 0 additions & 22 deletions lib/node_modules/@stdlib/utils/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ import someBy = require( '@stdlib/utils/some-by' );
import someByRight = require( '@stdlib/utils/some-by-right' );
import tabulate = require( '@stdlib/utils/tabulate' );
import tabulateBy = require( '@stdlib/utils/tabulate-by' );
import thunk = require( '@stdlib/utils/thunk' );
import timeit = require( '@stdlib/utils/timeit' );
import trycatch = require( '@stdlib/utils/try-catch' );
import tryFunction = require( '@stdlib/utils/try-function' );
Expand Down Expand Up @@ -5401,27 +5400,6 @@ interface Namespace {
*/
tabulateBy: typeof tabulateBy;

/**
* Returns a thunk.
*
* @param fcn - function to convert to a thunk
* @param args - function args
* @returns thunk
*
* @example
* var add = require( '@stdlib/number/float64/base/add' );
*
* var f = ns.thunk( add, 2, 3 );
* // returns <Function>
*
* // ...
*
* // Evaluate the ns.thunk:
* var v = f();
* // returns 5
*/
thunk: typeof thunk;

/**
* Times a snippet.
*
Expand Down
9 changes: 0 additions & 9 deletions lib/node_modules/@stdlib/utils/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* limitations under the License.
*/

'use strict';

Check warning on line 19 in lib/node_modules/@stdlib/utils/lib/index.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

`any-in-by` should be exported from namespace `index.js`

Check warning on line 19 in lib/node_modules/@stdlib/utils/lib/index.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

`any-own-by` should be exported from namespace `index.js`

Check warning on line 19 in lib/node_modules/@stdlib/utils/lib/index.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

`every-in-by` should be exported from namespace `index.js`

Check warning on line 19 in lib/node_modules/@stdlib/utils/lib/index.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

`every-own-by` should be exported from namespace `index.js`

Check warning on line 19 in lib/node_modules/@stdlib/utils/lib/index.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

`none-in-by` should be exported from namespace `index.js`

Check warning on line 19 in lib/node_modules/@stdlib/utils/lib/index.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

`none-own-by` should be exported from namespace `index.js`

Check warning on line 19 in lib/node_modules/@stdlib/utils/lib/index.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

`parse-ndjson` should be exported from namespace `index.js`

Check warning on line 19 in lib/node_modules/@stdlib/utils/lib/index.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

`some-in-by` should be exported from namespace `index.js`

Check warning on line 19 in lib/node_modules/@stdlib/utils/lib/index.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

`some-own-by` should be exported from namespace `index.js`

/*
* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.
Expand Down Expand Up @@ -1678,15 +1678,6 @@
*/
setReadOnly( utils, 'tabulateBy', require( '@stdlib/utils/tabulate-by' ) );

/**
* @name thunk
* @memberof utils
* @readonly
* @type {Function}
* @see {@link module:@stdlib/utils/thunk}
*/
setReadOnly( utils, 'thunk', require( '@stdlib/utils/thunk' ) );

/**
* @name timeit
* @memberof utils
Expand Down
Loading