rodrigogs/punto

View on GitHub
build/punto-min.js

Summary

Maintainability
A
0 mins
Test Coverage
!function(){"use strict";function t(t){var o=typeof t;return null!==t&&"object"===o}var o="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||this,e=Object.prototype.hasOwnProperty,n=function(t,o){this.object=t||this.object,this.symbol=o||this.symbol};n.symbol=".",n.setSymbol=function(t){n.symbol=t},n.getSymbol=function(){return n.symbol},n.from=function(t,o){return new n(t,o)},n.get=function(t,o,l){if(l=l||n.symbol,!t)return null;if("string"!=typeof o)return t[o];if(e.call(t,o))return t[o];for(var r,s=o.split(l),i=t,f=!1,b=0,u=s.length;b<u;b++){f=b+1===u;var c=s[b];if(!e.call(i,c)){r=null;break}f?r=i[c]:i=i[c]}return r},n.set=function(o,l,r,s){if(s=s||n.symbol,o)for(var i=(l||"").split(s),f=o,b=!1,u=0,c=i.length;u<c;u++){b=u+1===c;var y=i[u];e.call(f,y)?b?f[y]=r:(t(f[y])||(f[y]={}),f=f[y]):b?f[y]=r:(f[y]={},f=f[y])}},n.normalize=function(t,o){o=o||n.symbol;for(var e=Object.getOwnPropertyNames(t),l=0,r=e.length;l<r;l++){var s=e[l],i=t[s];s.indexOf(o)!==-1&&(delete t[s],n.set(t,s,i,o))}},n.prototype.symbol=".",n.prototype.object=null,n.prototype.getObject=function(){return this.object},n.prototype.setSymbol=function(t){this.symbol=t},n.prototype.getSymbol=function(){return this.symbol},n.prototype.get=function(t){return n.get(this.object,t,this.symbol)},n.prototype.set=function(t,o){n.set(this.object,t,o,this.symbol)},n.prototype.normalize=function(){n.normalize(this.object,this.symbol)},"object"==typeof module&&module.exports?module.exports=n:"function"==typeof define&&define.amd?define([],function(){return n}):o.Punto=n}();