New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@rushstack/lookup-by-path

Package Overview
Dependencies
Maintainers
0
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rushstack/lookup-by-path - npm Package Compare versions

Comparing version 0.2.5 to 0.3.0

12

CHANGELOG.json

@@ -5,2 +5,14 @@ {

{
"version": "0.3.0",
"tag": "@rushstack/lookup-by-path_v0.3.0",
"date": "Thu, 03 Oct 2024 15:11:00 GMT",
"comments": {
"minor": [
{
"comment": "Allow for a map of file paths to arbitrary info to be grouped by the nearest entry in the LookupByPath trie"
}
]
}
},
{
"version": "0.2.5",

@@ -7,0 +19,0 @@ "tag": "@rushstack/lookup-by-path_v0.2.5",

9

CHANGELOG.md
# Change Log - @rushstack/lookup-by-path
This log was last generated on Wed, 02 Oct 2024 00:11:19 GMT and should not be manually modified.
This log was last generated on Thu, 03 Oct 2024 15:11:00 GMT and should not be manually modified.
## 0.3.0
Thu, 03 Oct 2024 15:11:00 GMT
### Minor changes
- Allow for a map of file paths to arbitrary info to be grouped by the nearest entry in the LookupByPath trie
## 0.2.5

@@ -6,0 +13,0 @@ Wed, 02 Oct 2024 00:11:19 GMT

@@ -131,2 +131,11 @@ /**

/**
* Groups the provided map of info by the nearest entry in the trie that contains the path. If the path
* is not found in the trie, the info is ignored.
*
* @returns The grouped info, grouped by the nearest entry in the trie that contains the path
*
* @param infoByPath - The info to be grouped, keyed by path
*/
groupByChild<TInfo>(infoByPath: Map<string, TInfo>): Map<TItem, Map<string, TInfo>>;
/**
* Iterates through progressively longer prefixes of a given string and returns as soon

@@ -133,0 +142,0 @@ * as the number of candidate items that match the prefix are 1 or 0.

@@ -124,2 +124,11 @@ /**

/**
* Groups the provided map of info by the nearest entry in the trie that contains the path. If the path
* is not found in the trie, the info is ignored.
*
* @returns The grouped info, grouped by the nearest entry in the trie that contains the path
*
* @param infoByPath - The info to be grouped, keyed by path
*/
groupByChild<TInfo>(infoByPath: Map<string, TInfo>): Map<TItem, Map<string, TInfo>>;
/**
* Iterates through progressively longer prefixes of a given string and returns as soon

@@ -126,0 +135,0 @@ * as the number of candidate items that match the prefix are 1 or 0.

@@ -181,2 +181,26 @@ "use strict";

/**
* Groups the provided map of info by the nearest entry in the trie that contains the path. If the path
* is not found in the trie, the info is ignored.
*
* @returns The grouped info, grouped by the nearest entry in the trie that contains the path
*
* @param infoByPath - The info to be grouped, keyed by path
*/
groupByChild(infoByPath) {
const groupedInfoByChild = new Map();
for (const [path, info] of infoByPath) {
const child = this.findChildPath(path);
if (child === undefined) {
continue;
}
let groupedInfo = groupedInfoByChild.get(child);
if (!groupedInfo) {
groupedInfo = new Map();
groupedInfoByChild.set(child, groupedInfo);
}
groupedInfo.set(path, info);
}
return groupedInfoByChild;
}
/**
* Iterates through progressively longer prefixes of a given string and returns as soon

@@ -183,0 +207,0 @@ * as the number of candidate items that match the prefix are 1 or 0.

2

package.json
{
"name": "@rushstack/lookup-by-path",
"version": "0.2.5",
"version": "0.3.0",
"description": "Strongly typed trie data structure for path and URL-like strings.",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc