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

admin-config

Package Overview
Dependencies
Maintainers
3
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

admin-config - npm Package Compare versions

Comparing version 0.2.18 to 0.2.19

lib/Utils/ReferenceExtractor.js

13

lib/Field/ReferencedListField.js
import ReferenceField from "./ReferenceField";
import ReferenceExtractor from '../Utils/ReferenceExtractor';

@@ -56,4 +57,16 @@ class ReferencedListField extends ReferenceField {

}
getReferences(withRemoteComplete) {
return ReferenceExtractor.getReferences(this._targetFields, withRemoteComplete);
}
getNonOptimizedReferences(withRemoteComplete) {
return ReferenceExtractor.getNonOptimizedReferences(this._targetFields, withRemoteComplete);
}
getOptimizedReferences(withRemoteComplete) {
return ReferenceExtractor.getOptimizedReferences(this._targetFields, withRemoteComplete);
}
}
export default ReferencedListField;

56

lib/View/View.js
import Entry from "../Entry";
import {clone, cloneAndFlatten, cloneAndNest} from '../Utils/objectProperties';
import ReferenceExtractor from '../Utils/ReferenceExtractor';

@@ -165,41 +166,15 @@ class View {

getReferences(withRemoteComplete) {
let result = {};
let lists = this._fields.filter(f => f.type() === 'reference' || f.type() === 'reference_many');
var filterFunction = null;
if (withRemoteComplete === true) {
filterFunction = f => f.remoteComplete();
} else if (withRemoteComplete === false) {
filterFunction = f => !f.remoteComplete();
}
if (filterFunction !== null) {
lists = lists.filter(filterFunction);
}
for (let i = 0, c = lists.length ; i < c ; i++) {
let list = lists[i];
result[list.name()] = list;
}
return result;
return ReferenceExtractor.getReferences(this._fields, withRemoteComplete);
}
getNonOptimizedReferences(withRemoteComplete) {
return this._getReferencesByOptimizationType(false, withRemoteComplete);
return ReferenceExtractor.getNonOptimizedReferences(this._fields, withRemoteComplete);
}
getOptimizedReferences(withRemoteComplete) {
return this._getReferencesByOptimizationType(true, withRemoteComplete);
return ReferenceExtractor.getOptimizedReferences(this._fields, withRemoteComplete);
}
getReferencedLists() {
let result = {};
let lists = this._fields.filter(f => f.type() === 'referenced_list');
for (let i = 0, c = lists.length ; i < c ; i++) {
let list = lists[i];
result[list.name()] = list;
}
return result;
return ReferenceExtractor.getReferencedLists(this._fields);
}

@@ -282,25 +257,4 @@

}
/**
* @param {Boolean} optimized
* @param {Boolean} withRemoteComplete
* @returns {[Reference]}
* @private
*/
_getReferencesByOptimizationType(optimized=true, withRemoteComplete=null) {
let result = {},
references = this.getReferences(withRemoteComplete);
for (let i in references) {
let reference = references[i];
if (!!reference.getSingleApiCall() === optimized) {
result[i] = reference;
}
}
return result;
}
}
export default View;
{
"name": "admin-config",
"version": "0.2.18",
"version": "0.2.19",
"private": false,

@@ -5,0 +5,0 @@ "repository": {

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