Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@fluidframework/garbage-collector

Package Overview
Dependencies
Maintainers
3
Versions
340
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fluidframework/garbage-collector - npm Package Compare versions

Comparing version 0.34.1 to 0.35.0-16170

2

dist/packageVersion.d.ts

@@ -8,3 +8,3 @@ /*!

export declare const pkgName = "@fluidframework/garbage-collector";
export declare const pkgVersion = "0.34.1";
export declare const pkgVersion = "0.35.0-16170";
//# sourceMappingURL=packageVersion.d.ts.map

@@ -11,3 +11,3 @@ "use strict";

exports.pkgName = "@fluidframework/garbage-collector";
exports.pkgVersion = "0.34.1";
exports.pkgVersion = "0.35.0-16170";
//# sourceMappingURL=packageVersion.js.map

@@ -13,3 +13,3 @@ /*!

/**
* Helper function that generates the used routes of the children from a given node's used routes.
* Helper function that generates the used routes of children from a given node's used routes.
* @param usedRoutes - The used routes of a node.

@@ -19,2 +19,16 @@ * @returns A map of used routes of each children of the the given node.

export declare function getChildNodesUsedRoutes(usedRoutes: string[]): Map<string, string[]>;
/**
* Helper function that generates the GC data of children from a given node's GC data.
* @param gcData - The GC data of a node.
* @returns A map of GC data of each children of the the given node.
*/
export declare function getChildNodesGCData(gcData: IGarbageCollectionData): Map<string, IGarbageCollectionData>;
/**
* Removes the given route from the outbound routes of all the given GC nodes.
* @param gcNodes - The nodes from which the route is to be removed.
* @param outboundRoute - The route to be removed.
*/
export declare function removeRouteFromAllNodes(gcNodes: {
[id: string]: string[];
}, outboundRoute: string): void;
export declare class GCDataBuilder implements IGarbageCollectionData {

@@ -21,0 +35,0 @@ readonly gcNodes: {

@@ -7,3 +7,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.GCDataBuilder = exports.getChildNodesUsedRoutes = exports.cloneGCData = void 0;
exports.GCDataBuilder = exports.removeRouteFromAllNodes = exports.getChildNodesGCData = exports.getChildNodesUsedRoutes = exports.cloneGCData = void 0;
const common_utils_1 = require("@fluidframework/common-utils");

@@ -26,3 +26,3 @@ /**

/**
* Helper function that generates the used routes of the children from a given node's used routes.
* Helper function that generates the used routes of children from a given node's used routes.
* @param usedRoutes - The used routes of a node.

@@ -32,3 +32,3 @@ * @returns A map of used routes of each children of the the given node.

function getChildNodesUsedRoutes(usedRoutes) {
const usedNodesRoutes = new Map();
const childUsedRoutesMap = new Map();
for (const route of usedRoutes) {

@@ -38,3 +38,3 @@ common_utils_1.assert(route.startsWith("/"), "Used route should always be an absolute route");

const childUsedRoute = route.slice(childId.length + 1);
const childUsedRoutes = usedNodesRoutes.get(childId);
const childUsedRoutes = childUsedRoutesMap.get(childId);
if (childUsedRoutes !== undefined) {

@@ -44,8 +44,50 @@ childUsedRoutes.push(childUsedRoute);

else {
usedNodesRoutes.set(childId, [childUsedRoute]);
childUsedRoutesMap.set(childId, [childUsedRoute]);
}
}
return usedNodesRoutes;
return childUsedRoutesMap;
}
exports.getChildNodesUsedRoutes = getChildNodesUsedRoutes;
/**
* Helper function that generates the GC data of children from a given node's GC data.
* @param gcData - The GC data of a node.
* @returns A map of GC data of each children of the the given node.
*/
function getChildNodesGCData(gcData) {
const childGCDataMap = new Map();
for (const [id, outboundRoutes] of Object.entries(gcData.gcNodes)) {
common_utils_1.assert(id.startsWith("/"), "id should always be an absolute route");
const childId = id.split("/")[1];
let childGCNodeId = id.slice(childId.length + 1);
// GC node id always begins with "/". Handle the special case where the id in parent's GC nodes is of the
// for `/root`. This would make `childId=root` and `childGCNodeId=""`.
if (childGCNodeId === "") {
childGCNodeId = "/";
}
// Create a copy of the outbound routes array in the parents GC data.
const childOutboundRoutes = Array.from(outboundRoutes);
let childGCData = childGCDataMap.get(childId);
if (childGCData === undefined) {
childGCData = { gcNodes: {} };
}
childGCData.gcNodes[childGCNodeId] = childOutboundRoutes;
childGCDataMap.set(childId, childGCData);
}
return childGCDataMap;
}
exports.getChildNodesGCData = getChildNodesGCData;
/**
* Removes the given route from the outbound routes of all the given GC nodes.
* @param gcNodes - The nodes from which the route is to be removed.
* @param outboundRoute - The route to be removed.
*/
function removeRouteFromAllNodes(gcNodes, outboundRoute) {
for (const outboundRoutes of Object.values(gcNodes)) {
const index = outboundRoutes.indexOf(outboundRoute);
if (index > -1) {
outboundRoutes.splice(index, 1);
}
}
}
exports.removeRouteFromAllNodes = removeRouteFromAllNodes;
class GCDataBuilder {

@@ -52,0 +94,0 @@ constructor() {

@@ -8,3 +8,3 @@ /*!

export declare const pkgName = "@fluidframework/garbage-collector";
export declare const pkgVersion = "0.34.1";
export declare const pkgVersion = "0.35.0-16170";
//# sourceMappingURL=packageVersion.d.ts.map

@@ -8,3 +8,3 @@ /*!

export const pkgName = "@fluidframework/garbage-collector";
export const pkgVersion = "0.34.1";
export const pkgVersion = "0.35.0-16170";
//# sourceMappingURL=packageVersion.js.map

@@ -13,3 +13,3 @@ /*!

/**
* Helper function that generates the used routes of the children from a given node's used routes.
* Helper function that generates the used routes of children from a given node's used routes.
* @param usedRoutes - The used routes of a node.

@@ -19,2 +19,16 @@ * @returns A map of used routes of each children of the the given node.

export declare function getChildNodesUsedRoutes(usedRoutes: string[]): Map<string, string[]>;
/**
* Helper function that generates the GC data of children from a given node's GC data.
* @param gcData - The GC data of a node.
* @returns A map of GC data of each children of the the given node.
*/
export declare function getChildNodesGCData(gcData: IGarbageCollectionData): Map<string, IGarbageCollectionData>;
/**
* Removes the given route from the outbound routes of all the given GC nodes.
* @param gcNodes - The nodes from which the route is to be removed.
* @param outboundRoute - The route to be removed.
*/
export declare function removeRouteFromAllNodes(gcNodes: {
[id: string]: string[];
}, outboundRoute: string): void;
export declare class GCDataBuilder implements IGarbageCollectionData {

@@ -21,0 +35,0 @@ readonly gcNodes: {

@@ -21,3 +21,3 @@ /*!

/**
* Helper function that generates the used routes of the children from a given node's used routes.
* Helper function that generates the used routes of children from a given node's used routes.
* @param usedRoutes - The used routes of a node.

@@ -27,3 +27,3 @@ * @returns A map of used routes of each children of the the given node.

export function getChildNodesUsedRoutes(usedRoutes) {
const usedNodesRoutes = new Map();
const childUsedRoutesMap = new Map();
for (const route of usedRoutes) {

@@ -33,3 +33,3 @@ assert(route.startsWith("/"), "Used route should always be an absolute route");

const childUsedRoute = route.slice(childId.length + 1);
const childUsedRoutes = usedNodesRoutes.get(childId);
const childUsedRoutes = childUsedRoutesMap.get(childId);
if (childUsedRoutes !== undefined) {

@@ -39,7 +39,47 @@ childUsedRoutes.push(childUsedRoute);

else {
usedNodesRoutes.set(childId, [childUsedRoute]);
childUsedRoutesMap.set(childId, [childUsedRoute]);
}
}
return usedNodesRoutes;
return childUsedRoutesMap;
}
/**
* Helper function that generates the GC data of children from a given node's GC data.
* @param gcData - The GC data of a node.
* @returns A map of GC data of each children of the the given node.
*/
export function getChildNodesGCData(gcData) {
const childGCDataMap = new Map();
for (const [id, outboundRoutes] of Object.entries(gcData.gcNodes)) {
assert(id.startsWith("/"), "id should always be an absolute route");
const childId = id.split("/")[1];
let childGCNodeId = id.slice(childId.length + 1);
// GC node id always begins with "/". Handle the special case where the id in parent's GC nodes is of the
// for `/root`. This would make `childId=root` and `childGCNodeId=""`.
if (childGCNodeId === "") {
childGCNodeId = "/";
}
// Create a copy of the outbound routes array in the parents GC data.
const childOutboundRoutes = Array.from(outboundRoutes);
let childGCData = childGCDataMap.get(childId);
if (childGCData === undefined) {
childGCData = { gcNodes: {} };
}
childGCData.gcNodes[childGCNodeId] = childOutboundRoutes;
childGCDataMap.set(childId, childGCData);
}
return childGCDataMap;
}
/**
* Removes the given route from the outbound routes of all the given GC nodes.
* @param gcNodes - The nodes from which the route is to be removed.
* @param outboundRoute - The route to be removed.
*/
export function removeRouteFromAllNodes(gcNodes, outboundRoute) {
for (const outboundRoutes of Object.values(gcNodes)) {
const index = outboundRoutes.indexOf(outboundRoute);
if (index > -1) {
outboundRoutes.splice(index, 1);
}
}
}
export class GCDataBuilder {

@@ -46,0 +86,0 @@ constructor() {

{
"name": "@fluidframework/garbage-collector",
"version": "0.34.1",
"version": "0.35.0-16170",
"description": "Garbage Collector implementation for Fluid",

@@ -63,8 +63,8 @@ "homepage": "https://fluidframework.com",

"@fluidframework/common-utils": "^0.27.0",
"@fluidframework/runtime-definitions": "^0.34.1"
"@fluidframework/runtime-definitions": "0.35.0-16170"
},
"devDependencies": {
"@fluidframework/build-common": "^0.20.0",
"@fluidframework/eslint-config-fluid": "^0.22.1",
"@fluidframework/mocha-test-setup": "^0.34.1",
"@fluidframework/build-common": "^0.20.0-0",
"@fluidframework/eslint-config-fluid": "^0.22.1-0",
"@fluidframework/mocha-test-setup": "0.35.0-16170",
"@microsoft/api-extractor": "^7.7.2",

@@ -71,0 +71,0 @@ "@types/assert": "^1.5.2",

@@ -9,2 +9,2 @@ /*!

export const pkgName = "@fluidframework/garbage-collector";
export const pkgVersion = "0.34.1";
export const pkgVersion = "0.35.0-16170";

@@ -25,3 +25,3 @@ /*!

/**
* Helper function that generates the used routes of the children from a given node's used routes.
* Helper function that generates the used routes of children from a given node's used routes.
* @param usedRoutes - The used routes of a node.

@@ -31,3 +31,3 @@ * @returns A map of used routes of each children of the the given node.

export function getChildNodesUsedRoutes(usedRoutes: string[]) {
const usedNodesRoutes: Map<string, string[]> = new Map();
const childUsedRoutesMap: Map<string, string[]> = new Map();
for (const route of usedRoutes) {

@@ -38,12 +38,56 @@ assert(route.startsWith("/"), "Used route should always be an absolute route");

const childUsedRoutes = usedNodesRoutes.get(childId);
const childUsedRoutes = childUsedRoutesMap.get(childId);
if (childUsedRoutes !== undefined) {
childUsedRoutes.push(childUsedRoute);
} else {
usedNodesRoutes.set(childId, [ childUsedRoute ]);
childUsedRoutesMap.set(childId, [ childUsedRoute ]);
}
}
return usedNodesRoutes;
return childUsedRoutesMap;
}
/**
* Helper function that generates the GC data of children from a given node's GC data.
* @param gcData - The GC data of a node.
* @returns A map of GC data of each children of the the given node.
*/
export function getChildNodesGCData(gcData: IGarbageCollectionData) {
const childGCDataMap: Map<string, IGarbageCollectionData> = new Map();
for (const [id, outboundRoutes] of Object.entries(gcData.gcNodes)) {
assert(id.startsWith("/"), "id should always be an absolute route");
const childId = id.split("/")[1];
let childGCNodeId = id.slice(childId.length + 1);
// GC node id always begins with "/". Handle the special case where the id in parent's GC nodes is of the
// for `/root`. This would make `childId=root` and `childGCNodeId=""`.
if (childGCNodeId === "") {
childGCNodeId = "/";
}
// Create a copy of the outbound routes array in the parents GC data.
const childOutboundRoutes = Array.from(outboundRoutes);
let childGCData = childGCDataMap.get(childId);
if (childGCData === undefined) {
childGCData = { gcNodes: {} };
}
childGCData.gcNodes[childGCNodeId] = childOutboundRoutes;
childGCDataMap.set(childId, childGCData);
}
return childGCDataMap;
}
/**
* Removes the given route from the outbound routes of all the given GC nodes.
* @param gcNodes - The nodes from which the route is to be removed.
* @param outboundRoute - The route to be removed.
*/
export function removeRouteFromAllNodes(gcNodes: { [ id: string ]: string[] }, outboundRoute: string) {
for (const outboundRoutes of Object.values(gcNodes)) {
const index = outboundRoutes.indexOf(outboundRoute);
if (index > -1) {
outboundRoutes.splice(index, 1);
}
}
}
export class GCDataBuilder implements IGarbageCollectionData {

@@ -50,0 +94,0 @@ public readonly gcNodes: { [ id: string ]: string[] } = {};

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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