Product
Introducing Enhanced Alert Actions and Triage Functionality
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
@es-git/path-to-object-mixin
Advanced tools
This is part of the [ES-Git](https://github.com/es-git/es-git) project.
Readme
This is part of the ES-Git project.
npm install --save @es-git/path-to-object-mixin
Mix this in with an IObjectRepo.
This mixin makes it easier to load an object from a commit by path. Provide the hash of the tree and the path, either as a string or as an array of string segments. It returns either a tree, a blob or, if nothing is found, undefined.
import objectsMixin from '@es-git/objects-mixin';
import pathToObject from '@es-git/path-to-object-mixin';
import MemoryRepo from '@es-git/memory-repo';
const Repo = mix(MemoryRepo)
.with(objectsMixin)
.with(pathToObject);
const repo = new Repo();
const object = await repo.loadObjectByPath(hash, 'folder/directory/file.txt');
const object = await repo.loadObjectByPath(hash, ['folder', 'directory', 'file.txt']);
const content = await repo.loadTextByPath(hash, ['folder', 'directory', 'file.txt']);
interface IPathToObjectRepo {
loadObjectByPath(rootTree : Hash, path : string | string[]) : Promise<TreeObject | BlobObject | undefined>
loadBlobByPath(rootTree : Hash, path : string | string[]) : Promise<Uint8Array | undefined>
loadTextByPath(rootTree : Hash, path : string | string[]) : Promise<string | undefined>
}
type Hash = string;
type BlobObject = {
readonly type : Type.blob
readonly body : Uint8Array
}
type TreeObject = {
readonly type : Type.tree
readonly body : TreeBody
}
type TreeBody = {
[key : string] : ModeHash
}
type ModeHash = {
readonly mode : Mode
readonly hash : string
}
FAQs
This is part of the [ES-Git](https://github.com/es-git/es-git) project.
The npm package @es-git/path-to-object-mixin receives a total of 0 weekly downloads. As such, @es-git/path-to-object-mixin popularity was classified as not popular.
We found that @es-git/path-to-object-mixin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.