CARVIEW |
Select Language
HTTP/2 301
location: https://raw.githubusercontent.com/nbubna/store/master/src/store.dot.js
accept-ranges: bytes
age: 0
date: Wed, 23 Jul 2025 14:22:22 GMT
via: 1.1 varnish
x-served-by: cache-bom-vanm7210043-BOM
x-cache: MISS
x-cache-hits: 0
x-timer: S1753280542.044692,VS0,VE237
vary: Accept-Encoding
x-fastly-request-id: ec550c13686902286103785a156de87d567eb9b2
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/"bd9a113e854567d2900d1fa671b01b85e2348afdabd5c843ff65dc8b3282ccb1"
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: B47A:25676B:1516C0:307D68:6880F01D
content-encoding: gzip
accept-ranges: bytes
date: Wed, 23 Jul 2025 14:22:22 GMT
via: 1.1 varnish
x-served-by: cache-bom-vanm7210029-BOM
x-cache: MISS
x-cache-hits: 0
x-timer: S1753280542.345370,VS0,VE259
vary: Authorization,Accept-Encoding
access-control-allow-origin: *
cross-origin-resource-policy: cross-origin
x-fastly-request-id: 9ad2509ddaab6194edaf7ef7cb035e863931b821
expires: Wed, 23 Jul 2025 14:27:22 GMT
source-age: 0
content-length: 740
/**
* 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
*
* Adds getters and setters for existing keys (and newly set() ones) to enable dot access to stored properties.
*
* store.dot('foo','bar');// makes store aware of keys (could also do store.set('foo',''))
* store.foo = { is: true };// == store.set('foo', { is: true });
* console.log(store.foo.is);// logs 'true'
*
* This will not create accessors that conflict with existing properties of the store object.
*
* Status: ALPHA - good, but ```store.foo.is=false``` won't persist while looking like it would
*/
;(function(_, Object, Array) {
// expose internals on the underscore to allow extensibility
_.dot = function(key) {
var keys = !key ? this.keys() :
Array.isArray(key) ? key :
Array.prototype.slice.call(arguments),
target = this;
keys.forEach(function(key) {
_.dot.define(target, key);
});
return this;
};
_.dot.define = function(target, key) {
if (!(key in target)) {
Object.defineProperty(target, key, {
enumerable: true,
get: function(){ return this.get(key); },
set: function(value){ this.set(key, value); }
});
}
};
// add function(s) to the store interface
_.fn('dot', _.dot);
})(window.store._, window.Object, window.Array);