open-index/open-npm huggingface dataset:
npm package: @hangxingliu/text-position
Description: ``` bash npm install @hangxingliu/text-position # or yarn add @hangxingliu/text-position ```
Author: hangxingliu
Latest version: 1.0.0

# Text Position Utils

``` bash
npm install @hangxingliu/text-position
# or
yarn add @hangxingliu/text-position
```

## APIs

- `TextPositionFromOffset`
- `getRelativePositionFromOffset`
- `getOffsetFromExpression`

## Examples

``` javascript
const { getOffsetFromExpression, TextPositionFromOffset } = require('@hangxingliu/text-position')
const text = 'abc\n\tdef';

getOffsetFromExpression(text, '1,2'); // 1
getOffsetFromExpression(text, '1$'); // 3
getOffsetFromExpression(text, '2^'); // 4
getOffsetFromExpression(text, '2^^'); // 5
getOffsetFromExpression(text, '2,2'); // 5
getOffsetFromExpression(text, '2,4', { tab: 4 }); // 5
getOffsetFromExpression(text, 'Ln 1, Col 2'); // 1

const pos = new TextPositionFromOffset(text)
pos.get(5); // [1, 1]
pos.get(6); // [1, 2]
pos.get(100); // [1, 4]
```

@see [tests](./src/tests/getOffsetFromExpression.ts)
npm package: @hangxingliu/ts-openapi
Description: OpenAPI utils for Typescript
Author: LiuYue
Latest version: 3.0.3

# Typescript OpenAPI Utils

[![ci](https://github.com/hangxingliu/ts-openapi/actions/workflows/ci.yaml/badge.svg?event=push)](https://github.com/hangxingliu/ts-openapi/actions/workflows/ci.yaml)

``` bash
npm install @hangxingliu/ts-openapi
# or
yarn add @hangxingliu/ts-openapi
```

## Usage

Most cases start from `OpenApiDocument`, 
Then adding api by `OpenApiDocument#editPath`,
and describe the api by method chains.

In a nutshell:

``` javascript
const docs = new OpenAPIDocumentBuilder();
docs.editPath('get', '/user/:userId')
  .tags(["User"])
  .jsonResponse('200', [UserEntity]);
```

See [test/project/index.ts](test/project/index.ts)

## TODO

- [ ] Add documents, js2doc
- [ ] Add unit tests for TypeORM