8000 Release v0.1.0 · stdlib-js/utils-count-by@9e15a5c · GitHub
[go: up one dir, main page]

Skip to content

Commit 9e15a5c

Browse files
committed
Release v0.1.0
1 parent d38a5ca commit 9e15a5c

File tree

5 files changed

+68
-22
lines changed

5 files changed

+68
-22
lines changed

.editorconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,3 +179,8 @@ indent_size = 2
179179
[*.gypi]
180180
indent_style = space
181181
indent_size = 2
182+
183+
# Set properties for citation files:
184+
[*.{cff,cff.txt}]
185+
indent_style = space
186+
indent_size = 2

CITATION.cff

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
cff-version: 1.2.0
2+
title: stdlib
3+
message: >-
4+
If you use this software, please cite it using the
5+
metadata from this file.
6+
7+
type: software
8+
9+
authors:
10+
- name: The Stdlib Authors
11+
url: https://github.com/stdlib-js/stdlib/graphs/contributors
12+
13+
repository-code: https://github.com/stdlib-js/stdlib
14+
url: https://stdlib.io
15+
16+
abstract: |
17+
Standard library for JavaScript and Node.js.
18+
19+
keywords:
20+
- JavaScript
21+
- Node.js
22+
- TypeScript
23+
- standard library
24+
- scientific computing
25+
- numerical computing
26+
- statistical computing
27+
28+
license: Apache-2.0 AND BSL-1.0
29+
30+
date-released: 2016

README.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,17 @@ limitations under the License.
1818
1919
-->
2020

21+
22+
<details>
23+
<summary>
24+
About stdlib...
25+
</summary>
26+
<p>We believe in a future in which the web is a preferred environment for numerical computation. To help realize this future, we've built stdlib. stdlib is a standard library, with an emphasis on numerical and scientific computation, written in JavaScript (and C) for execution in browsers and in Node.js.</p>
27+
<p>The library is fully decomposable, being architected in such a way that you can swap out and mix and match APIs and functionality to cater to your exact preferences and use cases.</p>
28+
<p>When you use stdlib, you can be absolutely certain that you are using the most thorough, rigorous, well-written, studied, documented, tested, measured, and high-quality code out there.</p>
29+
<p>To join us in bringing numerical computing to the web, get started by checking us out on <a href="https://github.com/stdlib-js/stdlib">GitHub</a>, and please consider <a href="https://opencollective.com/stdlib">financially supporting stdlib</a>. We greatly appreciate your continued support!</p>
30+
</details>
31+
2132
# countBy
2233

2334
[![NPM version][npm-image]][npm-url] [![Build Status][test-image]][test-url] [![Coverage Status][coverage-image]][coverage-url] <!-- [![dependencies][dependencies-image]][dependencies-url] -->
@@ -250,8 +261,8 @@ Copyright &copy; 2016-2023. The Stdlib [Authors][stdlib-authors].
250261
[npm-image]: http://img.shields.io/npm/v/@stdlib/utils-count-by.svg
251262
[npm-url]: https://npmjs.org/package/@stdlib/utils-count-by
252263

253-
[test-image]: https://github.com/stdlib-js/utils-count-by/actions/workflows/test.yml/badge.svg?branch=main
254-
[test-url]: https://github.com/stdlib-js/utils-count-by/actions/workflows/test.yml?query=branch:main
264+
[test-image]: https://github.com/stdlib-js/utils-count-by/actions/workflows/test.yml/badge.svg?branch=v0.1.0
265+
[test-url]: https://github.com/stdlib-js/utils-count-by/actions/workflows/test.yml?query=branch:v0.1.0
255266

