Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/stdlib-js/stdlib into de…
Browse files Browse the repository at this point in the history
…velop
  • Loading branch information
kgryte committed Jul 19, 2023
2 parents dd850de + d2c1aee commit 3fbd1f9
Show file tree
Hide file tree
Showing 10 changed files with 113 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/first_time_greeting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ jobs:
with:
repo-token: ${{ secrets.CHATBOT_GITHUB_TOKEN }}
issue-message: |
:tada: Welcome! :tada:
:wave: Hi there! :wave:
And thank you for opening your first issue! We will get back to you shortly. :runner: :dash:
pr-message: |
:tada: Welcome! :tada:
:wave: Hi there! :wave:
And thank you for opening your first pull request! We will review it shortly. :runner: :dash:
1 change: 1 addition & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Athan Reines <[email protected]>
Brendan Graetz <[email protected]>
Bruno Fenzl <[email protected]>
Christopher Dambamuromo <[email protected]>
Dan Rose <[email protected]>
Dominik Moritz <[email protected]>
Dorrin Sotoudeh <[email protected]>
Frank Kovacs <[email protected]>
Expand Down
76 changes: 76 additions & 0 deletions lib/node_modules/@stdlib/ndarray/dispatch-by/test/fixtures/fill.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
/**
* @license Apache-2.0
*
* Copyright (c) 2023 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

'use strict';

// MODULES //

var ind2sub = require( '@stdlib/ndarray/ind2sub' );
var numel = require( '@stdlib/ndarray/base/numel' );


// MAIN //

/**
* Return an ndarray function which fills one or more ndarrays.
*
* @private
* @param {*} value - fill value
* @returns {Function} ndarray function
*/
function fill( value ) {
return ndarrayFcn;

/**
* ndarray function.
*
* @private
* @param {Array<ndarrayLike>} arrays - ndarrays
*/
function ndarrayFcn( arrays ) {
var opts;
var sub;
var arr;
var sh;
var M;
var N;
var i;
var j;

sh = arrays[ 0 ].shape;
N = numel( sh );
M = arrays.length;
opts = {
'order': ''
};
for ( j = 0; j < M; j++ ) {
arr = arrays[ j ];
opts.order = arrays[ j ].order;
for ( i = 0; i < N; i++ ) {
sub = ind2sub( sh, i, opts );
sub.push( value );
arr.set.apply( arr, sub );
}
}
}
}


// EXPORTS //

