Add comprehensive installation and setup documentation

- Add GETTING_STARTED.md with quick start guide and development modes
- Add INSTALL.sh automated installation script
- Add INSTALLATION_CHECKLIST.md, INSTALLATION_SUCCESS.md, and INSTALLATION_SUMMARY.md
- Add QUICK_REFERENCE.md for common commands
- Add SETUP_GUIDE.md with detailed setup instructions
- Update README.md with improved project overview
- Add did-wallet app dependencies and node_modules
This commit is contained in:
Dorian
2026-01-27 17:18:21 +00:00
parent a81f655133
commit 0d073fa89e
22658 changed files with 4494151 additions and 6 deletions

View File

@@ -0,0 +1,64 @@
'use strict'
const test = require('tape')
const SparseArray = require('../')
let arr
test('allows to be constructed', (t) => {
arr = new SparseArray()
t.end()
})
test('bit field is empty', (t) => {
t.deepEqual(arr.bitField(), [])
t.end()
})
test('one item at 0 position', (t) => {
arr.set(0, 0)
t.deepEqual(arr.bitField(), [0b1])
t.end()
})
test('another item at 1 position', (t) => {
arr.set(1, 1)
t.deepEqual(arr.bitField(), [0b11])
t.end()
})
test('another item at 7th position', (t) => {
arr.set(6, 6)
t.deepEqual(arr.bitField(), [0b1000011])
t.end()
})
test('another item at 8th position', (t) => {
arr.set(7, 7)
t.deepEqual(arr.bitField(), [0b11000011])
t.end()
})
test('another item at 9th position', (t) => {
arr.set(8, 8)
t.deepEqual(arr.bitField(), [0b11000011, 0b1])
t.end()
})
test('another item at 11th position', (t) => {
arr.set(10, 10)
t.deepEqual(arr.bitField(), [0b11000011, 0b101])
t.end()
})
test('another item at 16th position', (t) => {
arr.set(15, 15)
t.deepEqual(arr.bitField(), [0b11000011, 0b10000101])
t.end()
})
test('another item at 17th position', (t) => {
arr.set(16, 16)
t.deepEqual(arr.bitField(), [0b11000011, 0b10000101, 0b1])
t.end()
})

View File

@@ -0,0 +1,70 @@
'use strict'
const test = require('tape')
const SparseArray = require('../')
const max = 100
let arr
test('allows creation', (t) => {
arr = new SparseArray()
t.end()
})
test('allows pushing', (t) => {
for(let i = 0; i < max; i++) {
const pos = arr.push(i.toString())
t.equal(pos, i + 1)
}
t.end()
})
test('has length', (t) => {
t.equal(arr.length, 100)
t.end()
})
test('can iterate', (t) => {
let next = 0
arr.forEach((elem, index, arr) => {
t.equal(elem, next.toString())
t.equal(index, next)
t.equal(arr, arr)
next ++
})
t.equal(next, max)
t.end()
})
test('can map', (t) => {
let next = 0
const result = arr.map((elem, index, arr) => {
t.equal(elem, next.toString())
t.equal(index, next)
t.equal(arr, arr)
next ++
return Number(elem) + 1
})
t.equal(next, max)
t.equal(result.length, arr.length)
next = 0
result.forEach((elem) => {
t.equal(elem, next + 1)
next ++
})
t.equal(next, max)
t.end()
})
test('can reduce', (t) => {
let next = 0
arr.reduce((acc, elem, index) => {
t.equal(elem, next.toString())
t.equal(index, next)
next ++
return acc + Number(elem)
}, 0)
t.equal(next, max)
t.end()
})

View File

@@ -0,0 +1,28 @@
'use strict'
const test = require('tape')
const SparseArray = require('../')
let arr
test('allows to be constructed', (t) => {
arr = new SparseArray()
t.end()
})
test('compact array is empty', (t) => {
t.deepEqual(arr.compactArray(), [])
t.end()
})
test('compact array containing one pos', (t) => {
arr.set(10, '10')
t.deepEqual(arr.compactArray(), ['10'])
t.end()
})
test('compact array containing two positions', (t) => {
arr.set(5, '5')
t.deepEqual(arr.compactArray(), ['5', '10'])
t.end()
})

View File

@@ -0,0 +1,31 @@
'use strict'
const test = require('tape')
const SparseArray = require('../')
const max = 100
let arr
test('allows creation', (t) => {
arr = new SparseArray()
t.end()
})
test('allows pushing', (t) => {
for(let i = 0; i < max; i++) {
const pos = arr.push(i.toString())
t.equal(pos, i + 1)
}
t.end()
})
test('find foundable', (t) => {
const min = Math.floor(max / 2)
t.equal(arr.find(elem => Number(elem) >= min), min.toString())
t.end()
})
test('does not find unfoundable', (t) => {
t.equal(arr.find(elem => Number(elem) > max), undefined)
t.end()
})

View File

@@ -0,0 +1,57 @@
'use strict'
const test = require('tape')
const SparseArray = require('../')
const max = 100
let arr
test('allows to be constructed', (t) => {
arr = new SparseArray()
t.end()
})
test('get an index that is not set returns undefined', (t) => {
t.equal(arr.get(0), undefined)
t.end()
})
test('can set a determined place', (t) => {
arr.set(0, 'v0')
t.end()
})
test('can get a value', (t) => {
t.equal(arr.get(0), 'v0')
t.end()
})
test('getting an unset value yields undefined', (t) => {
t.equal(arr.get(1), undefined)
t.end()
})
test('can set a bunch of values', (t) => {
for(let i = 0; i < max; i++) {
arr.set(i, i.toString())
}
t.end()
})
test('can get that bunch of values', (t) => {
for(let i = 0; i < max; i++) {
t.equal(arr.get(i), i.toString())
}
t.end()
})
test('can unset a bunch of values and still get the rest', (t) => {
for(let i = 0; i < max; i++) {
arr.unset(i)
t.equal(arr.get(i), undefined)
for(let j = i + 1; j < max; j++) {
t.equal(arr.get(j), j.toString())
}
}
t.end()
})

View File

@@ -0,0 +1,68 @@
'use strict'
const test = require('tape')
const SparseArray = require('../')
let arr
test('allows to be constructed', (t) => {
arr = new SparseArray()
t.end()
})
test('get an index that is not set returns undefined', (t) => {
t.equal(arr.get(9), undefined)
t.end()
})
test('can set a 9th and 6th positions', (t) => {
arr.set(9, 'v9')
arr.set(6, 'v6')
t.end()
})
test('length is 10', (t) => {
t.equal(arr.length, 10)
t.end()
})
test('can get those values', (t) => {
t.equal(arr.get(9), 'v9')
t.equal(arr.get(6), 'v6')
t.end()
})
test('delete 6th position', (t) => {
arr.unset(6)
t.end()
})
test('length is still 10', (t) => {
t.equal(arr.length, 10)
t.end()
})
test('position 6 is gone', (t) => {
t.equal(arr.get(6), undefined)
t.end()
})
test('can still get position 9', (t) => {
t.equal(arr.get(9), 'v9')
t.end()
})
test('delete 9th position', (t) => {
arr.unset(9)
t.end()
})
test('can not get position 9', (t) => {
t.equal(arr.get(9), undefined)
t.end()
})
test('length is now 0', (t) => {
t.equal(arr.length, 0)
t.end()
})