mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Change the order of arguments
This commit is contained in:
committed by
HirokiUchikawa
parent
84f598e143
commit
7fafa21a1b
@@ -145,12 +145,12 @@ function createContext(id,seed) {
|
||||
obj.get = function(key) {
|
||||
var keyPath = parseKey(key);
|
||||
var context = getContextStorage(keyPath.storage);
|
||||
return context.get(keyPath.key, scope);
|
||||
return context.get(scope, keyPath.key);
|
||||
};
|
||||
obj.set = function(key, value) {
|
||||
var keyPath = parseKey(key);
|
||||
var context = getContextStorage(keyPath.storage);
|
||||
return context.set(keyPath.key, value, scope);
|
||||
return context.set(scope, keyPath.key, value);
|
||||
};
|
||||
obj.keys = function(storage) {
|
||||
//TODO: discuss about keys() behavior
|
||||
|
@@ -66,7 +66,7 @@ var localfilesystem = {
|
||||
storageBaseDir = configs.dir;
|
||||
}
|
||||
},
|
||||
get: function (key, scope) {
|
||||
get: function (scope, key) {
|
||||
if(!storages[scope]){
|
||||
createStorage(scope);
|
||||
}
|
||||
@@ -82,7 +82,7 @@ var localfilesystem = {
|
||||
}
|
||||
},
|
||||
|
||||
set: function (key, value, scope) {
|
||||
set: function (scope, key, value) {
|
||||
if(!storages[scope]){
|
||||
createStorage(scope);
|
||||
}
|
||||
|
@@ -17,19 +17,18 @@
|
||||
var util = require("../../util");
|
||||
|
||||
var data;
|
||||
var seedFlg = false;
|
||||
|
||||
var memory = {
|
||||
init: function(config) {
|
||||
data = {};
|
||||
},
|
||||
get: function(key, scope) {
|
||||
get: function(scope, key) {
|
||||
if(!data[scope]){
|
||||
data[scope] = {};
|
||||
}
|
||||
return util.getMessageProperty(data[scope],key);
|
||||
},
|
||||
set: function(key, value, scope) {
|
||||
set: function(scope, key, value) {
|
||||
if(!data[scope]){
|
||||
data[scope] = {};
|
||||
}
|
||||
|
Reference in New Issue
Block a user