module.exports = fill;
4 changes: 2 additions & 2 deletions lib/node_modules/@stdlib/string/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ The namespace exposes the following string manipulation functions:
- <span class="signature">[`constantcase( str )`][@stdlib/string/constantcase]</span><span class="delimiter">: </span><span class="description">convert a string to constant case.</span>
- <span class="signature">[`dotcase( str )`][@stdlib/string/dotcase]</span><span class="delimiter">: </span><span class="description">convert a string to dot case.</span>
- <span class="signature">[`endsWith( str, search[, len] )`][@stdlib/string/ends-with]</span><span class="delimiter">: </span><span class="description">test if a string ends with the characters of another string.</span>
- <span class="signature">[`first( str[, n] )`][@stdlib/string/first]</span><span class="delimiter">: </span><span class="description">return the first visual character(s) of a string.</span>
- <span class="signature">[`forEach( str, clbk[, thisArg ] )`][@stdlib/string/for-each]</span><span class="delimiter">: </span><span class="description">invokes a callback once for each (visual) character of a string.</span>
- <span class="signature">[`first( str[, n][, options] )`][@stdlib/string/first]</span><span class="delimiter">: </span><span class="description">return the first character(s) of a string.</span>
- <span class="signature">[`forEach( str, [options,] clbk[, thisArg ] )`][@stdlib/string/for-each]</span><span class="delimiter">: </span><span class="description">invokes a function for each character in a string.</span>
- <span class="signature">[`format( str, ...args )`][@stdlib/string/format]</span><span class="delimiter">: </span><span class="description">insert supplied variable values into a format string.</span>
- <span class="signature">[`fromCodePoint( pt1[, pt2[, pt3[, ...]]] )`][@stdlib/string/from-code-point]</span><span class="delimiter">: </span><span class="description">create a string from a sequence of Unicode code points.</span>
- <span class="signature">[`kebabcase( str )`][@stdlib/string/kebabcase]</span><span class="delimiter">: </span><span class="description">convert a string to kebab case.</span>
Expand Down
21 changes: 21 additions & 0 deletions lib/node_modules/@stdlib/string/base/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,15 @@ The namespace contains the following functions:
- <span class="signature">[`capitalize( str )`][@stdlib/string/base/capitalize]</span><span class="delimiter">: </span><span class="description">capitalize the first character in a string.</span>
- <span class="signature">[`codePointAt( string, position, backward )`][@stdlib/string/base/code-point-at]</span><span class="delimiter">: </span><span class="description">return a Unicode code point from a string at a specified position.</span>
- <span class="signature">[`constantcase( str )`][@stdlib/string/base/constantcase]</span><span class="delimiter">: </span><span class="description">convert a string to constant case.</span>
- <span class="signature">[`distances`][@stdlib/string/base/distances]</span><span class="delimiter">: </span><span class="description">implementations of various string similarity metrics.</span>
- <span class="signature">[`dotcase( str )`][@stdlib/string/base/dotcase]</span><span class="delimiter">: </span><span class="description">convert a string to dot case.</span>
- <span class="signature">[`endsWith( str, search, len )`][@stdlib/string/base/ends-with]</span><span class="delimiter">: </span><span class="description">test if a string ends with the characters of another string.</span>
- <span class="signature">[`firstCodePoint( str, n )`][@stdlib/string/base/first-code-point]</span><span class="delimiter">: </span><span class="description">return the first `n` Unicode code points of a string.</span>
- <span class="signature">[`firstGraphemeCluster( str, n )`][@stdlib/string/base/first-grapheme-cluster]</span><span class="delimiter">: </span><span class="description">return the first `n` grapheme clusters (i.e., user-perceived characters) of a string.</span>
- <span class="signature">[`first( str, n )`][@stdlib/string/base/first]</span><span class="delimiter">: </span><span class="description">return the first `n` UTF-16 code units of a string.</span>
- <span class="signature">[`forEachCodePoint( str, clbk[, thisArg ] )`][@stdlib/string/base/for-each-code-point]</span><span class="delimiter">: </span><span class="description">invokes a function for each Unicode code point in a string.</span>
- <span class="signature">[`forEachGraphemeCluster( str, clbk[, thisArg ] )`][@stdlib/string/base/for-each-grapheme-cluster]</span><span class="delimiter">: </span><span class="description">invokes a function for each grapheme cluster (i.e., user-perceived character) in a string.</span>
- <span class="signature">[`forEach( str, clbk[, thisArg ] )`][@stdlib/string/base/for-each]</span><span class="delimiter">: </span><span class="description">invokes a function for each UTF-16 code unit in a string.</span>
- <span class="signature">[`formatInterpolate( tokens, ...args )`][@stdlib/string/base/format-interpolate]</span><span class="delimiter">: </span><span class="description">generate string from a token array by interpolating values.</span>
- <span class="signature">[`formatTokenize( str )`][@stdlib/string/base/format-tokenize]</span><span class="delimiter">: </span><span class="description">tokenize a string into an array of string parts and format identifier objects.</span>
- <span class="signature">[`headercase( str )`][@stdlib/string/base/headercase]</span><span class="delimiter">: </span><span class="description">convert a string to Header case.</span>
Expand Down Expand Up @@ -154,10 +161,24 @@ str = ns.trim( str );

[@stdlib/string/base/constantcase]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/string/base/constantcase

