# map-cursor-to-max

Latest version **1.0.0** (published 2020-02-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install map-cursor-to-max
pnpm add map-cursor-to-max
yarn add map-cursor-to-max
bun add map-cursor-to-max
```

## Health

**Score 35/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2020-02-21 |
| First published | 2020-02-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | dzuc |

## Links

- npm: https://www.npmjs.com/package/map-cursor-to-max
- Repository: https://github.com/dzucconi/map-cursor-to-max
- Homepage: https://github.com/dzucconi/map-cursor-to-max#readme
- Issues: https://github.com/dzucconi/map-cursor-to-max/issues
- npm.io page: https://npm.io/package/map-cursor-to-max

## Recent versions

- 1.0.0 (latest) — 2020-02-21

## README

# map-cursor-to-max

[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release) [![npm](https://img.shields.io/npm/v/map-cursor-to-max)](https://www.npmjs.com/package/map-cursor-to-max) [![Build Status](https://travis-ci.org/dzucconi/map-cursor-to-max.svg?branch=master)](https://travis-ci.org/dzucconi/map-cursor-to-max)

## What is this?

A simple function to map some cursor to its position within a maximum.

## Installation

```bash
yarn add map-cursor-to-max
```

## Usage

```javascript
import { mapCursorToMax } from "map-cursor-to-max";

mapCursorToMax(0, 10); // => 0
mapCursorToMax(1, 10); // => 1
mapCursorToMax(9, 10); // => 9
mapCursorToMax(10, 10); // => 0
mapCursorToMax(11, 10); // => 1
mapCursorToMax(-1, 10); // => 9
```

## Interface

```typescript
const mapCursorToMax: (cursor: number, max: number) => number;
```

---
_Source: https://npm.io/package/map-cursor-to-max · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
