Compare commits
55 Commits
Author | SHA1 | Date | |
---|---|---|---|
7f09f1b6f4 | |||
842784f2ee | |||
8ba3b9085b | |||
b0b4de3ab3 | |||
33e2d01aca | |||
c829b9c41e | |||
6332bf671a | |||
6a373a93b3 | |||
57d1dc3fe0 | |||
98f6afec7e | |||
8548ad9684 | |||
702fbcbded | |||
62b2f976cf | |||
39ec78f358 | |||
f0c6b96648 | |||
18f63b07f7 | |||
36d52a9e03 | |||
9c0b53f373 | |||
58b189c1c7 | |||
b246894060 | |||
3d0fc6adc5 | |||
d16e3b613c | |||
af18c2f57a | |||
9476ad8129 | |||
d1284024d5 | |||
0114de2690 | |||
011f8427c1 | |||
3866cb9580 | |||
31140af566 | |||
c4b9833145 | |||
3c6d217563 | |||
8524299d39 | |||
227931b0d3 | |||
e3be31bb93 | |||
3babab347f | |||
765b388889 | |||
80b0bdd663 | |||
185baac511 | |||
2ed9210da9 | |||
7b969943dc | |||
fb8a908a31 | |||
472ca0fcbb | |||
4d47187b1e | |||
e176cadd19 | |||
a5dabd17cc | |||
cfe8a5f81a | |||
ea18170427 | |||
cd1694e93a | |||
0d0822ef3c | |||
6777f351c5 | |||
03c390604a | |||
aed684ef5c | |||
b06d1fae96 | |||
966e8678a8 | |||
b2002a53ad |
66
.gitea/workflows/default_nottags.yaml
Normal file
66
.gitea/workflows/default_nottags.yaml
Normal file
@ -0,0 +1,66 @@
|
||||
name: Default (not tags)
|
||||
|
||||
on:
|
||||
push:
|
||||
tags-ignore:
|
||||
- '**'
|
||||
|
||||
env:
|
||||
IMAGE: code.foss.global/host.today/ht-docker-node:npmci
|
||||
NPMCI_COMPUTED_REPOURL: https://${{gitea.repository_owner}}:${{secrets.GITEA_TOKEN}}@/${{gitea.repository}}.git
|
||||
NPMCI_TOKEN_NPM: ${{secrets.NPMCI_TOKEN_NPM}}
|
||||
NPMCI_TOKEN_NPM2: ${{secrets.NPMCI_TOKEN_NPM2}}
|
||||
NPMCI_GIT_GITHUBTOKEN: ${{secrets.NPMCI_GIT_GITHUBTOKEN}}
|
||||
NPMCI_URL_CLOUDLY: ${{secrets.NPMCI_URL_CLOUDLY}}
|
||||
|
||||
jobs:
|
||||
security:
|
||||
runs-on: ubuntu-latest
|
||||
continue-on-error: true
|
||||
container:
|
||||
image: ${{ env.IMAGE }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Install pnpm and npmci
|
||||
run: |
|
||||
pnpm install -g pnpm
|
||||
pnpm install -g @ship.zone/npmci
|
||||
|
||||
- name: Run npm prepare
|
||||
run: npmci npm prepare
|
||||
|
||||
- name: Audit production dependencies
|
||||
run: |
|
||||
npmci command npm config set registry https://registry.npmjs.org
|
||||
npmci command pnpm audit --audit-level=high --prod
|
||||
continue-on-error: true
|
||||
|
||||
- name: Audit development dependencies
|
||||
run: |
|
||||
npmci command npm config set registry https://registry.npmjs.org
|
||||
npmci command pnpm audit --audit-level=high --dev
|
||||
continue-on-error: true
|
||||
|
||||
test:
|
||||
if: ${{ always() }}
|
||||
needs: security
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: ${{ env.IMAGE }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Test stable
|
||||
run: |
|
||||
npmci node install stable
|
||||
npmci npm install
|
||||
npmci npm test
|
||||
|
||||
- name: Test build
|
||||
run: |
|
||||
npmci node install stable
|
||||
npmci npm install
|
||||
npmci npm build
|
124
.gitea/workflows/default_tags.yaml
Normal file
124
.gitea/workflows/default_tags.yaml
Normal file
@ -0,0 +1,124 @@
|
||||
name: Default (tags)
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
|
||||
env:
|
||||
IMAGE: code.foss.global/host.today/ht-docker-node:npmci
|
||||
NPMCI_COMPUTED_REPOURL: https://${{gitea.repository_owner}}:${{secrets.GITEA_TOKEN}}@/${{gitea.repository}}.git
|
||||
NPMCI_TOKEN_NPM: ${{secrets.NPMCI_TOKEN_NPM}}
|
||||
NPMCI_TOKEN_NPM2: ${{secrets.NPMCI_TOKEN_NPM2}}
|
||||
NPMCI_GIT_GITHUBTOKEN: ${{secrets.NPMCI_GIT_GITHUBTOKEN}}
|
||||
NPMCI_URL_CLOUDLY: ${{secrets.NPMCI_URL_CLOUDLY}}
|
||||
|
||||
jobs:
|
||||
security:
|
||||
runs-on: ubuntu-latest
|
||||
continue-on-error: true
|
||||
container:
|
||||
image: ${{ env.IMAGE }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Prepare
|
||||
run: |
|
||||
pnpm install -g pnpm
|
||||
pnpm install -g @ship.zone/npmci
|
||||
npmci npm prepare
|
||||
|
||||
- name: Audit production dependencies
|
||||
run: |
|
||||
npmci command npm config set registry https://registry.npmjs.org
|
||||
npmci command pnpm audit --audit-level=high --prod
|
||||
continue-on-error: true
|
||||
|
||||
- name: Audit development dependencies
|
||||
run: |
|
||||
npmci command npm config set registry https://registry.npmjs.org
|
||||
npmci command pnpm audit --audit-level=high --dev
|
||||
continue-on-error: true
|
||||
|
||||
test:
|
||||
if: ${{ always() }}
|
||||
needs: security
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: ${{ env.IMAGE }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Prepare
|
||||
run: |
|
||||
pnpm install -g pnpm
|
||||
pnpm install -g @ship.zone/npmci
|
||||
npmci npm prepare
|
||||
|
||||
- name: Test stable
|
||||
run: |
|
||||
npmci node install stable
|
||||
npmci npm install
|
||||
npmci npm test
|
||||
|
||||
- name: Test build
|
||||
run: |
|
||||
npmci node install stable
|
||||
npmci npm install
|
||||
npmci npm build
|
||||
|
||||
release:
|
||||
needs: test
|
||||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: ${{ env.IMAGE }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Prepare
|
||||
run: |
|
||||
pnpm install -g pnpm
|
||||
pnpm install -g @ship.zone/npmci
|
||||
npmci npm prepare
|
||||
|
||||
- name: Release
|
||||
run: |
|
||||
npmci node install stable
|
||||
npmci npm publish
|
||||
|
||||
metadata:
|
||||
needs: test
|
||||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: ${{ env.IMAGE }}
|
||||
continue-on-error: true
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Prepare
|
||||
run: |
|
||||
pnpm install -g pnpm
|
||||
pnpm install -g @ship.zone/npmci
|
||||
npmci npm prepare
|
||||
|
||||
- name: Code quality
|
||||
run: |
|
||||
npmci command npm install -g typescript
|
||||
npmci npm install
|
||||
|
||||
- name: Trigger
|
||||
run: npmci trigger
|
||||
|
||||
- name: Build docs and upload artifacts
|
||||
run: |
|
||||
npmci node install stable
|
||||
npmci npm install
|
||||
pnpm install -g @git.zone/tsdoc
|
||||
npmci command tsdoc
|
||||
continue-on-error: true
|
18
.gitignore
vendored
18
.gitignore
vendored
@ -1,5 +1,19 @@
|
||||
.nogit/
|
||||
node_modules/
|
||||
|
||||
# artifacts
|
||||
coverage/
|
||||
public/
|
||||
pages/
|
||||
|
||||
# installs
|
||||
node_modules/
|
||||
|
||||
# caches
|
||||
.yarn/
|
||||
.cache/
|
||||
.rpt2_cache
|
||||
|
||||
# builds
|
||||
dist/
|
||||
dist_*/
|
||||
|
||||
#------# custom
|
@ -1,86 +0,0 @@
|
||||
# gitzone standard
|
||||
image: hosttoday/ht-docker-node:npmci
|
||||
|
||||
cache:
|
||||
paths:
|
||||
- .yarn/
|
||||
key: "$CI_BUILD_STAGE"
|
||||
|
||||
stages:
|
||||
- mirror
|
||||
- test
|
||||
- release
|
||||
- trigger
|
||||
- pages
|
||||
|
||||
mirror:
|
||||
stage: mirror
|
||||
script:
|
||||
- npmci git mirror
|
||||
tags:
|
||||
- docker
|
||||
|
||||
testLEGACY:
|
||||
stage: test
|
||||
script:
|
||||
- npmci node install legacy
|
||||
- npmci npm install
|
||||
- npmci npm test
|
||||
coverage: /\d+.?\d+?\%\s*coverage/
|
||||
tags:
|
||||
- docker
|
||||
allow_failure: true
|
||||
|
||||
testLTS:
|
||||
stage: test
|
||||
script:
|
||||
- npmci node install lts
|
||||
- npmci npm install
|
||||
- npmci npm test
|
||||
coverage: /\d+.?\d+?\%\s*coverage/
|
||||
tags:
|
||||
- docker
|
||||
|
||||
testSTABLE:
|
||||
stage: test
|
||||
script:
|
||||
- npmci node install stable
|
||||
- npmci npm install
|
||||
- npmci npm test
|
||||
coverage: /\d+.?\d+?\%\s*coverage/
|
||||
tags:
|
||||
- docker
|
||||
|
||||
release:
|
||||
stage: release
|
||||
script:
|
||||
- npmci npm prepare
|
||||
- npmci npm publish
|
||||
only:
|
||||
- tags
|
||||
tags:
|
||||
- docker
|
||||
|
||||
trigger:
|
||||
stage: trigger
|
||||
script:
|
||||
- npmci trigger
|
||||
only:
|
||||
- tags
|
||||
tags:
|
||||
- docker
|
||||
|
||||
pages:
|
||||
image: hosttoday/ht-docker-node:npmci
|
||||
stage: pages
|
||||
script:
|
||||
- npmci command yarn global add npmpage
|
||||
- npmci command npmpage
|
||||
tags:
|
||||
- docker
|
||||
only:
|
||||
- tags
|
||||
artifacts:
|
||||
expire_in: 1 week
|
||||
paths:
|
||||
- public
|
11
.vscode/launch.json
vendored
Normal file
11
.vscode/launch.json
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"command": "npm test",
|
||||
"name": "Run npm test",
|
||||
"request": "launch",
|
||||
"type": "node-terminal"
|
||||
}
|
||||
]
|
||||
}
|
26
.vscode/settings.json
vendored
Normal file
26
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
{
|
||||
"json.schemas": [
|
||||
{
|
||||
"fileMatch": ["/npmextra.json"],
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"npmci": {
|
||||
"type": "object",
|
||||
"description": "settings for npmci"
|
||||
},
|
||||
"gitzone": {
|
||||
"type": "object",
|
||||
"description": "settings for gitzone",
|
||||
"properties": {
|
||||
"projectType": {
|
||||
"type": "string",
|
||||
"enum": ["website", "element", "service", "npm", "wcc"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
123
changelog.md
Normal file
123
changelog.md
Normal file
@ -0,0 +1,123 @@
|
||||
# Changelog
|
||||
|
||||
## 2025-01-25 - 2.2.1 - fix(core)
|
||||
Remove unused logcontext classes and update exports
|
||||
|
||||
- Removed classes and plugins from logcontext that were not in use.
|
||||
- Adjusted exports to not include deprecated logger-related modules.
|
||||
|
||||
## 2025-01-25 - 2.2.0 - feat(tests)
|
||||
Added a new test script to demonstrate and validate AsyncContext functionality
|
||||
|
||||
- Introduced jstrial.js in the test directory to ensure the correct working of AsyncContext.
|
||||
- The new tests handle various scenarios, including the independence of child stores and data deletion.
|
||||
|
||||
## 2025-01-23 - 2.1.8 - fix(core)
|
||||
Refactor and clean up class imports and exports
|
||||
|
||||
- Simplified class file structure by unifying imports and exports.
|
||||
- Removed redundant `logcontext.*` prefixes from filenames.
|
||||
- Ensured consistent path references in index.ts.
|
||||
|
||||
## 2025-01-23 - 2.1.7 - fix(core)
|
||||
Enhanced debugging and improved dependency tracking
|
||||
|
||||
- Updated @types/node to version ^22.10.10.
|
||||
- Updated simple-async-context to version ^0.0.23.
|
||||
- Enhanced the logDebug method to check for the existence of process and environment variables.
|
||||
- Fixed dependency versions in package.json.
|
||||
|
||||
## 2025-01-19 - 2.1.6 - fix(core)
|
||||
Updated dependencies and improved AsyncStore debugging and cleanup
|
||||
|
||||
- Upgraded 'simple-async-context' dependency to version ^0.0.16 for consistency and improvements.
|
||||
- Added detailed debugging information in AsyncStore when DEBUG environment variable is set.
|
||||
- Enhanced cleanup process for deleted keys in AsyncStore.
|
||||
- Removed redundant dependencies from package.json and logcontext.plugins.ts.
|
||||
|
||||
## 2025-01-19 - 2.1.5 - fix(dependencies)
|
||||
Update dependencies for improved compatibility
|
||||
|
||||
- Updated @types/node to version ^22.10.7
|
||||
- Updated @types/shortid to version 2.2.0
|
||||
- Updated simple-async-context to version ^0.0.15
|
||||
|
||||
## 2025-01-19 - 2.1.4 - fix(documentation)
|
||||
Remove unnecessary conclusion section from the README for better clarity.
|
||||
|
||||
- Removed the 'Conclusion' header which was redundant in the README.
|
||||
|
||||
## 2025-01-19 - 2.1.3 - fix(readme)
|
||||
Update README.md for better clarity and examples.
|
||||
|
||||
- Enhanced documentation with clearer examples of AsyncContext usage.
|
||||
- Reorganized sections for improved understanding of `runScoped` and its benefits.
|
||||
- Added detailed test script example in README.md.
|
||||
- Clarified data isolation and deletion mechanisms within scoped functions.
|
||||
|
||||
## 2025-01-19 - 2.1.2 - fix(core)
|
||||
Improve scope handling in async contexts.
|
||||
|
||||
- Modified the handling of scoped stores within `AsyncContext.runScoped` to simplify the API usage.
|
||||
- Refactored tests to verify the context's behavior and isolation between parent and child stores.
|
||||
|
||||
## 2025-01-18 - 2.1.1 - fix(build)
|
||||
Fix tsbuild script to include missing flag
|
||||
|
||||
- Updated the build script in package.json to include --allowimplicitany flag.
|
||||
|
||||
## 2025-01-18 - 2.1.0 - feat(ci)
|
||||
Add GitHub Actions workflows for CI/CD
|
||||
|
||||
- Introduce GitHub Actions workflows to handle CI/CD processes for different events and branch types.
|
||||
- Remove GitLab CI configuration in favor of GitHub Actions.
|
||||
- Ensure security audits and tests are run as part of the CI pipeline.
|
||||
|
||||
## 2024-05-29 to 2024-03-30 - 2.0.0 - Configuration Updates
|
||||
Improvements and updates to configuration files.
|
||||
|
||||
- Updated project description
|
||||
- Modified TypeScript configuration
|
||||
- Updated npmextra.json for githost details
|
||||
|
||||
## 2023-07-11 to 2023-07-10 - 2.0.0 - Organizational Change
|
||||
Transitioned to a new organizational scheme for improved project structure.
|
||||
|
||||
- Implemented new organizational scheme
|
||||
|
||||
## 2023-01-12 - 1.0.29 - Breaking Change
|
||||
Important breaking changes introduced, switched project to ECMAScript Module (ESM) format.
|
||||
|
||||
- Switched to ECMAScript Module (ESM)
|
||||
- Core functionality updated
|
||||
|
||||
## 2021-09-17 to 2020-07-20 - 1.0.28 to 1.0.23 - Core Fixes
|
||||
Multiple core improvements and bug fixes across several versions.
|
||||
|
||||
- Core functionality updates across versions
|
||||
|
||||
## 2018-03-09 to 2018-03-05 - 1.0.21 to 1.0.20 - Documentation Updates
|
||||
Enhancements and updates to project documentation.
|
||||
|
||||
- License information updated in README
|
||||
- General README updates
|
||||
|
||||
## 2018-03-05 - 1.0.19 - Standards Update
|
||||
Updated project to comply with the latest coding standards.
|
||||
|
||||
- Applied latest standard updates
|
||||
|
||||
## 2018-03-03 - 1.0.18 - Initial Working Version
|
||||
Initial release with all dependencies configured.
|
||||
|
||||
- First working project version with dependencies
|
||||
|
||||
## 2017-10-16 - 1.0.2 - Documentation
|
||||
Initial project documentation added.
|
||||
|
||||
- Added initial README file
|
||||
|
||||
## 2017-10-16 - 1.0.1 - Initial Release
|
||||
The initial release of the project.
|
||||
|
||||
- Project setup and initial commit
|
@ -1,4 +0,0 @@
|
||||
module.name: smartmodule
|
||||
module.description: a smart description
|
||||
module.author: Lossless GmbH
|
||||
module.license: MIT
|
1
dist/index.d.ts
vendored
1
dist/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export declare let standardExport: string;
|
4
dist/index.js
vendored
4
dist/index.js
vendored
@ -1,4 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.standardExport = 'Hi there! :) This is a exported string';
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUVXLFFBQUEsY0FBYyxHQUFHLHdDQUF3QyxDQUFBIn0=
|
1
dist/logcontext.plugins.d.ts
vendored
1
dist/logcontext.plugins.d.ts
vendored
@ -1 +0,0 @@
|
||||
import 'typings-global';
|
4
dist/logcontext.plugins.js
vendored
4
dist/logcontext.plugins.js
vendored
@ -1,4 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
require("typings-global");
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9nY29udGV4dC5wbHVnaW5zLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvbG9nY29udGV4dC5wbHVnaW5zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsMEJBQXVCIn0=
|
@ -1,7 +1,31 @@
|
||||
{
|
||||
"gitzone": {
|
||||
"projectType": "npm",
|
||||
"module": {
|
||||
"githost": "code.foss.global",
|
||||
"gitscope": "push.rocks",
|
||||
"gitrepo": "logcontext",
|
||||
"description": "A module providing advanced asynchronous context management to enrich logs with context and manage scope effectively in Node.js applications.",
|
||||
"npmPackagename": "@push.rocks/logcontext",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"logging",
|
||||
"context management",
|
||||
"context enrichment",
|
||||
"asynchronous",
|
||||
"scope management",
|
||||
"typescript",
|
||||
"nodejs",
|
||||
"module",
|
||||
"async log contexts"
|
||||
]
|
||||
}
|
||||
},
|
||||
"npmci": {
|
||||
"npmGlobalTools": [
|
||||
"npmts"
|
||||
]
|
||||
"npmAccessLevel": "public",
|
||||
"npmGlobalTools": []
|
||||
},
|
||||
"tsdoc": {
|
||||
"legal": "\n## License and Legal Information\n\nThis repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository. \n\n**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.\n\n### Trademarks\n\nThis project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.\n\n### Company Information\n\nTask Venture Capital GmbH \nRegistered at District court Bremen HRB 35230 HB, Germany\n\nFor any legal inquiries or if you require further information, please contact us via email at hello@task.vc.\n\nBy using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.\n"
|
||||
}
|
||||
}
|
||||
}
|
61
package.json
61
package.json
@ -1,18 +1,63 @@
|
||||
{
|
||||
"name": "logcontext",
|
||||
"version": "1.0.2",
|
||||
"description": "log things contexts in async environments",
|
||||
"main": "dist/index.js",
|
||||
"typings": "dist/index.d.ts",
|
||||
"name": "@push.rocks/smartcontext",
|
||||
"version": "2.2.1",
|
||||
"description": "A module providing advanced asynchronous context management to enrich logs with context and manage scope effectively in Node.js applications.",
|
||||
"exports": {
|
||||
".": "./dist_ts/index.js"
|
||||
},
|
||||
"type": "module",
|
||||
"author": "Lossless GmbH",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"test": "(npmts)"
|
||||
"test": "(tstest test/)",
|
||||
"build": "(tsbuild --allowimplicitany --web)",
|
||||
"buildDocs": "tsdoc"
|
||||
},
|
||||
"devDependencies": {
|
||||
"tapbundle": "^1.0.13"
|
||||
"@git.zone/tsbuild": "^2.1.27",
|
||||
"@git.zone/tsbundle": "^2.0.7",
|
||||
"@git.zone/tsrun": "^1.2.39",
|
||||
"@git.zone/tstest": "^1.0.96",
|
||||
"@push.rocks/smartdelay": "^3.0.5",
|
||||
"@push.rocks/tapbundle": "^5.5.6",
|
||||
"@types/node": "^22.10.10"
|
||||
},
|
||||
"dependencies": {
|
||||
"typings-global": "^1.0.16"
|
||||
"simple-async-context": "^0.0.23"
|
||||
},
|
||||
"private": false,
|
||||
"browserslist": [
|
||||
"last 1 chrome versions"
|
||||
],
|
||||
"files": [
|
||||
"ts/**/*",
|
||||
"ts_web/**/*",
|
||||
"dist/**/*",
|
||||
"dist_*/**/*",
|
||||
"dist_ts/**/*",
|
||||
"dist_ts_web/**/*",
|
||||
"assets/**/*",
|
||||
"cli.js",
|
||||
"npmextra.json",
|
||||
"readme.md"
|
||||
],
|
||||
"keywords": [
|
||||
"logging",
|
||||
"context management",
|
||||
"context enrichment",
|
||||
"asynchronous",
|
||||
"scope management",
|
||||
"typescript",
|
||||
"nodejs",
|
||||
"module",
|
||||
"async log contexts"
|
||||
],
|
||||
"homepage": "https://code.foss.global/push.rocks/logcontext#readme",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://code.foss.global/push.rocks/logcontext.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://code.foss.global/push.rocks/logcontext/issues"
|
||||
}
|
||||
}
|
||||
|
9670
pnpm-lock.yaml
generated
Normal file
9670
pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load Diff
1
readme.hints.md
Normal file
1
readme.hints.md
Normal file
@ -0,0 +1 @@
|
||||
|
221
readme.md
Normal file
221
readme.md
Normal file
@ -0,0 +1,221 @@
|
||||
# @push.rocks/smartcontext
|
||||
|
||||
A module to enrich logs with context, featuring async log contexts and scope management.
|
||||
|
||||
Special thanks to Ilias Bhallil for his awesome simple-async-context library.
|
||||
|
||||
## Install
|
||||
|
||||
Make sure you have Node.js and npm installed, then run:
|
||||
|
||||
```bash
|
||||
npm install @push.rocks/smartcontext
|
||||
```
|
||||
|
||||
This will install the library and its dependencies into your local `node_modules` folder.
|
||||
|
||||
## Usage
|
||||
|
||||
The `@push.rocks/smartcontext` module provides an efficient way to enrich your code (often for logging) with contextual information. It uses asynchronous context management to support hierarchical scopes—particularly helpful in complex or nested asynchronous operations in Node.js.
|
||||
|
||||
### Basic Setup
|
||||
|
||||
```typescript
|
||||
import { AsyncContext } from '@push.rocks/smartcontext';
|
||||
|
||||
const asyncContext = new AsyncContext();
|
||||
|
||||
// The parent store is always accessible through `asyncContext.store`
|
||||
asyncContext.store.add('username', 'john_doe');
|
||||
console.log(asyncContext.store.get('username')); // 'john_doe'
|
||||
```
|
||||
|
||||
|
||||
### `runScoped`
|
||||
|
||||
When you call `asyncContext.runScoped(async () => { ... })`, the library automatically creates a **child** `AsyncStore`. Inside that scoped function, `asyncContext.store` refers to the child store. Any data you add or delete there is isolated from the parent store. However, you can still read parent data if it hasn’t been overridden.
|
||||
|
||||
```typescript
|
||||
await asyncContext.runScoped(async () => {
|
||||
// Inside this callback, `asyncContext.store` is a *child* store
|
||||
asyncContext.store.add('transactionId', 'txn_abc123');
|
||||
console.log(asyncContext.store.get('transactionId')); // 'txn_abc123'
|
||||
|
||||
// We can also see parent data like 'username'
|
||||
console.log(asyncContext.store.get('username')); // 'john_doe'
|
||||
});
|
||||
|
||||
// Outside `runScoped`, asyncContext.store reverts to the parent store
|
||||
console.log(asyncContext.store.get('transactionId')); // undefined
|
||||
```
|
||||
|
||||
|
||||
### Isolating Data
|
||||
|
||||
Because each call to `runScoped` returns control to the parent store afterward, any keys added in a child scope disappear once the scope completes (unless you explicitly move them to the parent). This mechanism keeps data from leaking between scopes.
|
||||
|
||||
```typescript
|
||||
// Parent store
|
||||
asyncContext.store.add('someParentKey', 'parentValue');
|
||||
|
||||
// Child scope
|
||||
await asyncContext.runScoped(async () => {
|
||||
asyncContext.store.add('scopedKey', 'childValue');
|
||||
console.log(asyncContext.store.get('scopedKey')); // 'childValue'
|
||||
});
|
||||
|
||||
// Outside, the child key is gone
|
||||
console.log(asyncContext.store.get('scopedKey')); // undefined
|
||||
```
|
||||
|
||||
|
||||
### Deleting Data
|
||||
|
||||
If the child deletes a key that exists in the parent, it will only remove it from the child’s view of the store. Once the scope completes, the parent store is unaffected.
|
||||
|
||||
```typescript
|
||||
asyncContext.store.add('deletableKey', 'originalValue');
|
||||
|
||||
await asyncContext.runScoped(async () => {
|
||||
console.log(asyncContext.store.get('deletableKey')); // 'originalValue'
|
||||
asyncContext.store.delete('deletableKey');
|
||||
console.log(asyncContext.store.get('deletableKey')); // undefined in child
|
||||
});
|
||||
|
||||
console.log(asyncContext.store.get('deletableKey')); // 'originalValue' remains in parent
|
||||
```
|
||||
|
||||
|
||||
### Parallel or Sequential Scopes
|
||||
|
||||
You can call `runScoped` multiple times, whether sequentially or in parallel (with `Promise.all`). Each invocation creates its own isolated child store, preventing data collisions across asynchronous tasks.
|
||||
|
||||
```typescript
|
||||
await asyncContext.runScoped(async () => {
|
||||
asyncContext.store.add('childKey1', 'childValue1');
|
||||
console.log(asyncContext.store.get('childKey1')); // 'childValue1'
|
||||
});
|
||||
|
||||
await asyncContext.runScoped(async () => {
|
||||
asyncContext.store.add('childKey2', 'childValue2');
|
||||
console.log(asyncContext.store.get('childKey2')); // 'childValue2'
|
||||
});
|
||||
|
||||
// Both keys were added in separate scopes, so they won't exist in the parent
|
||||
console.log(asyncContext.store.get('childKey1')); // undefined
|
||||
console.log(asyncContext.store.get('childKey2')); // undefined
|
||||
```
|
||||
|
||||
|
||||
### Testing Example
|
||||
|
||||
The following is a complete test script (using [tapbundle](https://www.npmjs.com/package/@push.rocks/tapbundle)) demonstrating how child stores inherit data from the parent but remain isolated. After each scoped block, new child keys vanish, and any parent keys deleted inside the child remain intact in the parent.
|
||||
|
||||
```typescript
|
||||
import { tap, expect } from '@push.rocks/tapbundle';
|
||||
import { AsyncContext } from '../ts/logcontext.classes.asynccontext.js';
|
||||
|
||||
const asyncContext = new AsyncContext();
|
||||
|
||||
tap.test('should run a scoped function and add data to a child store', async () => {
|
||||
// Add some default data to the parent store
|
||||
asyncContext.store.add('parentKey', 'parentValue');
|
||||
expect(asyncContext.store.get('parentKey')).toEqual('parentValue');
|
||||
|
||||
// Now run a child scope, add some data, and check that parent data is still accessible
|
||||
await asyncContext.runScoped(async () => {
|
||||
asyncContext.store.add('childKey', 'childValue');
|
||||
|
||||
// Child sees its own data
|
||||
expect(asyncContext.store.get('childKey')).toEqual('childValue');
|
||||
// Child also sees parent data
|
||||
expect(asyncContext.store.get('parentKey')).toEqual('parentValue');
|
||||
});
|
||||
});
|
||||
|
||||
tap.test('should not contaminate the parent store with child-only data', async () => {
|
||||
// Create a new child scope
|
||||
await asyncContext.runScoped(async () => {
|
||||
asyncContext.store.add('temporaryKey', 'temporaryValue');
|
||||
expect(asyncContext.store.get('temporaryKey')).toEqual('temporaryValue');
|
||||
});
|
||||
// After scope finishes, 'temporaryKey' won't exist in the parent
|
||||
expect(asyncContext.store.get('temporaryKey')).toBeUndefined();
|
||||
});
|
||||
|
||||
tap.test('should allow adding data in multiple scopes independently', async () => {
|
||||
// Add data in the first scope
|
||||
await asyncContext.runScoped(async () => {
|
||||
asyncContext.store.add('childKey1', 'childValue1');
|
||||
expect(asyncContext.store.get('childKey1')).toEqual('childValue1');
|
||||
});
|
||||
|
||||
// Add data in the second scope
|
||||
await asyncContext.runScoped(async () => {
|
||||
asyncContext.store.add('childKey2', 'childValue2');
|
||||
expect(asyncContext.store.get('childKey2')).toEqual('childValue2');
|
||||
});
|
||||
|
||||
// Neither childKey1 nor childKey2 should exist in the parent store
|
||||
expect(asyncContext.store.get('childKey1')).toBeUndefined();
|
||||
expect(asyncContext.store.get('childKey2')).toBeUndefined();
|
||||
});
|
||||
|
||||
tap.test('should allow deleting data in a child store without removing it from the parent store', async () => {
|
||||
// Ensure parent has some data
|
||||
asyncContext.store.add('deletableKey', 'iShouldStayInParent');
|
||||
|
||||
await asyncContext.runScoped(async () => {
|
||||
// Child sees the parent's data
|
||||
expect(asyncContext.store.get('deletableKey')).toEqual('iShouldStayInParent');
|
||||
// Delete it in the child
|
||||
asyncContext.store.delete('deletableKey');
|
||||
// Child no longer sees it
|
||||
expect(asyncContext.store.get('deletableKey')).toBeUndefined();
|
||||
});
|
||||
// Parent still has it
|
||||
expect(asyncContext.store.get('deletableKey')).toEqual('iShouldStayInParent');
|
||||
});
|
||||
|
||||
tap.test('should allow multiple child scopes to share the same parent store data', async () => {
|
||||
// Add a key to the parent store
|
||||
asyncContext.store.add('sharedKey', 'sharedValue');
|
||||
expect(asyncContext.store.get('sharedKey')).toEqual('sharedValue');
|
||||
|
||||
// First child scope
|
||||
await asyncContext.runScoped(async () => {
|
||||
expect(asyncContext.store.get('sharedKey')).toEqual('sharedValue');
|
||||
});
|
||||
|
||||
// Second child scope
|
||||
await asyncContext.runScoped(async () => {
|
||||
expect(asyncContext.store.get('sharedKey')).toEqual('sharedValue');
|
||||
});
|
||||
});
|
||||
|
||||
export default tap.start();
|
||||
```
|
||||
|
||||
|
||||
With this updated `runScoped` design, there’s no need to explicitly instantiate or manage child stores. The context automatically switches from the parent store to the child store while within the callback, then reverts back to the parent store afterwards. This structure makes it easy to:
|
||||
|
||||
- Keep each async operation’s state isolated
|
||||
- Preserve read-access to parent context data
|
||||
- Avoid overwriting or polluting other operations’ data
|
||||
|
||||
This pattern works particularly well for logging or any scenario where you need to pass metadata through deeply nested async calls without manually juggling that data everywhere in your code.
|
||||
|
||||
## License and Legal Information
|
||||
|
||||
This repository is under the [MIT License](./license). Please note that the MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as necessary for reasonable use in describing the origin of the work.
|
||||
|
||||
### Trademarks
|
||||
|
||||
This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Usage must be approved in writing by Task Venture Capital GmbH.
|
||||
|
||||
### Company Information
|
||||
|
||||
Task Venture Capital GmbH
|
||||
Registered at District Court Bremen HRB 35230 HB, Germany
|
||||
|
||||
For any legal inquiries, please contact us at hello@task.vc. By using this repository, you acknowledge that you have read this section and agree to comply with its terms.
|
110
test/jstrial.js
Normal file
110
test/jstrial.js
Normal file
@ -0,0 +1,110 @@
|
||||
import { tap, expect } from '@push.rocks/tapbundle';
|
||||
|
||||
import * as asynccontext from '../dist_ts/index.js';
|
||||
|
||||
|
||||
if (typeof process !== 'undefined') {
|
||||
// process.env.DEBUG = 'true';
|
||||
}
|
||||
|
||||
/**
|
||||
* This test file demonstrates how to use the AsyncContext and ensures
|
||||
* that runScoped() properly creates child AsyncStore contexts and merges parent data.
|
||||
*/
|
||||
|
||||
const asyncContext = new asynccontext.AsyncContext();
|
||||
|
||||
tap.test('should run a scoped function and add data to a child store', async () => {
|
||||
// add some default data to the parent store
|
||||
asyncContext.store.add('parentKey', 'parentValue');
|
||||
expect(asyncContext.store.get('parentKey')).toEqual('parentValue');
|
||||
|
||||
// now run a child scope, add some data, and check that parent's data is still accessible
|
||||
await asyncContext.runScoped(async () => {
|
||||
asyncContext.store.add('childKey', 'childValue');
|
||||
|
||||
// child should see its own data
|
||||
expect(asyncContext.store.get('childKey')).toEqual('childValue');
|
||||
// child should also see parent data
|
||||
expect(asyncContext.store.get('parentKey')).toEqual('parentValue');
|
||||
});
|
||||
});
|
||||
|
||||
tap.test('should not contaminate the parent store with child-only data', async () => {
|
||||
// create a new child scope
|
||||
await asyncContext.runScoped(async () => {
|
||||
asyncContext.store.add('temporaryKey', 'temporaryValue');
|
||||
expect(asyncContext.store.get('temporaryKey')).toEqual('temporaryValue');
|
||||
});
|
||||
// after the child scope finishes, 'temporaryKey' should not exist in the parent
|
||||
expect(asyncContext.store.get('temporaryKey')).toBeUndefined();
|
||||
});
|
||||
|
||||
tap.test('should allow adding data in multiple scopes independently', async (toolsArg) => {
|
||||
const done = toolsArg.cumulativeDefer();
|
||||
|
||||
// add data in first scope
|
||||
asyncContext.runScoped(async () => {
|
||||
const subDone = done.subDefer();
|
||||
asyncContext.store.add('childKey1', 'childValue1-v1');
|
||||
await toolsArg.delayFor(2000);
|
||||
expect(asyncContext.store.get('childKey1')).toEqual('childValue1-v1');
|
||||
subDone.resolve();
|
||||
});
|
||||
|
||||
asyncContext.runScoped(async () => {
|
||||
const subDone = done.subDefer();
|
||||
asyncContext.store.add('childKey1', 'childValue1-v2');
|
||||
await toolsArg.delayFor(1000);
|
||||
expect(asyncContext.store.get('childKey1')).toEqual('childValue1-v2');
|
||||
subDone.resolve();
|
||||
});
|
||||
|
||||
// add data in second scope
|
||||
asyncContext.runScoped(async () => {
|
||||
asyncContext.store.add('childKey2', 'childValue2');
|
||||
expect(asyncContext.store.get('childKey2')).toEqual('childValue2');
|
||||
});
|
||||
|
||||
// neither childKey1 nor childKey2 should exist in the parent store
|
||||
expect(asyncContext.store.get('childKey1')).toBeUndefined();
|
||||
expect(asyncContext.store.get('childKey2')).toBeUndefined();
|
||||
await done.promise;
|
||||
});
|
||||
|
||||
tap.test(
|
||||
'should allow deleting data in a child store without removing it from the parent store',
|
||||
async (toolsArg) => {
|
||||
// ensure parent has some data
|
||||
asyncContext.store.add('deletableKey', 'iShouldStayInParent');
|
||||
|
||||
await asyncContext.runScoped(async () => {
|
||||
// child sees the parent's data
|
||||
expect(asyncContext.store.get('deletableKey')).toEqual('iShouldStayInParent');
|
||||
// attempt to delete it in the child
|
||||
asyncContext.store.delete('deletableKey');
|
||||
// child no longer sees it
|
||||
expect(asyncContext.store.get('deletableKey')).toBeUndefined();
|
||||
// but parent still has it
|
||||
});
|
||||
expect(asyncContext.store.get('deletableKey')).toEqual('iShouldStayInParent');
|
||||
}
|
||||
);
|
||||
|
||||
tap.test('should allow multiple child scopes to share the same parent store data', async () => {
|
||||
// add a key to the parent store
|
||||
asyncContext.store.add('sharedKey', 'sharedValue');
|
||||
expect(asyncContext.store.get('sharedKey')).toEqual('sharedValue');
|
||||
|
||||
// first child scope
|
||||
await asyncContext.runScoped(async () => {
|
||||
expect(asyncContext.store.get('sharedKey')).toEqual('sharedValue');
|
||||
});
|
||||
|
||||
// second child scope
|
||||
await asyncContext.runScoped(async () => {
|
||||
expect(asyncContext.store.get('sharedKey')).toEqual('sharedValue');
|
||||
});
|
||||
});
|
||||
|
||||
export default tap.start();
|
110
test/test.both.ts
Normal file
110
test/test.both.ts
Normal file
@ -0,0 +1,110 @@
|
||||
import { tap, expect } from '@push.rocks/tapbundle';
|
||||
|
||||
import * as asynccontext from '../ts/index.js';
|
||||
|
||||
|
||||
if (typeof process !== 'undefined') {
|
||||
process.env.DEBUG = 'true';
|
||||
}
|
||||
|
||||
/**
|
||||
* This test file demonstrates how to use the AsyncContext and ensures
|
||||
* that runScoped() properly creates child AsyncStore contexts and merges parent data.
|
||||
*/
|
||||
|
||||
const asyncContext = new asynccontext.AsyncContext();
|
||||
|
||||
tap.test('should run a scoped function and add data to a child store', async () => {
|
||||
// add some default data to the parent store
|
||||
asyncContext.store.add('parentKey', 'parentValue');
|
||||
expect(asyncContext.store.get('parentKey')).toEqual('parentValue');
|
||||
|
||||
// now run a child scope, add some data, and check that parent's data is still accessible
|
||||
await asyncContext.runScoped(async () => {
|
||||
asyncContext.store.add('childKey', 'childValue');
|
||||
|
||||
// child should see its own data
|
||||
expect(asyncContext.store.get('childKey')).toEqual('childValue');
|
||||
// child should also see parent data
|
||||
expect(asyncContext.store.get('parentKey')).toEqual('parentValue');
|
||||
});
|
||||
});
|
||||
|
||||
tap.test('should not contaminate the parent store with child-only data', async () => {
|
||||
// create a new child scope
|
||||
await asyncContext.runScoped(async () => {
|
||||
asyncContext.store.add('temporaryKey', 'temporaryValue');
|
||||
expect(asyncContext.store.get('temporaryKey')).toEqual('temporaryValue');
|
||||
});
|
||||
// after the child scope finishes, 'temporaryKey' should not exist in the parent
|
||||
expect(asyncContext.store.get('temporaryKey')).toBeUndefined();
|
||||
});
|
||||
|
||||
tap.test('should allow adding data in multiple scopes independently', async (toolsArg) => {
|
||||
const done = toolsArg.cumulativeDefer();
|
||||
|
||||
// add data in first scope
|
||||
asyncContext.runScoped(async () => {
|
||||
const subDone = done.subDefer();
|
||||
asyncContext.store.add('childKey1', 'childValue1-v1');
|
||||
await toolsArg.delayFor(2000);
|
||||
expect(asyncContext.store.get('childKey1')).toEqual('childValue1-v1');
|
||||
subDone.resolve();
|
||||
});
|
||||
|
||||
asyncContext.runScoped(async () => {
|
||||
const subDone = done.subDefer();
|
||||
asyncContext.store.add('childKey1', 'childValue1-v2');
|
||||
await toolsArg.delayFor(1000);
|
||||
expect(asyncContext.store.get('childKey1')).toEqual('childValue1-v2');
|
||||
subDone.resolve();
|
||||
});
|
||||
|
||||
// add data in second scope
|
||||
asyncContext.runScoped(async () => {
|
||||
asyncContext.store.add('childKey2', 'childValue2');
|
||||
expect(asyncContext.store.get('childKey2')).toEqual('childValue2');
|
||||
});
|
||||
|
||||
// neither childKey1 nor childKey2 should exist in the parent store
|
||||
expect(asyncContext.store.get('childKey1')).toBeUndefined();
|
||||
expect(asyncContext.store.get('childKey2')).toBeUndefined();
|
||||
await done.promise;
|
||||
});
|
||||
|
||||
tap.test(
|
||||
'should allow deleting data in a child store without removing it from the parent store',
|
||||
async (toolsArg) => {
|
||||
// ensure parent has some data
|
||||
asyncContext.store.add('deletableKey', 'iShouldStayInParent');
|
||||
|
||||
await asyncContext.runScoped(async () => {
|
||||
// child sees the parent's data
|
||||
expect(asyncContext.store.get('deletableKey')).toEqual('iShouldStayInParent');
|
||||
// attempt to delete it in the child
|
||||
asyncContext.store.delete('deletableKey');
|
||||
// child no longer sees it
|
||||
expect(asyncContext.store.get('deletableKey')).toBeUndefined();
|
||||
// but parent still has it
|
||||
});
|
||||
expect(asyncContext.store.get('deletableKey')).toEqual('iShouldStayInParent');
|
||||
}
|
||||
);
|
||||
|
||||
tap.test('should allow multiple child scopes to share the same parent store data', async () => {
|
||||
// add a key to the parent store
|
||||
asyncContext.store.add('sharedKey', 'sharedValue');
|
||||
expect(asyncContext.store.get('sharedKey')).toEqual('sharedValue');
|
||||
|
||||
// first child scope
|
||||
await asyncContext.runScoped(async () => {
|
||||
expect(asyncContext.store.get('sharedKey')).toEqual('sharedValue');
|
||||
});
|
||||
|
||||
// second child scope
|
||||
await asyncContext.runScoped(async () => {
|
||||
expect(asyncContext.store.get('sharedKey')).toEqual('sharedValue');
|
||||
});
|
||||
});
|
||||
|
||||
export default tap.start();
|
@ -1,8 +0,0 @@
|
||||
import { expect, tap } from 'tapbundle'
|
||||
import * as logcontext from '../ts/index'
|
||||
|
||||
tap.test('first test', async () => {
|
||||
console.log(logcontext.standardExport)
|
||||
})
|
||||
|
||||
tap.start()
|
8
ts/00_commitinfo_data.ts
Normal file
8
ts/00_commitinfo_data.ts
Normal file
@ -0,0 +1,8 @@
|
||||
/**
|
||||
* autocreated commitinfo by @push.rocks/commitinfo
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@push.rocks/smartcontext',
|
||||
version: '2.2.1',
|
||||
description: 'A module providing advanced asynchronous context management to enrich logs with context and manage scope effectively in Node.js applications.'
|
||||
}
|
18
ts/classes.asynccontext.ts
Normal file
18
ts/classes.asynccontext.ts
Normal file
@ -0,0 +1,18 @@
|
||||
import * as plugins from './plugins.js';
|
||||
import { AsyncStore } from './classes.asyncstore.js';
|
||||
|
||||
export class AsyncContext {
|
||||
private _context = new plugins.simpleAsyncContext.AsyncContext.Variable<AsyncStore>();
|
||||
private _store = new AsyncStore();
|
||||
get store() {
|
||||
return this._context.get() || this._store;
|
||||
}
|
||||
set store(value: AsyncStore) {
|
||||
this._store = value;
|
||||
}
|
||||
public async runScoped(functionArg: () => Promise<void>) {
|
||||
await this._context.run(new AsyncStore(this.store), async () => {
|
||||
await functionArg()
|
||||
});
|
||||
}
|
||||
}
|
135
ts/classes.asyncstore.ts
Normal file
135
ts/classes.asyncstore.ts
Normal file
@ -0,0 +1,135 @@
|
||||
import * as plugins from './plugins.js';
|
||||
|
||||
export class AsyncStore {
|
||||
private static idCounter = 0;
|
||||
private id: number;
|
||||
private parentStore?: AsyncStore;
|
||||
private deletedKeys: string[] = [];
|
||||
private dataObject: { [key: string]: any } = {};
|
||||
|
||||
constructor(parentStore?: AsyncStore) {
|
||||
this.parentStore = parentStore;
|
||||
this.id = AsyncStore.idCounter++;
|
||||
}
|
||||
|
||||
/**
|
||||
* Logs debug info if process.env.DEBUG is set.
|
||||
*/
|
||||
private logDebug(functionName: string, before: Record<string, any>, after: Record<string, any>) {
|
||||
if (typeof process !== 'undefined' && process.env && process.env.DEBUG) {
|
||||
console.log(`Store ID: ${this.id}`);
|
||||
console.log(`Function: ${functionName}`);
|
||||
console.log('--- Before ---');
|
||||
console.log(before);
|
||||
console.log('--- After ---');
|
||||
console.log(after);
|
||||
console.log('-----------------------');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Cleans up the deleted keys if they no longer exist in any parent store.
|
||||
*/
|
||||
private cleanUp() {
|
||||
for (const key of this.deletedKeys) {
|
||||
if (this.parentStore && this.parentStore.get(key)) {
|
||||
// Parent still has it, so keep in deletedKeys
|
||||
} else {
|
||||
const index = this.deletedKeys.indexOf(key);
|
||||
if (index !== -1) {
|
||||
this.deletedKeys.splice(index, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds or updates a value under a specific key in this store.
|
||||
*/
|
||||
public add(keyArg: string, objectArg: any) {
|
||||
// capture the before state
|
||||
const before = { ...this.dataObject, deletedKeys: [...this.deletedKeys] };
|
||||
|
||||
this.cleanUp();
|
||||
// If this key was previously deleted, remove it from deletedKeys.
|
||||
if (this.deletedKeys.includes(keyArg)) {
|
||||
this.deletedKeys = this.deletedKeys.filter((key) => key !== keyArg);
|
||||
}
|
||||
this.dataObject[keyArg] = objectArg;
|
||||
|
||||
// capture the after state
|
||||
const after = { ...this.dataObject, deletedKeys: [...this.deletedKeys] };
|
||||
this.logDebug('add', before, after);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a key from the current store.
|
||||
* If a parent store has the key, we record it in `deletedKeys` so the child store "shadows" it.
|
||||
*/
|
||||
public delete(paramName: string) {
|
||||
// capture the before state
|
||||
const before = { ...this.dataObject, deletedKeys: [...this.deletedKeys] };
|
||||
|
||||
this.cleanUp();
|
||||
if (this.parentStore?.get(paramName)) {
|
||||
// The parent store has this key; let's mark it as deleted in the child
|
||||
this.deletedKeys.push(paramName);
|
||||
}
|
||||
delete this.dataObject[paramName];
|
||||
|
||||
// capture the after state
|
||||
const after = { ...this.dataObject, deletedKeys: [...this.deletedKeys] };
|
||||
this.logDebug('delete', before, after);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of a key, checking this store first, then the parent store if necessary.
|
||||
* Will log the store state before/after for debugging.
|
||||
*/
|
||||
public get(paramName: string) {
|
||||
// capture the before state
|
||||
const before = { ...this.dataObject, deletedKeys: [...this.deletedKeys] };
|
||||
|
||||
this.cleanUp();
|
||||
// figure out if paramName is deleted or present
|
||||
let result: any;
|
||||
if (this.deletedKeys.includes(paramName)) {
|
||||
result = undefined;
|
||||
} else {
|
||||
result = this.dataObject[paramName] ?? this.parentStore?.get(paramName);
|
||||
}
|
||||
|
||||
// capture the after state; we can also show the `result` in the log
|
||||
const after = {
|
||||
...this.dataObject,
|
||||
deletedKeys: [...this.deletedKeys],
|
||||
retrievedKey: paramName,
|
||||
result
|
||||
};
|
||||
this.logDebug('get', before, after);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all keys and values, merged with the parent store, but
|
||||
* does NOT include keys that are "deleted" in the child.
|
||||
* Child store should override parent if the same key exists in both.
|
||||
*/
|
||||
public getAll() {
|
||||
this.cleanUp();
|
||||
// first, get parent's data as a shallow copy
|
||||
const parentData = { ...(this.parentStore?.getAll() || {}) };
|
||||
|
||||
// remove keys from parent data that this child has deleted
|
||||
for (const key of this.deletedKeys) {
|
||||
delete parentData[key];
|
||||
}
|
||||
|
||||
// child's data overrides parent data for any matching keys
|
||||
return {
|
||||
...parentData,
|
||||
...this.dataObject
|
||||
};
|
||||
}
|
||||
}
|
@ -1,3 +1,2 @@
|
||||
import * as plugins from './logcontext.plugins'
|
||||
|
||||
export let standardExport = 'Hi there! :) This is a exported string'
|
||||
export * from './classes.asynccontext.js';
|
||||
export * from './classes.asyncstore.js';
|
@ -1 +0,0 @@
|
||||
import 'typings-global'
|
4
ts/plugins.ts
Normal file
4
ts/plugins.ts
Normal file
@ -0,0 +1,4 @@
|
||||
// third party scope
|
||||
import simpleAsyncContext from 'simple-async-context';
|
||||
|
||||
export { simpleAsyncContext };
|
16
tsconfig.json
Normal file
16
tsconfig.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"experimentalDecorators": true,
|
||||
"useDefineForClassFields": false,
|
||||
"target": "ES2022",
|
||||
"module": "NodeNext",
|
||||
"moduleResolution": "NodeNext",
|
||||
"esModuleInterop": true,
|
||||
"verbatimModuleSyntax": true,
|
||||
"baseUrl": ".",
|
||||
"paths": {}
|
||||
},
|
||||
"exclude": [
|
||||
"dist_*/**/*.d.ts"
|
||||
]
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
{
|
||||
"extends": "tslint-config-standard"
|
||||
}
|
333
yarn.lock
333
yarn.lock
@ -1,333 +0,0 @@
|
||||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
||||
# yarn lockfile v1
|
||||
|
||||
|
||||
"@types/code@^4.0.3":
|
||||
version "4.0.3"
|
||||
resolved "https://registry.yarnpkg.com/@types/code/-/code-4.0.3.tgz#9c4de39f86eb3eba070146d2dab7dbc3f8eac35f"
|
||||
|
||||
"@types/glob@*":
|
||||
version "5.0.33"
|
||||
resolved "https://registry.yarnpkg.com/@types/glob/-/glob-5.0.33.tgz#3dff7c6ce09d65abe919c7961dc3dee016f36ad7"
|
||||
dependencies:
|
||||
"@types/minimatch" "*"
|
||||
"@types/node" "*"
|
||||
|
||||
"@types/minimatch@*":
|
||||
version "3.0.1"
|
||||
resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.1.tgz#b683eb60be358304ef146f5775db4c0e3696a550"
|
||||
|
||||
"@types/node@*", "@types/node@^8.0.33":
|
||||
version "8.0.34"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.34.tgz#55f801fa2ddb2a40dd6dfc15ecfe1dde9c129fe9"
|
||||
|
||||
"@types/shelljs@^0.7.4":
|
||||
version "0.7.4"
|
||||
resolved "https://registry.yarnpkg.com/@types/shelljs/-/shelljs-0.7.4.tgz#137b5f31306eaff4de120ffe5b9d74b297809cfc"
|
||||
dependencies:
|
||||
"@types/glob" "*"
|
||||
"@types/node" "*"
|
||||
|
||||
"@types/which@^1.0.28":
|
||||
version "1.0.28"
|
||||
resolved "https://registry.yarnpkg.com/@types/which/-/which-1.0.28.tgz#016e387629b8817bed653fe32eab5d11279c8df6"
|
||||
|
||||
ansi-256-colors@^1.1.0:
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/ansi-256-colors/-/ansi-256-colors-1.1.0.tgz#910de50efcc7c09e3d82f2f87abd6b700c18818a"
|
||||
|
||||
balanced-match@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"
|
||||
|
||||
beautycolor@^1.0.7:
|
||||
version "1.0.11"
|
||||
resolved "https://registry.yarnpkg.com/beautycolor/-/beautycolor-1.0.11.tgz#71c5568d5a7ed5c144d3a54f753ad1b08862aea5"
|
||||
dependencies:
|
||||
ansi-256-colors "^1.1.0"
|
||||
typings-global "^1.0.14"
|
||||
|
||||
bindings@^1.2.1:
|
||||
version "1.3.0"
|
||||
resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.3.0.tgz#b346f6ecf6a95f5a815c5839fc7cdb22502f1ed7"
|
||||
|
||||
brace-expansion@^1.1.7:
|
||||
version "1.1.8"
|
||||
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.8.tgz#c07b211c7c952ec1f8efd51a77ef0d1d3990a292"
|
||||
dependencies:
|
||||
balanced-match "^1.0.0"
|
||||
concat-map "0.0.1"
|
||||
|
||||
code@^5.1.0:
|
||||
version "5.1.0"
|
||||
resolved "https://registry.yarnpkg.com/code/-/code-5.1.0.tgz#205e4213536c3cf21b12194384901fadcd81bc1a"
|
||||
dependencies:
|
||||
hoek "4.x.x"
|
||||
|
||||
concat-map@0.0.1:
|
||||
version "0.0.1"
|
||||
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
|
||||
|
||||
define-properties@^1.1.2:
|
||||
version "1.1.2"
|
||||
resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.2.tgz#83a73f2fea569898fb737193c8f873caf6d45c94"
|
||||
dependencies:
|
||||
foreach "^2.0.5"
|
||||
object-keys "^1.0.8"
|
||||
|
||||
early@^2.1.1:
|
||||
version "2.1.1"
|
||||
resolved "https://registry.yarnpkg.com/early/-/early-2.1.1.tgz#841e23254ea5dc54d8afaeee82f5ab65c00ee23c"
|
||||
dependencies:
|
||||
beautycolor "^1.0.7"
|
||||
smartq "^1.1.1"
|
||||
typings-global "^1.0.16"
|
||||
|
||||
es-abstract@^1.5.1:
|
||||
version "1.9.0"
|
||||
resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.9.0.tgz#690829a07cae36b222e7fd9b75c0d0573eb25227"
|
||||
dependencies:
|
||||
es-to-primitive "^1.1.1"
|
||||
function-bind "^1.1.1"
|
||||
has "^1.0.1"
|
||||
is-callable "^1.1.3"
|
||||
is-regex "^1.0.4"
|
||||
|
||||
es-to-primitive@^1.1.1:
|
||||
version "1.1.1"
|
||||
resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.1.1.tgz#45355248a88979034b6792e19bb81f2b7975dd0d"
|
||||
dependencies:
|
||||
is-callable "^1.1.1"
|
||||
is-date-object "^1.0.1"
|
||||
is-symbol "^1.0.1"
|
||||
|
||||
es6-error@^4.0.2:
|
||||
version "4.0.2"
|
||||
resolved "https://registry.yarnpkg.com/es6-error/-/es6-error-4.0.2.tgz#eec5c726eacef51b7f6b73c20db6e1b13b069c98"
|
||||
|
||||
foreach@^2.0.5:
|
||||
version "2.0.5"
|
||||
resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99"
|
||||
|
||||
fs.realpath@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
|
||||
|
||||
function-bind@^1.0.2, function-bind@^1.1.1:
|
||||
version "1.1.1"
|
||||
resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d"
|
||||
|
||||
glob@^7.0.0:
|
||||
version "7.1.2"
|
||||
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15"
|
||||
dependencies:
|
||||
fs.realpath "^1.0.0"
|
||||
inflight "^1.0.4"
|
||||
inherits "2"
|
||||
minimatch "^3.0.4"
|
||||
once "^1.3.0"
|
||||
path-is-absolute "^1.0.0"
|
||||
|
||||
has@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/has/-/has-1.0.1.tgz#8461733f538b0837c9361e39a9ab9e9704dc2f28"
|
||||
dependencies:
|
||||
function-bind "^1.0.2"
|
||||
|
||||
hoek@4.x.x:
|
||||
version "4.2.0"
|
||||
resolved "https://registry.yarnpkg.com/hoek/-/hoek-4.2.0.tgz#72d9d0754f7fe25ca2d01ad8f8f9a9449a89526d"
|
||||
|
||||
inflight@^1.0.4:
|
||||
version "1.0.6"
|
||||
resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
|
||||
dependencies:
|
||||
once "^1.3.0"
|
||||
wrappy "1"
|
||||
|
||||
inherits@2:
|
||||
version "2.0.3"
|
||||
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
|
||||
|
||||
interpret@^1.0.0:
|
||||
version "1.0.4"
|
||||
resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.0.4.tgz#820cdd588b868ffb191a809506d6c9c8f212b1b0"
|
||||
|
||||
is-callable@^1.1.1, is-callable@^1.1.3:
|
||||
version "1.1.3"
|
||||
resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.3.tgz#86eb75392805ddc33af71c92a0eedf74ee7604b2"
|
||||
|
||||
is-date-object@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16"
|
||||
|
||||
is-regex@^1.0.4:
|
||||
version "1.0.4"
|
||||
resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491"
|
||||
dependencies:
|
||||
has "^1.0.1"
|
||||
|
||||
is-symbol@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.1.tgz#3cc59f00025194b6ab2e38dbae6689256b660572"
|
||||
|
||||
isexe@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10"
|
||||
|
||||
leakage@^0.3.0:
|
||||
version "0.3.0"
|
||||
resolved "https://registry.yarnpkg.com/leakage/-/leakage-0.3.0.tgz#15d698abdc76bbc6439601f4f3020e77e2d50c39"
|
||||
dependencies:
|
||||
es6-error "^4.0.2"
|
||||
left-pad "^1.1.3"
|
||||
memwatch-next "^0.3.0"
|
||||
minimist "^1.2.0"
|
||||
pretty-bytes "^4.0.2"
|
||||
|
||||
left-pad@^1.1.3:
|
||||
version "1.1.3"
|
||||
resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.1.3.tgz#612f61c033f3a9e08e939f1caebeea41b6f3199a"
|
||||
|
||||
memwatch-next@^0.3.0:
|
||||
version "0.3.0"
|
||||
resolved "https://registry.yarnpkg.com/memwatch-next/-/memwatch-next-0.3.0.tgz#2111050f9a906e0aa2d72a4ec0f0089c78726f8f"
|
||||
dependencies:
|
||||
bindings "^1.2.1"
|
||||
nan "^2.3.2"
|
||||
|
||||
minimatch@^3.0.4:
|
||||
version "3.0.4"
|
||||
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
|
||||
dependencies:
|
||||
brace-expansion "^1.1.7"
|
||||
|
||||
minimist@^1.2.0:
|
||||
version "1.2.0"
|
||||
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284"
|
||||
|
||||
nan@^2.3.2:
|
||||
version "2.7.0"
|
||||
resolved "https://registry.yarnpkg.com/nan/-/nan-2.7.0.tgz#d95bf721ec877e08db276ed3fc6eb78f9083ad46"
|
||||
|
||||
object-keys@^1.0.8:
|
||||
version "1.0.11"
|
||||
resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.11.tgz#c54601778ad560f1142ce0e01bcca8b56d13426d"
|
||||
|
||||
object.getownpropertydescriptors@^2.0.3:
|
||||
version "2.0.3"
|
||||
resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz#8758c846f5b407adab0f236e0986f14b051caa16"
|
||||
dependencies:
|
||||
define-properties "^1.1.2"
|
||||
es-abstract "^1.5.1"
|
||||
|
||||
once@^1.3.0:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
|
||||
dependencies:
|
||||
wrappy "1"
|
||||
|
||||
path-is-absolute@^1.0.0:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
|
||||
|
||||
path-parse@^1.0.5:
|
||||
version "1.0.5"
|
||||
resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1"
|
||||
|
||||
pretty-bytes@^4.0.2:
|
||||
version "4.0.2"
|
||||
resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-4.0.2.tgz#b2bf82e7350d65c6c33aa95aaa5a4f6327f61cd9"
|
||||
|
||||
rechoir@^0.6.2:
|
||||
version "0.6.2"
|
||||
resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384"
|
||||
dependencies:
|
||||
resolve "^1.1.6"
|
||||
|
||||
resolve@^1.1.6:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.4.0.tgz#a75be01c53da25d934a98ebd0e4c4a7312f92a86"
|
||||
dependencies:
|
||||
path-parse "^1.0.5"
|
||||
|
||||
semver@^5.3.0:
|
||||
version "5.4.1"
|
||||
resolved "https://registry.yarnpkg.com/semver/-/semver-5.4.1.tgz#e059c09d8571f0540823733433505d3a2f00b18e"
|
||||
|
||||
shelljs@^0.7.8:
|
||||
version "0.7.8"
|
||||
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.8.tgz#decbcf874b0d1e5fb72e14b164a9683048e9acb3"
|
||||
dependencies:
|
||||
glob "^7.0.0"
|
||||
interpret "^1.0.0"
|
||||
rechoir "^0.6.2"
|
||||
|
||||
smartchai@^1.0.3:
|
||||
version "1.0.8"
|
||||
resolved "https://registry.yarnpkg.com/smartchai/-/smartchai-1.0.8.tgz#a074836f4ddd4b98c50f1e7ae9e8e8ad9f6f1902"
|
||||
dependencies:
|
||||
"@types/code" "^4.0.3"
|
||||
code "^5.1.0"
|
||||
typings-global "^1.0.20"
|
||||
|
||||
smartdelay@^1.0.3:
|
||||
version "1.0.4"
|
||||
resolved "https://registry.yarnpkg.com/smartdelay/-/smartdelay-1.0.4.tgz#791c1a4ee6770494064c10b1d2d2b8e6f3105b82"
|
||||
dependencies:
|
||||
smartq "^1.1.1"
|
||||
typings-global "^1.0.16"
|
||||
|
||||
smartq@^1.1.1, smartq@^1.1.6:
|
||||
version "1.1.6"
|
||||
resolved "https://registry.yarnpkg.com/smartq/-/smartq-1.1.6.tgz#0c1ff4336d95e95b4f1fdd8ccd7e2c5a323b8412"
|
||||
dependencies:
|
||||
typings-global "^1.0.19"
|
||||
util.promisify "^1.0.0"
|
||||
|
||||
smartshell@^1.0.6:
|
||||
version "1.0.18"
|
||||
resolved "https://registry.yarnpkg.com/smartshell/-/smartshell-1.0.18.tgz#b84ccc65cedf3a875bf676cec78ee07f4b4aa9e5"
|
||||
dependencies:
|
||||
"@types/shelljs" "^0.7.4"
|
||||
"@types/which" "^1.0.28"
|
||||
shelljs "^0.7.8"
|
||||
smartq "^1.1.6"
|
||||
typings-global "^1.0.20"
|
||||
which "^1.3.0"
|
||||
|
||||
tapbundle@^1.0.13:
|
||||
version "1.1.8"
|
||||
resolved "https://registry.yarnpkg.com/tapbundle/-/tapbundle-1.1.8.tgz#e08aee0e100a830d8a26a583a85d37ce53312e02"
|
||||
dependencies:
|
||||
"@types/node" "^8.0.33"
|
||||
early "^2.1.1"
|
||||
leakage "^0.3.0"
|
||||
smartchai "^1.0.3"
|
||||
smartdelay "^1.0.3"
|
||||
smartq "^1.1.1"
|
||||
typings-global "^1.0.19"
|
||||
|
||||
typings-global@^1.0.14, typings-global@^1.0.16, typings-global@^1.0.19, typings-global@^1.0.20:
|
||||
version "1.0.20"
|
||||
resolved "https://registry.yarnpkg.com/typings-global/-/typings-global-1.0.20.tgz#3da769c54db538247c5d877d1d9e97eb2ec981ff"
|
||||
dependencies:
|
||||
semver "^5.3.0"
|
||||
smartshell "^1.0.6"
|
||||
|
||||
util.promisify@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/util.promisify/-/util.promisify-1.0.0.tgz#440f7165a459c9a16dc145eb8e72f35687097030"
|
||||
dependencies:
|
||||
define-properties "^1.1.2"
|
||||
object.getownpropertydescriptors "^2.0.3"
|
||||
|
||||
which@^1.3.0:
|
||||
version "1.3.0"
|
||||
resolved "https://registry.yarnpkg.com/which/-/which-1.3.0.tgz#ff04bdfc010ee547d780bec38e1ac1c2777d253a"
|
||||
dependencies:
|
||||
isexe "^2.0.0"
|
||||
|
||||
wrappy@1:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
|
Loading…
x
Reference in New Issue
Block a user