[@stdlib/string/base/distances]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/string/base/distances

[@stdlib/string/base/dotcase]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/string/base/dotcase

[@stdlib/string/base/ends-with]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/string/base/ends-with

[@stdlib/string/base/first-code-point]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/string/base/first-code-point

[@stdlib/string/base/first-grapheme-cluster]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/string/base/first-grapheme-cluster

[@stdlib/string/base/first]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/string/base/first

[@stdlib/string/base/for-each-code-point]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/string/base/for-each-code-point

[@stdlib/string/base/for-each-grapheme-cluster]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/string/base/for-each-grapheme-cluster

[@stdlib/string/base/for-each]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/string/base/for-each

[@stdlib/string/base/format-interpolate]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/string/base/format-interpolate

[@stdlib/string/base/format-tokenize]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/string/base/format-tokenize
Expand Down
5 changes: 3 additions & 2 deletions lib/node_modules/@stdlib/utils/omit/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* limitations under the License.
*/

// TypeScript Version: 2.0
// TypeScript Version: 4.1

/**
* Returns a partial object copy excluding specified keys.
Expand All @@ -40,7 +40,8 @@
* var obj2 = omit( obj1, 'b' );
* // returns { 'a': 1 }
*/
declare function omit( obj: any, keys: string | Array<string> ): Object;
declare function omit<T extends object, K extends keyof T>( obj: T, keys: Array<K> | K ): Omit<T, K>; // tslint-disable-line max-line-length
declare function omit<T extends object>( obj: T, keys: Array<string> | string ): Partial<T>; // tslint-disable-line max-line-length


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

// The function returns an object...
{
omit( { 'a': 1, 'b': 2 }, 'a' ); // $ExpectType Object
omit( { 'a': 1, 'b': 2 }, [ 'a', 'b' ] ); // $ExpectType Object
omit( { 'a': 1, 'b': 2 }, 'a' ); // $ExpectType Omit<{ a: number; b: number; }, "a">
omit( { 'a': 1, 'b': 2 }, [ 'a', 'b' ] ); // $ExpectType Omit<{ a: number; b: number; }, "a" | "b">
}

// The compiler throws an error if the function is provided a second argument which is not a string or string array...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ type ErrorHandler<T> = Nullary<T> | Unary<T>;
* var z = trythen( x, y );
* // returns <number>
*/
declare function trythen<T>( x: () => T, y: ErrorHandler<T> ): T;
declare function trythen<T, U>( x: () => T, y: ErrorHandler<U> ): T | U;


// EXPORTS //
Expand Down
4 changes: 2 additions & 2 deletions lib/node_modules/@stdlib/utils/values/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* limitations under the License.
*/

// TypeScript Version: 2.0
// TypeScript Version: 4.1

/**
* Returns an array of an object's own enumerable property values.
Expand All @@ -37,7 +37,7 @@
* var vals = objectValues( obj );
* // e.g., returns [ 'boop', 'bar' ]
*/
declare function objectValues( obj: any ): Array<any>;
declare function objectValues<T extends object>( obj: T ): Array<T[keyof T]>;


// EXPORTS //
Expand Down
4 changes: 3 additions & 1 deletion lib/node_modules/@stdlib/utils/values/docs/types/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ import objectValues = require( './index' );

// The function returns an array of values...
{
objectValues( { 'beep': 'boop', 'foo': 3.14 } ); // $ExpectType Array<any>
objectValues( { 'beep': 'boop', 'foo': 'bar' } ); // $ExpectType string[]
objectValues( { 'beep': 'boop', 'foo': 3.14 } ); // $ExpectType (string | number)[]
objectValues( { 'beep': 'boop', 'foo': true } ); // $ExpectType (string | boolean)[]
}

// The compiler throws an error if the function is provided an incorrect number of arguments...
Expand Down

0 comments on commit 3fbd1f9

Please sign in to comment.