* 7.7.1

* Extract stringify replacer

* formatting

* linting

* isUnSorted{A, B}

* Adjust

* Complexity?

* Cleanups

* Update packages/util-crypto/src/address/derive.ts

* formatBalance

* Revert formatBalance
This commit is contained in:
Jaco
2021-10-31 16:44:17 +02:00
committed by GitHub
parent 481f7f6ee0
commit 8880e8fa8c
32 changed files with 264 additions and 178 deletions
+9 -9
View File
@@ -56,24 +56,24 @@ function getVersionLength (all: { version: string }[]): number {
/** @internal */
function flattenInfos (all: PackageJson[]): string {
const verLength = getVersionLength(all);
const stringify = ({ name, version }: PackageJson) =>
`\t${version.padEnd(verLength)}\t${name}`;
return all
.map(({ name, version }) => `\t${version.padEnd(verLength)}\t${name}`)
.join('\n');
return all.map(stringify).join('\n');
}
/** @internal */
function flattenVersions (entry: VersionPath[]): string {
const all = entry.map((version: VersionPath | string): VersionPath =>
const toPath = (version: VersionPath | string): VersionPath =>
isString(version)
? { version }
: version
);
: version;
const all = entry.map(toPath);
const verLength = getVersionLength(all);
const stringify = ({ path, version }: VersionPath) =>
`\t${version.padEnd(verLength)}\t${(!path || path.length < 5) ? '<unknown>' : path}`;
return all
.map(({ path, version }) => `\t${version.padEnd(verLength)}\t${(!path || path.length < 5) ? '<unknown>' : path}`)
.join('\n');
return all.map(stringify).join('\n');
}
/** @internal */