Skip to content

Commit

Permalink
rename package, npm doesnt like reorder
Browse files Browse the repository at this point in the history
  • Loading branch information
philihp committed Mar 8, 2021
1 parent fc0ec09 commit cd952ac
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
[![Version](https://img.shields.io/npm/v/reorder)](https://www.npmjs.com/package/reorder)
![Tests](https://github.com/philihp/reorder.js/workflows/tests/badge.svg)
[![Coverage Status](https://coveralls.io/repos/github/philihp/reorder.js/badge.svg?branch=main)](https://coveralls.io/github/philihp/reorder.js?branch=main)
![Downloads](https://img.shields.io/npm/dt/reorder)
![License](https://img.shields.io/npm/l/reorder)
[![Version](https://img.shields.io/npm/v/sort-unwind)](https://www.npmjs.com/package/sort-unwind)
![Tests](https://github.com/philihp/sort-unwind.js/workflows/tests/badge.svg)
[![Coverage Status](https://coveralls.io/repos/github/philihp/sort-unwind.js/badge.svg?branch=main)](https://coveralls.io/github/philihp/sort-unwind.js?branch=main)
![Downloads](https://img.shields.io/npm/dt/sort-unwind)
![License](https://img.shields.io/npm/l/sort-unwind)

# Reorder
# Sort Unwind

Sorts an array by an array of ranks and allows you to _undo_ back to the original shuffled state.
Sorts an array by an array of ranks and retains the stochastic tenet of the initial array so you can _undo_ back to the original shuffled state.

## Install

```
npm install --save reorder
npm install --save sort-unwind
```

## Usage

```js
import reorder from 'reorder'
import unwind from 'sort-unwind'

const suits = ['', '', '', '']
const ranks = [2, 0, 3, 1]

const [sortedSuits, unwind] = reorder(ranks, suits)
const [sortedSuits, tenet] = unwind(ranks, suits)
// sortedSuits <- ['♠', '♦', '♥', '♣']
// unwind <- [1, 3, 0, 2]
```

You can then restore perhaps another array back to the original state.
You can then restore the entropy back into the array, or perhaps apply that entropy to another array. Sort of like sending that array backward in time to the more chaotic state.

```js
const names = ['spades', 'diamonds', 'hearts', 'clubs']
const [reorderedNames, reorderedRanks] = reorder(unwind, names)
// reorderedNames <- ['hearts', 'spades', 'clubs', 'diamonds']
// reorderedRanks <- [2, 0, 3, 1]
const [tenetNames, tenetRanks] = unwind(tenet, names)
// tenetNames <- ['hearts', 'spades', 'clubs', 'diamonds']
// tenetRanks <- [2, 0, 3, 1]
```

## Thanks
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "reorder",
"name": "sort-unwind",
"version": "0.0.0",
"description": "Reorders an array",
"description": "Sorts an array and then unwinds that sort on another array",
"author": "Philihp Busby <[email protected]>",
"license": "MIT",
"main": "./dist/index.js",
Expand Down Expand Up @@ -36,13 +36,13 @@
"lint-staged": "10.5.4",
"prettier": "2.2.1"
},
"homepage": "https://github.com/philihp/reorder#readme",
"homepage": "https://github.com/philihp/sort-unwind#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/philihp/reorder.git"
"url": "git+https://github.com/philihp/sort-unwind.git"
},
"bugs": {
"url": "https://github.com/philihp/reorder/issues"
"url": "https://github.com/philihp/sort-unwind/issues"
},
"jest": {
"modulePathIgnorePatterns": [
Expand Down

0 comments on commit cd952ac

Please sign in to comment.