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
+81
View File
@@ -0,0 +1,81 @@
# it-last
[![codecov](https://img.shields.io/codecov/c/github/achingbrain/it.svg?style=flat-square)](https://codecov.io/gh/achingbrain/it)
[![CI](https://img.shields.io/github/actions/workflow/status/achingbrain/it/js-test-and-release.yml?branch=main\&style=flat-square)](https://github.com/achingbrain/it/actions/workflows/js-test-and-release.yml?query=branch%3Amain)
> Returns the last result from an async iterator
# About
<!--
!IMPORTANT!
Everything in this README between "# About" and "# Install" is automatically
generated and will be overwritten the next time the doc generator is run.
To make changes to this section, please update the @packageDocumentation section
of src/index.js or src/index.ts
To experiment with formatting, please run "npm run docs" from the root of this
repo and examine the changes made.
-->
Return the last value from an (async)iterable.
## Example
```javascript
import last from 'it-last'
// This can also be an iterator, generator, etc
const values = [0, 1, 2, 3, 4]
const res = last(values)
console.info(res) // 4
```
Async sources must be awaited:
```javascript
import last from 'it-last'
const values = async function * () {
yield * [0, 1, 2, 3, 4]
}
const res = await last(values())
console.info(res) // 4
```
# Install
```console
$ npm i it-last
```
## Browser `<script>` tag
Loading this module through a script tag will make its exports available as `ItLast` in the global namespace.
```html
<script src="https://unpkg.com/it-last/dist/index.min.js"></script>
```
# API Docs
- <https://achingbrain.github.io/it/modules/it_last.html>
# License
Licensed under either of
- Apache 2.0, ([LICENSE-APACHE](https://github.com/achingbrain/it/blob/main/packages/it-last/LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)
- MIT ([LICENSE-MIT](https://github.com/achingbrain/it/blob/main/packages/it-last/LICENSE-MIT) / <http://opensource.org/licenses/MIT>)
# Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
+4
View File
@@ -0,0 +1,4 @@
(function (root, factory) {(typeof module === 'object' && module.exports) ? module.exports = factory() : root.ItLast = factory()}(typeof self !== 'undefined' ? self : this, function () {
"use strict";var ItLast=(()=>{var a=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var s=Object.prototype.hasOwnProperty;var u=(t,n)=>{for(var r in n)a(t,r,{get:n[r],enumerable:!0})},y=(t,n,r,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let e of l(n))!s.call(t,e)&&e!==r&&a(t,e,{get:()=>n[e],enumerable:!(o=f(n,e))||o.enumerable});return t};var c=t=>y(a({},"__esModule",{value:!0}),t);var d={};u(d,{default:()=>I});function i(t){return t[Symbol.asyncIterator]!=null}function b(t){if(i(t))return(async()=>{let r;for await(let o of t)r=o;return r})();let n;for(let r of t)n=r;return n}var I=b;return c(d);})();
return ItLast}));
//# sourceMappingURL=index.min.js.map
+7
View File
@@ -0,0 +1,7 @@
{
"version": 3,
"sources": ["../src/index.ts"],
"sourcesContent": ["/**\n * @packageDocumentation\n *\n * Return the last value from an (async)iterable.\n *\n * @example\n *\n * ```javascript\n * import last from 'it-last'\n *\n * // This can also be an iterator, generator, etc\n * const values = [0, 1, 2, 3, 4]\n *\n * const res = last(values)\n *\n * console.info(res) // 4\n * ```\n *\n * Async sources must be awaited:\n *\n * ```javascript\n * import last from 'it-last'\n *\n * const values = async function * () {\n * yield * [0, 1, 2, 3, 4]\n * }\n *\n * const res = await last(values())\n *\n * console.info(res) // 4\n * ```\n */\n\nfunction isAsyncIterable <T> (thing: any): thing is AsyncIterable<T> {\n return thing[Symbol.asyncIterator] != null\n}\n\n/**\n * Returns the last item of an (async) iterable, unless empty, in which case\n * return `undefined`\n */\nfunction last <T> (source: Iterable<T>): T | undefined\nfunction last <T> (source: Iterable<T> | AsyncIterable<T>): Promise<T | undefined>\nfunction last <T> (source: Iterable<T> | AsyncIterable<T>): Promise<T | undefined> | T | undefined {\n if (isAsyncIterable(source)) {\n return (async () => {\n let res\n\n for await (const entry of source) {\n res = entry\n }\n\n return res\n })()\n }\n\n let res\n\n for (const entry of source) {\n res = entry\n }\n\n return res\n}\n\nexport default last\n"],
"mappings": ";0bAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAiCA,SAASC,EAAqBC,EAAU,CACtC,OAAOA,EAAM,OAAO,aAAa,GAAK,IACxC,CAQA,SAASC,EAAUC,EAAsC,CACvD,GAAIH,EAAgBG,CAAM,EACxB,OAAQ,SAAW,CACjB,IAAIC,EAEJ,cAAiBC,KAASF,EACxBC,EAAMC,EAGR,OAAOD,CACT,GAAE,EAGJ,IAAIA,EAEJ,QAAWC,KAASF,EAClBC,EAAMC,EAGR,OAAOD,CACT,CAEA,IAAAL,EAAeG",
"names": ["index_exports", "__export", "index_default", "isAsyncIterable", "thing", "last", "source", "res", "entry"]
}
+40
View File
@@ -0,0 +1,40 @@
/**
* @packageDocumentation
*
* Return the last value from an (async)iterable.
*
* @example
*
* ```javascript
* import last from 'it-last'
*
* // This can also be an iterator, generator, etc
* const values = [0, 1, 2, 3, 4]
*
* const res = last(values)
*
* console.info(res) // 4
* ```
*
* Async sources must be awaited:
*
* ```javascript
* import last from 'it-last'
*
* const values = async function * () {
* yield * [0, 1, 2, 3, 4]
* }
*
* const res = await last(values())
*
* console.info(res) // 4
* ```
*/
/**
* Returns the last item of an (async) iterable, unless empty, in which case
* return `undefined`
*/
declare function last<T>(source: Iterable<T>): T | undefined;
declare function last<T>(source: Iterable<T> | AsyncIterable<T>): Promise<T | undefined>;
export default last;
//# sourceMappingURL=index.d.ts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAMH;;;GAGG;AACH,iBAAS,IAAI,CAAE,CAAC,EAAG,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,SAAS,CAAA;AACtD,iBAAS,IAAI,CAAE,CAAC,EAAG,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC,CAAA;AAuBlF,eAAe,IAAI,CAAA"}
+53
View File
@@ -0,0 +1,53 @@
/**
* @packageDocumentation
*
* Return the last value from an (async)iterable.
*
* @example
*
* ```javascript
* import last from 'it-last'
*
* // This can also be an iterator, generator, etc
* const values = [0, 1, 2, 3, 4]
*
* const res = last(values)
*
* console.info(res) // 4
* ```
*
* Async sources must be awaited:
*
* ```javascript
* import last from 'it-last'
*
* const values = async function * () {
* yield * [0, 1, 2, 3, 4]
* }
*
* const res = await last(values())
*
* console.info(res) // 4
* ```
*/
function isAsyncIterable(thing) {
return thing[Symbol.asyncIterator] != null;
}
function last(source) {
if (isAsyncIterable(source)) {
return (async () => {
let res;
for await (const entry of source) {
res = entry;
}
return res;
})();
}
let res;
for (const entry of source) {
res = entry;
}
return res;
}
export default last;
//# sourceMappingURL=index.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,SAAS,eAAe,CAAM,KAAU;IACtC,OAAO,KAAK,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,IAAI,CAAA;AAC5C,CAAC;AAQD,SAAS,IAAI,CAAM,MAAsC;IACvD,IAAI,eAAe,CAAC,MAAM,CAAC,EAAE,CAAC;QAC5B,OAAO,CAAC,KAAK,IAAI,EAAE;YACjB,IAAI,GAAG,CAAA;YAEP,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;gBACjC,GAAG,GAAG,KAAK,CAAA;YACb,CAAC;YAED,OAAO,GAAG,CAAA;QACZ,CAAC,CAAC,EAAE,CAAA;IACN,CAAC;IAED,IAAI,GAAG,CAAA;IAEP,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,GAAG,GAAG,KAAK,CAAA;IACb,CAAC;IAED,OAAO,GAAG,CAAA;AACZ,CAAC;AAED,eAAe,IAAI,CAAA"}
+142
View File
@@ -0,0 +1,142 @@
{
"name": "it-last",
"version": "3.0.9",
"description": "Returns the last result from an async iterator",
"author": "Alex Potsides <alex@achingbrain.net>",
"license": "Apache-2.0 OR MIT",
"homepage": "https://github.com/achingbrain/it/tree/main/packages/it-last#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/achingbrain/it.git"
},
"bugs": {
"url": "https://github.com/achingbrain/it/issues"
},
"publishConfig": {
"access": "public",
"provenance": true
},
"type": "module",
"types": "./dist/src/index.d.ts",
"files": [
"src",
"dist",
"!dist/test",
"!**/*.tsbuildinfo"
],
"exports": {
".": {
"types": "./dist/src/index.d.ts",
"import": "./dist/src/index.js"
}
},
"release": {
"branches": [
"main"
],
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"preset": "conventionalcommits",
"releaseRules": [
{
"breaking": true,
"release": "major"
},
{
"revert": true,
"release": "patch"
},
{
"type": "feat",
"release": "minor"
},
{
"type": "fix",
"release": "patch"
},
{
"type": "docs",
"release": "patch"
},
{
"type": "test",
"release": "patch"
},
{
"type": "deps",
"release": "patch"
},
{
"scope": "no-release",
"release": false
}
]
}
],
[
"@semantic-release/release-notes-generator",
{
"preset": "conventionalcommits",
"presetConfig": {
"types": [
{
"type": "feat",
"section": "Features"
},
{
"type": "fix",
"section": "Bug Fixes"
},
{
"type": "chore",
"section": "Trivial Changes"
},
{
"type": "docs",
"section": "Documentation"
},
{
"type": "deps",
"section": "Dependencies"
},
{
"type": "test",
"section": "Tests"
}
]
}
}
],
"@semantic-release/changelog",
"@semantic-release/npm",
"@semantic-release/github",
[
"@semantic-release/git",
{
"assets": [
"CHANGELOG.md",
"package.json"
]
}
]
]
},
"scripts": {
"build": "aegir build",
"lint": "aegir lint",
"dep-check": "aegir dep-check",
"clean": "aegir clean",
"test": "aegir test",
"test:node": "aegir test -t node --cov",
"test:chrome": "aegir test -t browser --cov",
"test:chrome-webworker": "aegir test -t webworker",
"test:firefox": "aegir test -t browser -- --browser firefox",
"test:firefox-webworker": "aegir test -t webworker -- --browser firefox",
"release": "aegir release"
},
"devDependencies": {
"aegir": "^47.0.16"
}
}
+66
View File
@@ -0,0 +1,66 @@
/**
* @packageDocumentation
*
* Return the last value from an (async)iterable.
*
* @example
*
* ```javascript
* import last from 'it-last'
*
* // This can also be an iterator, generator, etc
* const values = [0, 1, 2, 3, 4]
*
* const res = last(values)
*
* console.info(res) // 4
* ```
*
* Async sources must be awaited:
*
* ```javascript
* import last from 'it-last'
*
* const values = async function * () {
* yield * [0, 1, 2, 3, 4]
* }
*
* const res = await last(values())
*
* console.info(res) // 4
* ```
*/
function isAsyncIterable <T> (thing: any): thing is AsyncIterable<T> {
return thing[Symbol.asyncIterator] != null
}
/**
* Returns the last item of an (async) iterable, unless empty, in which case
* return `undefined`
*/
function last <T> (source: Iterable<T>): T | undefined
function last <T> (source: Iterable<T> | AsyncIterable<T>): Promise<T | undefined>
function last <T> (source: Iterable<T> | AsyncIterable<T>): Promise<T | undefined> | T | undefined {
if (isAsyncIterable(source)) {
return (async () => {
let res
for await (const entry of source) {
res = entry
}
return res
})()
}
let res
for (const entry of source) {
res = entry
}
return res
}
export default last