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

mofron-layout-margin

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mofron-layout-margin - npm Package Compare versions

Comparing version 0.0.11 to 0.1.0

81

index.js

@@ -12,34 +12,4 @@ /**

this.name('Margin');
this.prmMap('type', 'value');
this.prmOpt(po, p2);
this.getParam().check(
(tp) => {
try {
if (undefined === tp) {
return '';
}
if ( ('string' != (typeof tp)) ||
( ('' != tp) &&
('top' != tp) &&
('right' != tp) &&
('bottom' != tp) &&
('left' != tp) ) ) {
throw new Error('invalid parameter');
}
} catch (e) {
console.error(e.stack);
throw e;
}
},
(val) => {
try {
if ( ('number' !== typeof val) && ('string' !== typeof val) ) {
throw new Error('invalid parameter');
}
} catch (e) {
console.error(e.stack);
throw e;
}
},
);
} catch (e) {

@@ -53,11 +23,5 @@ console.error(e.stack);

try {
let mg = 'margin';
let type = this.value()[0];
let val = this.value()[1];
if ('' !== type) {
mg += '-' + type;
}
let mg = (null === this.type()) ? 'margin' : 'margin' + '-' + this.type();
let setmgn = {};
setmgn[mg] = ('number' !== typeof val) ? val : val + 'px';
setmgn[mg] = ('number' !== typeof this.value()) ? this.value() : this.value() + 'px';
tgt.adom().style(setmgn);

@@ -69,4 +33,43 @@ } catch (e) {

}
type (prm) {
try {
if (undefined === prm) {
/* getter */
return (undefined === this.m_type) ? null : this.m_type;
}
/* setter */
if ( ('string' !== typeof prm) ||
( ('top' !== prm) &&
('right' !== prm) &&
('bottom' !== prm) &&
('left' !== prm) ) ) {
throw new Error('invalid parameter');
}
this.m_type = prm;
} catch (e) {
console.error(e.stack);
throw e;
}
}
value (prm) {
try {
if (undefined === prm) {
/* getter */
return (undefined === this.m_value) ? null : this.m_value;
}
/* setter */
if (('string' !== typeof prm) && ('number' !== typeof prm)) {
throw new Error('invalid parameter');
}
this.m_value = prm;
} catch (e) {
console.error(e.stack);
throw e;
}
}
}
module.exports = mofron.layout.Margin;
/* end of file */
{
"name": "mofron-layout-margin",
"version": "0.0.11",
"version": "0.1.0",
"description": "margin layout of mofron",

@@ -5,0 +5,0 @@ "main": "index.js",

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