256267
[coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/utils-count-by/main.svg
257268
[coverage-url]: https://codecov.io/github/stdlib-js/utils-count-by?branch=main

docs/types/index.d.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* limitations under the License.
1717
*/
1818

19-
// TypeScript Version: 2.0
19+
// TypeScript Version: 4.1
2020

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

@@ -25,27 +25,27 @@ import { Collection } from '@stdlib/types/array';
2525
/**
2626
* Interface defining function options.
2727
*/
28-
interface Options<T> {
28+
interface Options<T, U> {
2929
/**
3030
* Execution context.
3131
*/
32-
thisArg?: ThisParameterType<Indicator<T>>;
32+
thisArg?: ThisParameterType<Indicator<T, U>>;
3333
}
3434

3535
/**
3636
* Specifies which group an element in the input collection belongs to.
3737
*
3838
* @returns object key
3939
*/
40-
type Nullary = () => string | symbol | number;
40+
type Nullary<U> = ( this: U ) => string | symbol | number;
4141

4242
/**
4343
* Specifies which group an element in the input collection belongs to.
4444
*
4545
* @param value - collection value
4646
* @returns object key
4747
*/
48-
type Unary<T> = ( value: T ) => string | symbol | number;
48+
type Unary<T, U> = ( this: U, value: T ) => string | symbol | number;
4949

5050
/**
5151
* Specifies which group an element in the input collection belongs to.
@@ -54,7 +54,7 @@ type Unary<T> = ( value: T ) => string | symbol | number;
5454
* @param index - collection index
5555
* @returns object key
5656
*/
57-
type Binary<T> = ( value: T, index: number ) => string | symbol | number;
57+
type Binary<T, U> = ( this: U, value: T, index: number ) => string | symbol | number;
5858

5959
/**
6060
* Specifies which group an element in the input collection belongs to.
@@ -63,7 +63,7 @@ type Binary<T> = ( value: T, index: number ) => string | symbol | number;
6363
* @param index - collection index
6464
* @returns object key
6565
*/
66-
type Indicator<T> = Nullary | Unary<T> | Binary<T>;
66+
type Indicator<T, U> = Nullary<U> | Unary<T, U> | Binary<T, U>;
6767

6868
/**
6969
* Interface describing returned results.
@@ -102,7 +102,7 @@ interface Results<T> {
102102
* var out = countBy( arr, indicator );
103103
* // returns { 'b': 3, 'f': 1 }
104104
*/
105-
declare function countBy<T = unknown>( collection: Collection<T>, indicator: Indicator<T> ): Results<T>;
105+
declare function countBy<T = unknown, U = unknown>( collection: Collection<T>, indicator: Indicator<T, U> ): Results<T>; // tslint:disable-line:no-unnecessary-generics
106106

107107
/**
108108
* Groups values according to an indicator function and returns group counts.
@@ -133,7 +133,7 @@ declare function countBy<T = unknown>( collection: Collection<T>, indicator: Ind
133133
* var out = countBy( arr, indicator );
134134
* // returns { 'b': 3, 'f': 1 }
135135
*/
136-
declare function countBy<T = unknown>( collection: Collection<T>, options: Options<T>, indicator: Indicator<T> ): Results<T>;
136+
declare function countBy<T = unknown, U = unknown>( collection: Collection<T>, options: Options<T, U>, indicator: Indicator<T, U> ): Results<T>;
137137

138138

139139
// EXPORTS //

package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@stdlib/utils-count-by",
3-
"version": "0.0.8",
3+
"version": "0.1.0",
44
"description": "Group values according to an indicator function and return group counts.",
55
"license": "Apache-2.0",
66
"author": {
@@ -37,19 +37,19 @@
3737
"url": "https://github.com/stdlib-js/stdlib/issues"
3838
},
3939
"dependencies": {
40-
"@stdlib/assert-has-own-property": "^0.0.7",
41-
"@stdlib/assert-is-collection": "^0.0.8",
42-
"@stdlib/assert-is-function": "^0.0.8",
43-
"@stdlib/assert-is-plain-object": "^0.0.7",
44-
"@stdlib/string-format": "^0.0.3",
45-
"@stdlib/types": "^0.0.14"
40+
"@stdlib/assert-has-own-property": "^0.1.0",
41+
"@stdlib/assert-is-collection": "^0.1.0",
42+
"@stdlib/assert-is-function": "^0.1.0",
43+
"@stdlib/assert-is-plain-object": "^0.1.0",
44+
"@stdlib/string-format": "^0.1.0",
45+
"@stdlib/types": "^0.1.0"
4646
},
4747
"devDependencies": {
48-
"@stdlib/array-float64": "^0.0.6",
49-
"@stdlib/bench": "^0.0.12",
50-
"@stdlib/math-base-special-floor": "^0.0.8",
48+
"@stdlib/array-float64": "^0.1.0",
49+
"@stdlib/bench": "^0.1.0",
50+
"@stdlib/math-base-special-floor": "^0.1.0",
5151
"@stdlib/random-base-randu": "^0.0.8",
52-
"@stdlib/utils-noop": "^0.0.14",
52+
"@stdlib/utils-noop": "^0.1.0",
5353
"tape": "git+https://github.com/kgryte/tape.git#fix/globby",
5454
"istanbul": "^0.4.1",
5555
"tap-min": "git+https://github.com/Planeshifter/tap-min.git"

0 commit comments

Comments
 (0)
0