open-index/open-npm huggingface dataset:
npm package: @smuxx/metro-react-native-babel-preset
Description: Babel preset for React Native applications
Author: smuxx
Latest version: 0.71.0

# metro-react-native-babel-preset

Babel presets for [React Native](https://reactnative.dev) applications. React Native itself uses this Babel preset by default when transforming your app's source code.

If you wish to use a custom Babel configuration by writing a `babel.config.js` file in your project's root directory, you must specify all the plugins necessary to transform your code. React Native does not apply its default Babel configuration in this case. So, to make your life easier, you can use this preset to get the default configuration and then specify more plugins that run before it.

## Usage

As mentioned above, you only need to use this preset if you are writing a custom `babel.config.js` file.

### Installation

Install `metro-react-native-babel-preset` in your app:

with `npm`:

```sh
npm i metro-react-native-babel-preset --save-dev
```

or with `yarn`:

```sh
yarn add -D metro-react-native-babel-preset
```

### Configuring Babel

Then, create a file called `babel.config.js` in your project's root directory. The existence of this `babel.config.js` file will tell React Native to use your custom Babel configuration instead of its own. Then load this preset:

```
{
  "presets": ["module:metro-react-native-babel-preset"]
}
```

You can further customize your Babel configuration by specifying plugins and other options. See [Babel's `babel.config.js` documentation](https://babeljs.io/docs/en/config-files/) to learn more.

## Help and Support

If you get stuck configuring Babel, please ask a question on Stack Overflow or find a consultant for help. If you discover a bug, please open up an issue.
npm package: @smuzi/std
Description: Standard library for JavaScript and TypeScript
Author: Denis Ratushniak
Latest version: 0.2.1

Source Code: [Github
](https://github.com/smuzi-ts/smuzi/tree/main/smuzi/std)
# @smuzi/std

A lightweight standard library for JavaScript and TypeScript.

Provides core functionality and utility methods for working with **Patterns Matching**, **Option**, **Result** , **Safe JSON**, **env**,  and many more.

---

## Installation

```bash
npm install @smuzi/std
```

---
> See more examples in the [tests folder](https://github.com/smuzi-ts/smuzi/tree/main/smuzi/std/tests).

## Patterns Matching
Pattern Matching has a very powerful mechanism for working with strings, numbers, regular expressions, functions, objects, arrays, and so on.
All of this is done using a single **match()** function.
```ts
let input = "users/3"
let patterns = new Map();

patterns.set("users", "users list");
patterns.set("users/archived", "list of archived users");
patterns.set(/^users\/\d+$/, "find"); //RegExp

let resultMatch = match(input, patterns, "not found")
```

## Result

```ts
type SomeErr = {msg: string};
function validation(input: number): Result<string, SomeErr> {
    return input > 100 ? Err({msg: "Too many characters"}) : Ok("Normal");
}
const res = validation(2).match({
    Ok: msg => msg,
    Err: err => err.msg,
});
```

## Option

```ts
function prepare(body: Option<string> = None()): string {
    return body.match({
        Some: bodyStr => bodyStr + "Some data",
        None: () => "Empty body"
    })
}

```

## Safe JSON parser

```ts
type User = StdRecord<{
    id: number,
    name: string,
    post: StdRecord<{title: string}>
}>;

type UserData = StdRecord<{
    data: StdList<User>,
}>

const inputString = `{"data": [{"id":1,"name": "333", "post":{"title":"Subject"}}, {"id":2,"name": "2222", "post":{"title":"Subject2"}}]}`;

const resultJSON = json.fromString<UserData>(inputString)
    .unwrap() //Possible JSON parse error
    .unwrap() //Possible empty JSON;

const data = resultJSON
    .get("data")
    .unwrap(); //Possible empty data

const first = data.get(0).unwrap() //Possible first element is empty
const firstId = first.get("id").unwrap();
const firstTitle= first.get("post")
    .unwrap() //Possible post is empty
    .get("title")
    .unwrap(); //Possible title is empty

assert.equal(firstId, 1);
assert.equal(firstTitle, "Subject");
```
npm package: @smv1999/datamorph
Description: A package that allows you to convert your data between different formats.
Author: Vaidhyanathan S M
Latest version: 1.0.2

## DataMorph

A package that allows you to convert your data between different formats.

### Supported Data Formats

- YAML
- JSON
- CSV
- INI

### Supported Data Format Conversions

The following conversions are supported in the current version of the package:

- YAML to JSON
- CSV to JSON
- JSON to CSV
- INI to JSON
- JSON to INI

### Usage

You can install the latest version of the package using the following command:

```
npm install @smv1999/datamorph
```

### Examples

Let's see how to convert CSV to JSON.

```js
const csvString = `
album, year, US_peak_chart_post
The White Stripes, 1999, -
De Stijl, 2000, -
White Blood Cells, 2001, 61
Elephant, 2003, 6
Get Behind Me Satan, 2005, 3
Icky Thump, 2007, 2
Under Great White Northern Lights, 2010, 11
Live in Mississippi, 2011, -
Live at the Gold Dollar, 2012, -
Nine Miles from the White City, 2013, -
`;

console.log(convertFlatFileToJSON(csvString, ","));
```

In the above example, we pass the contents of the CSV file, i.e., CSV string as the first argument and the data separator(delimeter) as the second argument.

It will generate the following output in JSON format:

```json
[
  {
    "album": "The White Stripes",
    "year": "1999",
    "US_peak_chart_post": "-"
  },
  {
    "album": "De Stijl",
    "year": "2000",
    "US_peak_chart_post": "-"
  },
  {
    "album": "White Blood Cells",
    "year": "2001",
    "US_peak_chart_post": "61"
  },
  {
    "album": "Elephant",
    "year": "2003",
    "US_peak_chart_post": "6"
  },
  {
    "album": "Get Behind Me Satan",
    "year": "2005",
    "US_peak_chart_post": "3"
  },
  {
    "album": "Icky Thump",
    "year": "2007",
    "US_peak_chart_post": "2"
  },
  {
    "album": "Under Great White Northern Lights",
    "year": "2010",
    "US_peak_chart_post": "11"
  },
  {
    "album": "Live in Mississippi",
    "year": "2011",
    "US_peak_chart_post": "-"
  },
  {
    "album": "Live at the Gold Dollar",
    "year": "2012",
    "US_peak_chart_post": "-"
  },
  {
    "album": "Nine Miles from the White City",
    "year": "2013",
    "US_peak_chart_post": "-"
  }
]
```