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.3.2 to 0.4.0

4

lib/Factory.js

@@ -39,4 +39,4 @@ import Application from "./Application";

application(name, baseApiUrl) {
return new Application(name, baseApiUrl);
application(name, debug) {
return new Application(name, debug);
}

@@ -43,0 +43,0 @@

@@ -22,2 +22,3 @@ import stringUtils from "../Utils/stringUtils";

this.list = true;
this._template = () => '';
}

@@ -210,4 +211,18 @@

}
getTemplateValue(data) {
if (typeof(this._template) === 'function') {
return this._template(data);
}
return this._template;
}
template(template) {
if (!arguments.length) return this._template;
this._template = template;
return this;
}
}
export default Field;

@@ -6,21 +6,7 @@ import Field from "./Field";

super(name);
this._template = function() { return ''; };
this._type = "template";
this._flattenable = false;
}
getTemplateValue(data) {
if (typeof(this._template) === 'function') {
return this._template(data);
}
return this._template;
}
template(template) {
if (!arguments.length) return this._template;
this._template = template;
return this;
}
}
export default TemplateField;
{
"name": "admin-config",
"version": "0.3.2",
"version": "0.4.0",
"private": false,

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

@@ -65,2 +65,22 @@ var assert = require('chai').assert;

});
describe('template()', function() {
it('should accept string values', function () {
var field = new Field().template('hello!');
assert.equal(field.getTemplateValue(), 'hello!');
});
it('should accept function values', function () {
var field = new Field().template(function () { return 'hello function !'; });
assert.equal(field.getTemplateValue(), 'hello function !');
});
});
describe('getTemplateValue()', function() {
it('should return the template function executed with the supplied data', function() {
var field = new Field().template(function (name) { return 'hello ' + name + ' !'; });
assert.equal(field.getTemplateValue('John'), 'hello John !');
});
});
});

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