Prepare package to self-host in Gitea npm registry

This commit is contained in:
Theo 2023-09-12 02:32:36 -07:00
parent 3da67b29ed
commit 0045ef85b1
4 changed files with 13 additions and 12 deletions

1
.npmrc Normal file

@ -0,0 +1 @@
@tornado:registry=https://git.tornado.ws/api/packages/tornado-packages/npm/

2
.nvmrc

@ -1 +1 @@
14.17 14.23

18
lib/index.d.ts vendored

@ -3,43 +3,43 @@ export { PartialMerkleTree } from './PartialMerkleTree';
export { simpleHash } from './simpleHash'; export { simpleHash } from './simpleHash';
export { MerkleTree }; export { MerkleTree };
export default MerkleTree; export default MerkleTree;
export declare type HashFunction<T> = { export type HashFunction<T> = {
(left: T, right: T): string; (left: T, right: T): string;
}; };
export declare type MerkleTreeOptions = { export type MerkleTreeOptions = {
hashFunction?: HashFunction<Element>; hashFunction?: HashFunction<Element>;
zeroElement?: Element; zeroElement?: Element;
}; };
export declare type Element = string | number; export type Element = string | number;
export declare type SerializedTreeState = { export type SerializedTreeState = {
levels: number; levels: number;
_zeros: Array<Element>; _zeros: Array<Element>;
_layers: Array<Element[]>; _layers: Array<Element[]>;
}; };
export declare type SerializedPartialTreeState = { export type SerializedPartialTreeState = {
levels: number; levels: number;
_layers: Element[][]; _layers: Element[][];
_zeros: Array<Element>; _zeros: Array<Element>;
_edgeLeafProof: ProofPath; _edgeLeafProof: ProofPath;
_edgeLeaf: LeafWithIndex; _edgeLeaf: LeafWithIndex;
}; };
export declare type ProofPath = { export type ProofPath = {
pathElements: Element[]; pathElements: Element[];
pathIndices: number[]; pathIndices: number[];
pathPositions: number[]; pathPositions: number[];
pathRoot: Element; pathRoot: Element;
}; };
export declare type TreeEdge = { export type TreeEdge = {
edgeElement: Element; edgeElement: Element;
edgePath: ProofPath; edgePath: ProofPath;
edgeIndex: number; edgeIndex: number;
edgeElementsCount: number; edgeElementsCount: number;
}; };
export declare type TreeSlice = { export type TreeSlice = {
edge: TreeEdge; edge: TreeEdge;
elements: Element[]; elements: Element[];
}; };
export declare type LeafWithIndex = { export type LeafWithIndex = {
index: number; index: number;
data: Element; data: Element;
}; };

@ -1,8 +1,8 @@
{ {
"name": "fixed-merkle-tree", "name": "@tornado/fixed-merkle-tree",
"version": "0.7.3", "version": "0.7.3",
"description": "Fixed depth merkle tree implementation with sequential inserts", "description": "Fixed depth merkle tree implementation with sequential inserts",
"repository": "https://github.com/tornadocash/fixed-merkle-tree.git", "repository": "https://git.tornado.ws/tornado-packages/fixed-merkle-tree.git",
"main": "lib/index.js", "main": "lib/index.js",
"types": "lib/index.d.ts", "types": "lib/index.d.ts",
"scripts": { "scripts": {