open-index/open-npm huggingface dataset:
npm package: @ollopa/trust
Description: Rust idioms in Typescript
Author: Kieran Gill
Latest version: 0.0.1

# trust

Utility library to add Rust idioms into 

### installing

```
npm install @ollopa/trust
```

```
yarn add @ollopa/trust
```

Add `"experimentalDecorators": true,` to your `tsconfig.json` file.


## Docs

The purpose of this library is to give Typescript ergonomic Rust idioms. 

Please open a RFC issue if an API can be improved in any way.

### match

Very open for suggestions on a better API for this.

WIP. Needs `range`, `default`, etc.

```typescript
const token: { type: 'semi' | 'identifier' | 'unknown', value: string } = getToken()

const result = match(token.type,
  // match arms
  ['semi', handleSemi(token)],
  ['identifier', handleIdentifier(token)],
  ['unknown', handleUnknown(token)],
)


```

`match` returns an `Option` because of limitations with typing. For example...

```typescript
match('some string',
  ['yeet', 'yoot']
)
```

...will never match to anything and therefore will return an `Option.None`.

### Var

Utility type to create a sum type.

```typescript
type ASTNode = 
  Var<'int' | 'string' | 'infix', { token: string }> // the `token` data is common across all nodes
  & ( // Enum variants
    Var<'int', { value: number }> | 
    Var<'string', { value: string }> |
    Var<'infix', { operator: '+' | '-', left: ASTNode, right: ASTNode }> 
  )
```
npm package: @ollyfg/react-scripts
Description: Configuration and scripts for Create React App.
Latest version: 4.0.7

# react-scripts

This package includes scripts and configuration used by [Create React App](https://github.com/facebook/create-react-app).<br>
Please refer to its documentation:

- [Getting Started](https://facebook.github.io/create-react-app/docs/getting-started) – How to create a new app.
- [User Guide](https://facebook.github.io/create-react-app/) – How to develop apps bootstrapped with Create React App.