This commit is contained in:
David Štaleker
2025-07-18 05:33:16 +02:00
parent 401a367e5d
commit db0cc8d3de
14776 changed files with 9251484 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
// @path: normalized path
var resourceGet = function( data, path ) {
var i,
node = data,
length = path.length;
for ( i = 0; i < length - 1; i++ ) {
node = node[ path[ i ] ];
if ( !node ) {
return undefined;
}
}
return node[ path[ i ] ];
};

View File

@@ -0,0 +1,17 @@
// @path: normalized path
var resourceSet = function( data, path, value ) {
var i,
node = data,
length = path.length;
for ( i = 0; i < length - 1; i++ ) {
if ( !node[ path[ i ] ] ) {
node[ path[ i ] ] = {};
}
node = node[ path[ i ] ];
}
node[ path[ i ] ] = value;
};