CARVIEW |
Select Language
HTTP/2 301
location: https://raw.githubusercontent.com/nbubna/store/master/src/store.deep.js
accept-ranges: bytes
age: 0
date: Tue, 22 Jul 2025 23:04:42 GMT
via: 1.1 varnish
x-served-by: cache-bom-vanm7210043-BOM
x-cache: MISS
x-cache-hits: 0
x-timer: S1753225481.377264,VS0,VE996
vary: Accept-Encoding
x-fastly-request-id: 7421d174adfea04a9ce3e4ae94eee5d1db839f91
content-length: 0
HTTP/2 200
cache-control: max-age=300
content-security-policy: default-src 'none'; style-src 'unsafe-inline'; sandbox
content-type: text/plain; charset=utf-8
etag: W/"1bb6d62ad6ad3c418c2b64d2ae3d8180e95bb15e4b04ae3c01a053f91724f174"
strict-transport-security: max-age=31536000
x-content-type-options: nosniff
x-frame-options: deny
x-xss-protection: 1; mode=block
x-github-request-id: 40D0:12F0F8:281E7:9640A:68801909
content-encoding: gzip
accept-ranges: bytes
date: Tue, 22 Jul 2025 23:04:42 GMT
via: 1.1 varnish
x-served-by: cache-bom-vanm7210088-BOM
x-cache: MISS
x-cache-hits: 0
x-timer: S1753225482.425282,VS0,VE241
vary: Authorization,Accept-Encoding
access-control-allow-origin: *
cross-origin-resource-policy: cross-origin
x-fastly-request-id: 2cd33c0cb4e6b94e206e9f8af46da5175523826d
expires: Tue, 22 Jul 2025 23:09:42 GMT
source-age: 0
content-length: 783
/**
* Copyright (c) 2017 ESHA Research
* Dual licensed under the MIT and GPL licenses:
* https://www.opensource.org/licenses/mit-license.php
* https://www.gnu.org/licenses/gpl.html
*
* Allows retrieval of values from within a stored object.
*
* store.set('foo', { is: { not: { quite: false }}});
* console.log(store.get('foo.is.not.quite'));// logs false
*
* Status: ALPHA - currently only supports get
*/
;(function(_) {
// save original core accessor
var _get = _.get;
// replace with enhanced version
_.get = function(area, key, kid) {
var s = _get(area, key);
if (s == null) {
var parts = _.split(key);
if (parts) {
key = parts[0];
kid = kid ? parts[1] + '.' + kid : parts[1];
return _.get(area, parts[0], kid);
}
} else if (kid) {
try {
var val = _.parse(s);
val = _.resolvePath(val, kid);
s = _.stringify(val);
} catch (e) {
window.console.error("Error accessing nested property:", e);
return null;
}
}
return s;
};
// Helper function to resolve nested paths safely
_.resolvePath = function(obj, path) {
return path.split('.').reduce(function(acc, key) { return acc && acc[key]; }, obj);
};
// expose internals on the underscore to allow extensibility
_.split = function(key) {
var dot = key.lastIndexOf('.');
if (dot > 0) {
var kid = key.substring(dot + 1, key.length);
key = key.substring(0, dot);
return [key, kid];
}
};
})(window.store._);