Repository URL to install this package:
|
Version:
1.2.6 ▾
|
"use strict";
const isUndefined = require("../deps/is/undefined");
function copySetIntoFunction(name, parent) {
const auto = arg => {
if (isUndefined(arg)) {
parent.get(name);
} else {
parent.set(name, arg);
Object.assign(parent[name], arg);
}
}; // so we know if we defaulted them
auto.getterOnSet = true;
return this.onSet(auto).onGet(auto).onCall(auto);
}
module.exports = copySetIntoFunction;