class-o-mat
Version:
ALPHA VERSION ONLY: class-o-mats will help to create getter-setter functionality with validations that can be attached to a container class for easier coding. Some basic validations are included. class-o-mats also has the ability to store params as bloc
15 lines (11 loc) • 475 B
JavaScript
import { NONE } from '../constants/types';
export const getterSetter =(ts, key, value=NONE)=> {
if (value === NONE) return ts._params[key];
ts._params[key] = value;
return ts;
}
export const toggler =(ts, key)=> {
const v = ts[key];
ts._params[key] = (v === true ) ? false : true;
return ts;
}