Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

typescript-tuple

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

typescript-tuple - npm Package Compare versions

Comparing version 3.0.0-rc.0 to 3.1.0-rc.0

pnpm-lock.yaml

5

lib/index.d.ts

@@ -168,1 +168,6 @@ import * as utils from './utils';

export declare type LongestTuple<TupleSet extends [any[], ...any[][]]> = utils.LongestTuple<TupleSet>;
/**
* Filter tuple elements thats match the mask
* @example FilterTuple<[1, 2, true, '3'], string | number> → [1, 2, "3"]
*/
export declare type FilterTuple<TupleSet extends any[], Mask> = utils.FilterTuple<TupleSet, Mask>;

3

lib/utils.d.ts

@@ -125,1 +125,4 @@ import { Extends, Equal } from 'typescript-compare';

}[TupleSet extends [] ? 'empty' : 'nonEmpty'];
export declare type FilterTuple<Tuple extends any[], Mask> = ConcatMultiple<{
[K in keyof Tuple]: Tuple[K] extends Mask ? [Tuple[K]] : [];
}>;

4

package.json
{
"name": "typescript-tuple",
"version": "3.0.0-rc.0",
"version": "3.1.0-rc.0",
"description": "Generics to work with tuples in TypeScript",

@@ -35,3 +35,3 @@ "main": "index.js",

"devDependencies": {
"typescript": "^3.1.1",
"typescript": "~3.1.1",
"tslint": "^5.11.0",

@@ -38,0 +38,0 @@ "tslint-config-standard": "^8.0.1",

@@ -349,4 +349,16 @@ # TypeScript Tuple

### `FilterTuple`
```typescript
import { FilterTuple } from 'typescript-tuple'
type Foo = FilterTuple<[1, '1'], number> // Expect: [1]
const foo: Foo = [1]
type Bar = FilterTuple<[1, '1', null, true], 1 | '1' | true> // Expect: [1, '1', true]
const bar: Bar = [1, '1', true]
```
## License
[MIT](https://git.io/fA2d9) @ [Hoàng Văn Khải](https://github.com/KSXGitHub)
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc