bit-bin
Version:
<a href="https://opensource.org/licenses/Apache-2.0"><img alt="apache" src="https://img.shields.io/badge/License-Apache%202.0-blue.svg"></a> <a href="https://github.com/teambit/bit/blob/master/CONTRIBUTING.md"><img alt="prs" src="https://img.shields.io/b
47 lines (39 loc) • 993 B
JavaScript
function _scope() {
const data = require("../../../scope");
_scope = function () {
return data;
};
return data;
}
function set(key, value) {
// @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
return (0, _scope().loadScope)().then(scope => {
scope.scopeJson.set(key, value);
return scope.scopeJson.write(process.cwd()).then(() => ({
key,
value
}));
});
}
function get(key) {
// @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
return (0, _scope().loadScope)().then(scope => scope.scopeJson.get(key));
}
function del(key) {
// @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
return (0, _scope().loadScope)().then(scope => {
scope.scopeJson.del(key);
return scope.scopeJson.write(process.cwd());
});
}
function list() {
// @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
return (0, _scope().loadScope)().then(scope => scope.scopeJson.toPlainObject());
}
module.exports = {
set,
get,
del,
list
};
;