# @jacobbubu/infer-partial-order

> infer the partial order of a set from a set of examples

Latest version **1.0.0** (published 2020-07-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install @jacobbubu/infer-partial-order
pnpm add @jacobbubu/infer-partial-order
yarn add @jacobbubu/infer-partial-order
bun add @jacobbubu/infer-partial-order
```

## Health

**Score 25/100 (F)** — status: abandoned.

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

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2020-07-11 |
| First published | 2020-07-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=6.0.0 |
| Dependencies | 0 |
| Unpacked size | 9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | jacobbubu |
| Maintainers | jacobbubu |

## Links

- npm: https://www.npmjs.com/package/@jacobbubu/infer-partial-order
- Repository: https://github.com/jacobbubu/infer-partial-order
- Homepage: https://github.com/jacobbubu/infer-partial-order#readme
- Issues: https://github.com/jacobbubu/infer-partial-order/issues
- npm.io page: https://npm.io/package/@jacobbubu/infer-partial-order

## Recent versions

- 1.0.0 (latest) — 2020-07-11

## README

# @jacobbubu/infer-partial-order

[![Build Status](https://github.com/jacobbubu/infer-partial-order/workflows/Build%20and%20Release/badge.svg)](https://github.com/jacobbubu/infer-partial-order/actions?query=workflow%3A%22Build+and+Release%22)
[![Coverage Status](https://coveralls.io/repos/github/jacobbubu/infer-partial-order/badge.svg)](https://coveralls.io/github/jacobbubu/infer-partial-order)
[![npm](https://img.shields.io/npm/v/@jacobbubu/infer-partial-order.svg)](https://www.npmjs.com/package/@jacobbubu/infer-partial-order/)

> Rewrite [infer-partial-order](https://github.com/dominictarr/infer-partial-order) with TypeScript

# Why rewrite

* Rewriting makes me more aware of the author’s intentions
* Adding a type declaration to the original module will not save much

In order to understand of the function of the module, the following is the original README copied.

# infer-partial-order

infer the partial order of a set from a set of examples.

say we have two sequences `A, B, C` and `B, A, C`.
Here `A < C` and `B < C`, but sometimes `B == A`.
This relationship is obvious, because there are only 3 items,
but as the number of items increase, it's much less clear.

## Example

represent a partial ordering like this:
``` ts
import { infer } from '@jacobbubu/infer-partial-order'

infer([ [A, B, C], [B, A, C] ])

=> {
  A:[],
  B:[],
  C:[A, B]
}
```

Each key maps to the list of items that always come before it.

for more complex cases, you might want to use the canonical mode,
it strips out items that are indirectly lesser than a given item.
This is still enough information to build a graph of the order
relationships.
``` js
var infer = require('infer-partial-order')

infer([ [A, B, C, D, E], [B, A, D, C, E], [A, B, C, D, E])

=> {
  A:[],
  B:[],
  C:[A, B],
  D:[A, B],
  E:[C, D]
}
```

## License

MIT

---
_Source: https://npm.io/package/@jacobbubu/infer-partial-order · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
