Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

element-data-store

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

element-data-store - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

4

dist/element-data-store.min.js

@@ -1,2 +0,2 @@

/*! element-data-store | license: MIT | version: 0.0.1 | build date: 2015-08-13 */
!function(a,b,c,d){"function"==typeof define&&define.amd?define(function(){return d(a,b,c)}):"object"==typeof exports?module.exports=d:a.elementDataStore=d(a,b,c)}(window,document,void 0,function(a,b,c){function d(){this.dict={},this.uuid=1,this.namespace="DataStore"}return d.prototype={get:function(a,b){return"undefined"==typeof b?this.retrieveStore(a):this.retrieveStore(a)[b]||null},set:function(a,b,c){return this.retrieveStore(a)[b]=c,c},remove:function(a,b){if("undefined"!=typeof b){var c=this.retrieveStore(a);c[b]&&delete c[b]}else{var d=a[this.namespace];d&&(delete this.dict[d],a[this.namespace]=null)}},retrieveStore:function(a){var b=this.namespace,c=a[b];return c||(c=a[b]=this.uuid++,this.dict[c]={}),this.dict[c]}},new d});
/*! element-data-store | license: MIT | version: 0.0.2 | build date: 2015-08-14 */
!function(a,b,c,d){"function"==typeof define&&define.amd?define(function(){return d(a,b,c)}):"object"==typeof exports?module.exports=d:a.elementDataStore=d(a,b,c)}(window,document,void 0,function(a,b,c){function d(){this.dict={},this.uuid=1,this.namespace="DataStore"}return d.prototype={get:function(a,b){return"undefined"==typeof b?this.retrieveStore(a):this.retrieveStore(a)[b]||null},set:function(a,b,c){return this.retrieveStore(a)[b]=c,c},remove:function(a,b){if("undefined"!=typeof b){var c=this.retrieveStore(a);c[b]&&delete c[b]}else{var d=a[this.namespace];d&&(delete this.dict[d],a[this.namespace]=null)}},retrieveStore:function(a){var b=this.namespace,c=a[b];return c||(c=a[b]=this.uuid++,this.dict[c]={}),this.dict[c]||{}}},new d});
{
"name": "element-data-store",
"version": "0.0.1",
"version": "0.0.2",
"description": "Simple library that provides an api to stores data for an element (similar to $.data in jQuery)",

@@ -5,0 +5,0 @@ "main": "src/element-data-store.js",

@@ -1,6 +0,6 @@

#element-data-store
# element-data-store
element-data-store is a simple library that provides an api to stores data for an element (similar to $.data in jQuery)
##Add element-data-store to your project
## Add element-data-store to your project

@@ -12,5 +12,5 @@ There are multiple ways to add element-data-store to your project.

##Usage
## Usage
###Add data to an element
### Add data to an element

@@ -21,3 +21,3 @@ To add data to an element use the `set` method, passing the element, a key and the value you want to store.

###Fetch data for an element
###F etch data for an element

@@ -28,3 +28,3 @@ To get data to an element use the `get` method, passing the element. The key is an optional parameter, passing it will get the value for the key, not passing the parameter will result in being returned all the data stored on the element.

###Remove data from an element
### Remove data from an element

@@ -35,5 +35,5 @@ To remove data from an element use the `remove` method, passing the element. The key is an optional parameter, passing it will remove the value for the key, not passing the parameter will result in the removal of all data stored for the element.

##Licence
## Licence
License: MIT (http://www.opensource.org/licenses/mit-license.php)
Copyright Jonathan Fielding 2015

@@ -61,3 +61,3 @@ (function (window, document, undefined, factory) {

return this.dict[elementId];
return this.dict[elementId] || {};
}

@@ -64,0 +64,0 @@ };

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc