open-index/open-npm huggingface dataset:
npm package: @romainfieve/data-structures-converters
Description: A TypeScript library to convert binary-search-trees, doubly linked lists of any types to one another.
Author: rfieve
Latest version: 1.1.2

# 💾🏰♻️ data-structures-converters

A TypeScript library to convert binary-search-trees, doubly linked lists of any types to one another.

## Table of Content

-   [💾🏰♻️ data-structures-converters](#️-data-structures-converters)
    -   [Table of Content](#table-of-content)
    -   [Installation](#installation)
    -   [Documentation](#documentation)
        -   [`convertDLLtoBST`, `convertBSTtoDLLInstance`](#convertdlltobst-convertbsttodllinstance)
        -   [`convertBSTtoDLL`, `convertDLLtoBSTInstance`](#convertbsttodll-convertdlltobstinstance)

## Installation

```sh
yarn add @romainfieve/data-structures-converters
```

or

```sh
npm install @romainfieve/data-structures-converters
```

## Documentation

### `convertDLLtoBST`, `convertBSTtoDLLInstance`

Converts a doubly linked list to a binary search tree, depending on a given compare function if provided.

```typescript
const compare = (a: number, b: number) => a - b;
const arr = [10, 32, 13, 2, 89, 5, 50];

const list = toDLL(arr, compare);
// Schema of "list"
//
// 2 <-> 5 <-> 10 <-> 13 <-> 32 <-> 50 <-> 89
//

const tree = convertDLLtoBST(list, compare);
// Schema of "tree"
//
//           13
//        /     \
//       5      50
//     /  \    /  \
//    2   10  32   89
//
```

---

### `convertBSTtoDLL`, `convertDLLtoBSTInstance`

Converts a binary search tree to a doubly linked list, depending on a given compare function if provided.

```typescript
const compare = (a: number, b: number) => a - b;
const arr = [10, 32, 13, 2, 89, 5, 50];

const tree = toBST(list, compare);
// Schema of "tree"
//
//           13
//        /     \
//       5      50
//     /  \    /  \
//    2   10  32   89
//

const list = convertBSTtoDLL(tree, compare);
// Schema of "list"
//
// 2 <-> 5 <-> 10 <-> 13 <-> 32 <-> 50 <-> 89
//
```

---
npm package: @romainfieve/doubly-linked-list-navigator
Description: A TypeScript library extending the [doubly-linked-list](https://github.com/rfieve/doubly-linked-list) with navigation.
Author: rfieve
Latest version: 1.0.7

# ✌️🔗🧭 doubly-linked-list-navigator

A TypeScript library extending the [doubly-linked-list](https://github.com/rfieve/doubly-linked-list) with navigation.

## Table of Content

-   [✌️🔗🧭 doubly-linked-list-navigator](#️-doubly-linked-list-navigator)
    -   [Table of Content](#table-of-content)
    -   [Installation](#installation)
    -   [Usage](#usage)

## Installation

```sh
yarn add @romainfieve/doubly-linked-list-navigator
```

or

```sh
npm install @romainfieve/doubly-linked-list-navigator
```

## Usage

```typescript
const arr = [10, 32, 13, 2, 89, 5, 50];
const compare = (a: number, b: number) => a - b;

const dllNav = new DoubleLinkedListNavigator(arr, compare);

// Schema of "dllNav"
// 2 <-> 5 <-> 10 <-> 13 <-> 32 <-> 50 <-> 89

dllNav
    .goTo(13) // .current.data === 13
    .go(2) // .current.data === 50
    .go(-2); // .current.data === 13
    .goPrev() // .current.data === 10
    .goNext() // .current.data === 13
    .goTail() // .current.data === 89
    .goHead() // .current.data === 2
    .goAt(1) // .current.data === 5
    .current // { data: 5, next: ...}
```

---
npm package: @romainfieve/hasura-from-domains
Description: A NodeJS tool to import domain migrations and metadata to hasura.
Author: rfieve
Latest version: 0.0.2

# hasura-from-domains

A NodeJS tool to import domain migrations and metadata to hasura.

## Table of Content

- [hasura-from-domains](#hasura-from-domains)
  - [Table of Content](#table-of-content)
  - [Installation](#installation)
  - [Usage](#usage)

## Installation

```sh
yarn add @romainfieve/hasura-from-domains
```

or

```sh
npm install @romainfieve/hasura-from-domains
```

## Usage

```typescript
// ...
// |__ hasura
// |   |__ metadata
// |   |__ migrations
// |       |__ default
// |
// |__ src
//     |__ domains
//         |__ users
//             |__ user.permissions.yml
//             |__ user.constraints.sql
//             |__ user.tables.sql
//             |__ user.triggers.sql
// ...

generate({
    metadataPath: './hasura/metadata',
    migrationsPath: './hasura/migrations/default',
    sourceDirectory: './src/domains',
})

// ...
// |__ hasura
// |   |__ metadata
// |   |__ migrations
// |       |__ default
// |           |__ 0000000000_tables_user
// |           |   |__ up.sql
// |           |__ 0000000001_constraints_user
// |           |   |__ up.sql
// |           |__ 0000000002_triggers_user
// |               |__ up.sql
// |
// |__ src
//     |__ domains
//         |__ users
//             |__ user.permissions.yml
//             |__ user.constraints.sql
//             |__ user.tables.sql
//             |__ user.triggers.sql
// ...
```

---