Socket
Socket
Sign inDemoInstall

pinelab-storefront-client

Package Overview
Dependencies
Maintainers
1
Versions
84
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pinelab-storefront-client - npm Package Compare versions

Comparing version 0.42.1 to 0.42.2

10

lib/gridsome/gridsome.service.d.ts

@@ -23,2 +23,12 @@ import {

getAvailableCountries(): Promise<Country[]>;
/**
* By default the collection graphql query returns all child and parent collections in one flat array.
* This function sets the correct childCollections for each topLevel collection.
* @param allCollections
*/
unflatten(allCollections: Collection[]): Collection[];
/**
* Recursively gets childCollections for given collection
*/
private getChildCollection;
}

@@ -285,4 +285,65 @@ 'use strict';

};
/**
* By default the collection graphql query returns all child and parent collections in one flat array.
* This function sets the correct childCollections for each topLevel collection.
* @param allCollections
*/
GridsomeService.prototype.unflatten = function (allCollections) {
var _this = this;
// Get toplevel collections
var collections = allCollections.filter(function (col) {
var _a;
return (
((_a = col.parent) === null || _a === void 0 ? void 0 : _a.name) ===
'__root_collection__'
);
});
// Find and set child collections, because queried children only have id and name fields
return collections.map(function (collection) {
return _this.getChildCollection(collection, allCollections);
});
};
/**
* Recursively gets childCollections for given collection
*/
GridsomeService.prototype.getChildCollection = function (
collection,
allCollections
) {
var _this = this;
var _a;
var fullChildren =
(_a = collection.children) === null || _a === void 0
? void 0
: _a.map(function (originalChild) {
var _a;
var fullChildCollection = allCollections.find(function (c) {
return c.id === originalChild.id;
});
if (!fullChildCollection) {
throw Error(
'Child collection ' +
originalChild.name +
' is not in allCollections list'
);
}
if (
(_a =
fullChildCollection === null || fullChildCollection === void 0
? void 0
: fullChildCollection.children) === null || _a === void 0
? void 0
: _a.length
) {
fullChildCollection = _this.getChildCollection(
fullChildCollection,
allCollections
);
}
return fullChildCollection;
});
return __assign(__assign({}, collection), { children: fullChildren });
};
return GridsomeService;
})();
exports.GridsomeService = GridsomeService;

4

package.json
{
"name": "pinelab-storefront-client",
"version": "0.42.1",
"version": "0.42.2",
"description": "Generates static html pages with Gridsome and suplied Vue components",

@@ -46,3 +46,3 @@ "author": "Martijn van de Brug <martijn@pinelab.studio>",

},
"gitHead": "f5ba163547842343d6e276db41b1622e66955f7c"
"gitHead": "eb67ccdb7059214f9e2a59658486667291094b80"
}
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