包详细信息

just-permutations

angus-c2.7kMIT2.2.1

Returns all permutations of the length N of the elements of the given Array

array, list, algorithm, permutations

自述文件

just-permutations

Part of a library of zero-dependency npm modules that do just do one thing. Guilt-free utilities for every occasion.

🍦 Try it

npm install just-permutations
yarn add just-permutations

Returns all permutations of the length N of the elements of the given Array

import permutations from 'just-array-permutations;

permutations([1, 2, 3]); // [[1, 2, 3], [2, 1, 3], [2, 3, 1], [1, 3, 2], [3, 1, 2], [3, 2, 1]]
permutations([]); // []
permutations(); // throws

更新日志

just-permutations

2.2.1

Patch Changes

  • Support for element type array

2.2.0

Minor Changes

  • Rename node module .js -> .cjs

2.1.1

Patch Changes

  • fix: reorder exports to set default last #488

2.1.0

Minor Changes

  • package.json updates to fix #467 and #483