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

quintype-backend

Package Overview
Dependencies
Maintainers
7
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

quintype-backend - npm Package Compare versions

Comparing version 1.4.1 to 1.5.0

collection-loader.js

35

index.js
'use strict';
var rp = require('request-promise');
var Promise = require("bluebird");
var _ = require("lodash");
const rp = require('request-promise');
const Promise = require("bluebird");
const _ = require("lodash");
const {loadNestedCollectionData} = require("./collection-loader");
const { DEFAULT_DEPTH } = require("./constants");
function wrapBuildFunction(clazz, upstream) {
clazz.build = function() {
if(!arguments[0])
return null;
return new Proxy(new clazz(...arguments), {

@@ -113,6 +118,10 @@ get: function(target, key) {

static getCollectionBySlug(client, slug, params) {
static getCollectionBySlug(client, slug, params, options = {}) {
const {depth = DEFAULT_DEPTH} = options;
return client
.getCollectionBySlug(slug, params)
.then(response => response && Collection.build(response["collection"] || response));
.then(response => {
const collection = response ? response["collection"] || response : null;
return collection && loadNestedCollectionData(client, collection, {depth})
}).then(collection => Collection.build(collection))
}

@@ -180,2 +189,8 @@ }

function catch404(e, defaultValue) {
if(e && e.statusCode == 404)
return defaultValue;
throw e;
}
class Client {

@@ -218,3 +233,3 @@ constructor(baseUrl, temporaryClient) {

json: true
})
}).catch(e => catch404(e, {}))
}

@@ -228,3 +243,3 @@

json: true
})
}).catch(e => catch404(e, null))
}

@@ -247,3 +262,3 @@

json: true
});
}).catch(e => catch404(e, {}));
}

@@ -256,3 +271,3 @@

json: true
});
}).catch(e => catch404(e, {}));
}

@@ -285,3 +300,3 @@

json: true
});
}).catch(e => catch404(e, {}));
}

@@ -288,0 +303,0 @@

{
"name": "quintype-backend",
"version": "1.4.1",
"version": "1.5.0",
"description": "client for accessing quintype API",
"main": "index.js",
"scripts": {
"prepublishOnly": "npm install && git diff --quiet && git tag v$(cat package.json | grep version | head -n1 | cut -d \\\" -f 4) && git push --tags origin master"
},

@@ -23,6 +23,6 @@ "repository": {

"dependencies": {
"lodash": "^3.10.1",
"request": "^2.74.0",
"lodash": "^4.17.10",
"request": "^2.85.0",
"request-promise": "^4.1.1"
}
}
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