Comparing version 0.1.0 to 0.1.1
/** | ||
* enum-i18n - Enum with support for translated member descriptions | ||
* Author: Matt Dunlap<matt.dunlap@leankit.com> | ||
* Version: v1.0.0 | ||
* Url: https://github.com/Prestaul/enum-i18n | ||
* Version: v0.1.1 | ||
* Url: https://github.com/LeanKit-Labs/enum-i18n | ||
* License: MIT Copyright (c) 2015 LeanKit | ||
@@ -7,0 +7,0 @@ */ |
/** | ||
* enum-i18n - Enum with support for translated member descriptions | ||
* Author: Matt Dunlap<matt.dunlap@leankit.com> | ||
* Version: v1.0.0 | ||
* Url: https://github.com/Prestaul/enum-i18n | ||
* Version: v0.1.1 | ||
* Url: https://github.com/LeanKit-Labs/enum-i18n | ||
* License: MIT Copyright (c) 2015 LeanKit | ||
*/ | ||
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else{var r=e();for(var n in r)("object"==typeof exports?exports:t)[n]=r[n]}}(this,function(){return function(t){function e(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return t[n].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)}var o=function(t,e,r){for(var n=!0;n;){var i=t,o=e,u=r;a=f=s=void 0,n=!1,null===i&&(i=Function.prototype);var a=Object.getOwnPropertyDescriptor(i,o);if(void 0!==a){if("value"in a)return a.value;var s=a.get;return void 0===s?void 0:s.call(u)}var f=Object.getPrototypeOf(i);if(null===f)return void 0;t=f,e=o,r=u,n=!0}},u=r(1),a=r(11).clone;t.exports=function(t){if(t="function"==typeof t?{translate:t}:t||{},t.name)throw new Error("'name' cannot be provided as a default option to enum-i18n.");var e=function(e){function r(e,i){function u(){return s.translate(this)}n(this,r),"string"==typeof i&&(i={name:i});var s=a(t,i);if(!s.name||"string"!=typeof s.name)throw new Error("EnumI18n requires a 'name' string.");if("function"!=typeof s.translate)throw new Error("EnumI18n requires a 'translate' function.");var f=s.freez;s.freez=!1,o(Object.getPrototypeOf(r.prototype),"constructor",this).call(this,e,s);for(var h=this.enums,c=h.length;c--;)Object.defineProperty(h[c],"enum",{value:this,enumerable:!1}),Object.defineProperty(h[c],"toDescription",{value:u,enumerable:!1});f&&this.freezeEnums()}return i(r,e),r}(u);return e}},function(t,e,r){t.exports=r(2)},function(t,e,r){(function(e,n){"use strict";function i(t,e){if(t&&"name"===e||h.call(p,e)>=0)throw new Error("Enum key "+e+" is a reserved word!")}var o=function(t){return t&&t.__esModule?t["default"]:t},u=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=o(r(7)),s=o(r(8)),f=r(9).isString,h=r(10).indexOf,c=a.endianness(),l=function(){function t(e,r){var n=this;if(u(this,t),this.size=4,this.indirection=1,r&&f(r)&&(r={name:r}),this._options=r||{},this._options.separator=this._options.separator||" | ",this._options.endianness=this._options.endianness||c,this._options.ignoreCase=this._options.ignoreCase||!1,this._options.freez=this._options.freez||!1,this.enums=[],e.length){var o=e;e={};for(var a=0;a<o.length;a++)e[o[a]]=Math.pow(2,a)}for(var h in e)i(this._options.name,h),this[h]=new s(h,e[h],{ignoreCase:this._options.ignoreCase}),this.enums.push(this[h]);this._options.ignoreCase&&(this.getLowerCaseEnums=function(){for(var t={},e=0,r=this.enums.length;r>e;e++)t[this.enums[e].key.toLowerCase()]=this.enums[e];return t}),this._options.name&&(this.name=this._options.name);var l=function(){for(var t=0,e=n.enums.length;e>t;t++){var r=n.enums[t];if(0===r.value||r.value&r.value-1)return!1}return!0};this.isFlaggable=l(),this._options.freez&&this.freezeEnums()}return t.prototype.getKey=function(t){var e=this.get(t);return e?e.key:void 0},t.prototype.getValue=function(t){var e=this.get(t);return e?e.value:void 0},t.prototype.get=function(t,r){if(null!==t&&void 0!==t){if(e.isBuffer(t)&&(t=t["readUInt32"+this._options.endianness](r||0)),s.isEnumItem(t)){var n=h.call(this.enums,t);if(n>=0)return t;if(!this.isFlaggable||this.isFlaggable&&t.key.indexOf(this._options.separator)<0)return;return this.get(t.key)}if(f(t)){var i=this;if(this._options.ignoreCase&&(i=this.getLowerCaseEnums(),t=t.toLowerCase()),t.indexOf(this._options.separator)>0){for(var o=t.split(this._options.separator),u=0,a=0;a<o.length;a++){var c=o[a];u|=i[c].value}return new s(t,u)}return i[t]}for(var l in this)if(this.hasOwnProperty(l)&&this[l].value===t)return this[l];var p=null;if(this.isFlaggable)for(var g in this)this.hasOwnProperty(g)&&0!==(t&this[g].value)&&(p?p+=this._options.separator:p="",p+=g);return this.get(p||null)}},t.prototype.set=function(t,e,r){var n=this.get(r);return n?t["writeUInt32"+this._options.endianness](n.value,e||0):void 0},t.prototype.freezeEnums=function(){function t(){return Object.isFrozen&&Object.isSealed&&Object.getOwnPropertyNames&&Object.getOwnPropertyDescriptor&&Object.defineProperties&&Object.__defineGetter__&&Object.__defineSetter__}function e(t){var e=Object.getOwnPropertyNames(t);return e.forEach(function(e){Object.getOwnPropertyDescriptor(t,e).configurable&&Object.defineProperties(t,e,{writable:!1,configurable:!1})}),t}function r(t){return t}function n(t){if("object"==typeof t&&null!==t&&!Object.isFrozen(t)&&!Object.isSealed(t)){for(var i in t)t.hasOwnProperty(i)&&(t.__defineGetter__(i,r.bind(null,t[i])),t.__defineSetter__(i,function(t){throw TypeError("Cannot redefine property; Enum Type is not extensible.")}),n(t[i]));Object.freeze?Object.freeze(t):e(t)}}return t()&&n(this),this},t.register=function(){var e=void 0===arguments[0]?"Enum":arguments[0];n[e]||(n[e]=t)},t}();t.exports=l;var p=["_options","get","getKey","getValue","enums","isFlaggable"]}).call(e,r(3).Buffer,function(){return this}())},function(t,e,r){(function(t){function t(e){return this instanceof t?(this.length=0,this.parent=void 0,"number"==typeof e?n(this,e):"string"==typeof e?i(this,e,arguments.length>1?arguments[1]:"utf8"):o(this,e)):arguments.length>1?new t(e,arguments[1]):new t(e)}function n(e,r){if(e=c(e,0>r?0:0|l(r)),!t.TYPED_ARRAY_SUPPORT)for(var n=0;r>n;n++)e[n]=0;return e}function i(t,e,r){("string"!=typeof r||""===r)&&(r="utf8");var n=0|g(e,r);return t=c(t,n),t.write(e,r),t}function o(e,r){if(t.isBuffer(r))return u(e,r);if(J(r))return a(e,r);if(null==r)throw new TypeError("must start with number, buffer, array or string");return"undefined"!=typeof ArrayBuffer&&r.buffer instanceof ArrayBuffer?s(e,r):r.length?f(e,r):h(e,r)}function u(t,e){var r=0|l(e.length);return t=c(t,r),e.copy(t,0,0,r),t}function a(t,e){var r=0|l(e.length);t=c(t,r);for(var n=0;r>n;n+=1)t[n]=255&e[n];return t}function s(t,e){var r=0|l(e.length);t=c(t,r);for(var n=0;r>n;n+=1)t[n]=255&e[n];return t}function f(t,e){var r=0|l(e.length);t=c(t,r);for(var n=0;r>n;n+=1)t[n]=255&e[n];return t}function h(t,e){var r,n=0;"Buffer"===e.type&&J(e.data)&&(r=e.data,n=0|l(r.length)),t=c(t,n);for(var i=0;n>i;i+=1)t[i]=255&r[i];return t}function c(e,r){t.TYPED_ARRAY_SUPPORT?e=t._augment(new Uint8Array(r)):(e.length=r,e._isBuffer=!0);var n=0!==r&&r<=t.poolSize>>>1;return n&&(e.parent=G),e}function l(t){if(t>=X)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+X.toString(16)+" bytes");return 0|t}function p(e,r){if(!(this instanceof p))return new p(e,r);var n=new t(e,r);return delete n.parent,n}function g(t,e){if("string"!=typeof t&&(t=String(t)),0===t.length)return 0;switch(e||"utf8"){case"ascii":case"binary":case"raw":return t.length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*t.length;case"hex":return t.length>>>1;case"utf8":case"utf-8":return M(t).length;case"base64":return F(t).length;default:return t.length}}function w(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;var o=e.length;if(o%2!==0)throw new Error("Invalid hex string");n>o/2&&(n=o/2);for(var u=0;n>u;u++){var a=parseInt(e.substr(2*u,2),16);if(isNaN(a))throw new Error("Invalid hex string");t[r+u]=a}return u}function d(t,e,r,n){return N(M(e,t.length-r),t,r,n)}function y(t,e,r,n){return N(Y(e),t,r,n)}function E(t,e,r,n){return y(t,e,r,n)}function v(t,e,r,n){return N(F(e),t,r,n)}function m(t,e,r,n){return N(k(e,t.length-r),t,r,n)}function b(t,e,r){return q.fromByteArray(0===e&&r===t.length?t:t.slice(e,r))}function I(t,e,r){var n="",i="";r=Math.min(t.length,r);for(var o=e;r>o;o++)t[o]<=127?(n+=z(i)+String.fromCharCode(t[o]),i=""):i+="%"+t[o].toString(16);return n+z(i)}function _(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;r>i;i++)n+=String.fromCharCode(127&t[i]);return n}function A(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;r>i;i++)n+=String.fromCharCode(t[i]);return n}function B(t,e,r){var n=t.length;(!e||0>e)&&(e=0),(!r||0>r||r>n)&&(r=n);for(var i="",o=e;r>o;o++)i+=D(t[o]);return i}function O(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function U(t,e,r){if(t%1!==0||0>t)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function P(e,r,n,i,o,u){if(!t.isBuffer(e))throw new TypeError("buffer must be a Buffer instance");if(r>o||u>r)throw new RangeError("value is out of bounds");if(n+i>e.length)throw new RangeError("index out of range")}function R(t,e,r,n){0>e&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);o>i;i++)t[r+i]=(e&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function S(t,e,r,n){0>e&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);o>i;i++)t[r+i]=e>>>8*(n?i:3-i)&255}function L(t,e,r,n,i,o){if(e>i||o>e)throw new RangeError("value is out of bounds");if(r+n>t.length)throw new RangeError("index out of range");if(0>r)throw new RangeError("index out of range")}function T(t,e,r,n,i){return i||L(t,e,r,4,3.4028234663852886e38,-3.4028234663852886e38),V.write(t,e,r,n,23,4),r+4}function x(t,e,r,n,i){return i||L(t,e,r,8,1.7976931348623157e308,-1.7976931348623157e308),V.write(t,e,r,n,52,8),r+8}function C(t){if(t=j(t).replace(H,""),t.length<2)return"";for(;t.length%4!==0;)t+="=";return t}function j(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function D(t){return 16>t?"0"+t.toString(16):t.toString(16)}function M(t,e){e=e||1/0;for(var r,n=t.length,i=null,o=[],u=0;n>u;u++){if(r=t.charCodeAt(u),r>55295&&57344>r){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(u+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(56320>r){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=i-55296<<10|r-56320|65536,i=null}else i&&((e-=3)>-1&&o.push(239,191,189),i=null);if(128>r){if((e-=1)<0)break;o.push(r)}else if(2048>r){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(65536>r){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(2097152>r))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function Y(t){for(var e=[],r=0;r<t.length;r++)e.push(255&t.charCodeAt(r));return e}function k(t,e){for(var r,n,i,o=[],u=0;u<t.length&&!((e-=2)<0);u++)r=t.charCodeAt(u),n=r>>8,i=r%256,o.push(i),o.push(n);return o}function F(t){return q.toByteArray(C(t))}function N(t,e,r,n){for(var i=0;n>i&&!(i+r>=e.length||i>=t.length);i++)e[i+r]=t[i];return i}function z(t){try{return decodeURIComponent(t)}catch(e){return String.fromCharCode(65533)}}var q=r(4),V=r(5),J=r(6);e.Buffer=t,e.SlowBuffer=p,e.INSPECT_MAX_BYTES=50,t.poolSize=8192;var X=1073741823,G={};t.TYPED_ARRAY_SUPPORT=function(){try{var t=new ArrayBuffer(0),e=new Uint8Array(t);return e.foo=function(){return 42},42===e.foo()&&"function"==typeof e.subarray&&0===new Uint8Array(1).subarray(1,1).byteLength}catch(r){return!1}}(),t.isBuffer=function(t){return!(null==t||!t._isBuffer)},t.compare=function(e,r){if(!t.isBuffer(e)||!t.isBuffer(r))throw new TypeError("Arguments must be Buffers");if(e===r)return 0;for(var n=e.length,i=r.length,o=0,u=Math.min(n,i);u>o&&e[o]===r[o];)++o;return o!==u&&(n=e[o],i=r[o]),i>n?-1:n>i?1:0},t.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},t.concat=function(e,r){if(!J(e))throw new TypeError("list argument must be an Array of Buffers.");if(0===e.length)return new t(0);if(1===e.length)return e[0];var n;if(void 0===r)for(r=0,n=0;n<e.length;n++)r+=e[n].length;var i=new t(r),o=0;for(n=0;n<e.length;n++){var u=e[n];u.copy(i,o),o+=u.length}return i},t.byteLength=g,t.prototype.length=void 0,t.prototype.parent=void 0,t.prototype.toString=function(t,e,r){var n=!1;if(e=0|e,r=void 0===r||r===1/0?this.length:0|r,t||(t="utf8"),0>e&&(e=0),r>this.length&&(r=this.length),e>=r)return"";for(;;)switch(t){case"hex":return B(this,e,r);case"utf8":case"utf-8":return I(this,e,r);case"ascii":return _(this,e,r);case"binary":return A(this,e,r);case"base64":return b(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}},t.prototype.equals=function(e){if(!t.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:0===t.compare(this,e)},t.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},t.prototype.compare=function(e){if(!t.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?0:t.compare(this,e)},t.prototype.indexOf=function(e,r){function n(t,e,r){for(var n=-1,i=0;r+i<t.length;i++)if(t[r+i]===e[-1===n?0:i-n]){if(-1===n&&(n=i),i-n+1===e.length)return r+n}else n=-1;return-1}if(r>2147483647?r=2147483647:-2147483648>r&&(r=-2147483648),r>>=0,0===this.length)return-1;if(r>=this.length)return-1;if(0>r&&(r=Math.max(this.length+r,0)),"string"==typeof e)return 0===e.length?-1:String.prototype.indexOf.call(this,e,r);if(t.isBuffer(e))return n(this,e,r);if("number"==typeof e)return t.TYPED_ARRAY_SUPPORT&&"function"===Uint8Array.prototype.indexOf?Uint8Array.prototype.indexOf.call(this,e,r):n(this,[e],r);throw new TypeError("val must be string, number or Buffer")},t.prototype.get=function(t){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(t)},t.prototype.set=function(t,e){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(t,e)},t.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else if(isFinite(e))e=0|e,isFinite(r)?(r=0|r,void 0===n&&(n="utf8")):(n=r,r=void 0);else{var i=n;n=e,e=0|r,r=i}var o=this.length-e;if((void 0===r||r>o)&&(r=o),t.length>0&&(0>r||0>e)||e>this.length)throw new RangeError("attempt to write outside buffer bounds");n||(n="utf8");for(var u=!1;;)switch(n){case"hex":return w(this,t,e,r);case"utf8":case"utf-8":return d(this,t,e,r);case"ascii":return y(this,t,e,r);case"binary":return E(this,t,e,r);case"base64":return v(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return m(this,t,e,r);default:if(u)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),u=!0}},t.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},t.prototype.slice=function(e,r){var n=this.length;e=~~e,r=void 0===r?n:~~r,0>e?(e+=n,0>e&&(e=0)):e>n&&(e=n),0>r?(r+=n,0>r&&(r=0)):r>n&&(r=n),e>r&&(r=e);var i;if(t.TYPED_ARRAY_SUPPORT)i=t._augment(this.subarray(e,r));else{var o=r-e;i=new t(o,void 0);for(var u=0;o>u;u++)i[u]=this[u+e]}return i.length&&(i.parent=this.parent||this),i},t.prototype.readUIntLE=function(t,e,r){t=0|t,e=0|e,r||U(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n},t.prototype.readUIntBE=function(t,e,r){t=0|t,e=0|e,r||U(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},t.prototype.readUInt8=function(t,e){return e||U(t,1,this.length),this[t]},t.prototype.readUInt16LE=function(t,e){return e||U(t,2,this.length),this[t]|this[t+1]<<8},t.prototype.readUInt16BE=function(t,e){return e||U(t,2,this.length),this[t]<<8|this[t+1]},t.prototype.readUInt32LE=function(t,e){return e||U(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},t.prototype.readUInt32BE=function(t,e){return e||U(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},t.prototype.readIntLE=function(t,e,r){t=0|t,e=0|e,r||U(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*e)),n},t.prototype.readIntBE=function(t,e,r){t=0|t,e=0|e,r||U(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},t.prototype.readInt8=function(t,e){return e||U(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},t.prototype.readInt16LE=function(t,e){e||U(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},t.prototype.readInt16BE=function(t,e){e||U(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},t.prototype.readInt32LE=function(t,e){return e||U(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},t.prototype.readInt32BE=function(t,e){return e||U(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},t.prototype.readFloatLE=function(t,e){return e||U(t,4,this.length),V.read(this,t,!0,23,4)},t.prototype.readFloatBE=function(t,e){return e||U(t,4,this.length),V.read(this,t,!1,23,4)},t.prototype.readDoubleLE=function(t,e){return e||U(t,8,this.length),V.read(this,t,!0,52,8)},t.prototype.readDoubleBE=function(t,e){return e||U(t,8,this.length),V.read(this,t,!1,52,8)},t.prototype.writeUIntLE=function(t,e,r,n){t=+t,e=0|e,r=0|r,n||P(this,t,e,r,Math.pow(2,8*r),0);var i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},t.prototype.writeUIntBE=function(t,e,r,n){t=+t,e=0|e,r=0|r,n||P(this,t,e,r,Math.pow(2,8*r),0);var i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},t.prototype.writeUInt8=function(e,r,n){return e=+e,r=0|r,n||P(this,e,r,1,255,0),t.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[r]=e,r+1},t.prototype.writeUInt16LE=function(e,r,n){return e=+e,r=0|r,n||P(this,e,r,2,65535,0),t.TYPED_ARRAY_SUPPORT?(this[r]=e,this[r+1]=e>>>8):R(this,e,r,!0),r+2},t.prototype.writeUInt16BE=function(e,r,n){return e=+e,r=0|r,n||P(this,e,r,2,65535,0),t.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=e):R(this,e,r,!1),r+2},t.prototype.writeUInt32LE=function(e,r,n){return e=+e,r=0|r,n||P(this,e,r,4,4294967295,0),t.TYPED_ARRAY_SUPPORT?(this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e):S(this,e,r,!0),r+4},t.prototype.writeUInt32BE=function(e,r,n){return e=+e,r=0|r,n||P(this,e,r,4,4294967295,0),t.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e):S(this,e,r,!1),r+4},t.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e=0|e,!n){var i=Math.pow(2,8*r-1);P(this,t,e,r,i-1,-i)}var o=0,u=1,a=0>t?1:0;for(this[e]=255&t;++o<r&&(u*=256);)this[e+o]=(t/u>>0)-a&255;return e+r},t.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e=0|e,!n){var i=Math.pow(2,8*r-1);P(this,t,e,r,i-1,-i)}var o=r-1,u=1,a=0>t?1:0;for(this[e+o]=255&t;--o>=0&&(u*=256);)this[e+o]=(t/u>>0)-a&255;return e+r},t.prototype.writeInt8=function(e,r,n){return e=+e,r=0|r,n||P(this,e,r,1,127,-128),t.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),0>e&&(e=255+e+1),this[r]=e,r+1},t.prototype.writeInt16LE=function(e,r,n){return e=+e,r=0|r,n||P(this,e,r,2,32767,-32768),t.TYPED_ARRAY_SUPPORT?(this[r]=e,this[r+1]=e>>>8):R(this,e,r,!0),r+2},t.prototype.writeInt16BE=function(e,r,n){return e=+e,r=0|r,n||P(this,e,r,2,32767,-32768),t.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=e):R(this,e,r,!1),r+2},t.prototype.writeInt32LE=function(e,r,n){return e=+e,r=0|r,n||P(this,e,r,4,2147483647,-2147483648),t.TYPED_ARRAY_SUPPORT?(this[r]=e,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24):S(this,e,r,!0),r+4},t.prototype.writeInt32BE=function(e,r,n){return e=+e,r=0|r,n||P(this,e,r,4,2147483647,-2147483648),0>e&&(e=4294967295+e+1),t.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e):S(this,e,r,!1),r+4},t.prototype.writeFloatLE=function(t,e,r){return T(this,t,e,!0,r)},t.prototype.writeFloatBE=function(t,e,r){return T(this,t,e,!1,r)},t.prototype.writeDoubleLE=function(t,e,r){return x(this,t,e,!0,r)},t.prototype.writeDoubleBE=function(t,e,r){return x(this,t,e,!1,r)},t.prototype.copy=function(e,r,n,i){if(n||(n=0),i||0===i||(i=this.length),r>=e.length&&(r=e.length),r||(r=0),i>0&&n>i&&(i=n),i===n)return 0;if(0===e.length||0===this.length)return 0;if(0>r)throw new RangeError("targetStart out of bounds");if(0>n||n>=this.length)throw new RangeError("sourceStart out of bounds");if(0>i)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-r<i-n&&(i=e.length-r+n);var o=i-n;if(1e3>o||!t.TYPED_ARRAY_SUPPORT)for(var u=0;o>u;u++)e[u+r]=this[u+n];else e._set(this.subarray(n,n+o),r);return o},t.prototype.fill=function(t,e,r){if(t||(t=0),e||(e=0),r||(r=this.length),e>r)throw new RangeError("end < start");if(r!==e&&0!==this.length){if(0>e||e>=this.length)throw new RangeError("start out of bounds");if(0>r||r>this.length)throw new RangeError("end out of bounds");var n;if("number"==typeof t)for(n=e;r>n;n++)this[n]=t;else{var i=M(t.toString()),o=i.length;for(n=e;r>n;n++)this[n]=i[n%o]}return this}},t.prototype.toArrayBuffer=function(){if("undefined"!=typeof Uint8Array){if(t.TYPED_ARRAY_SUPPORT)return new t(this).buffer;for(var e=new Uint8Array(this.length),r=0,n=e.length;n>r;r+=1)e[r]=this[r];return e.buffer}throw new TypeError("Buffer.toArrayBuffer not supported in this browser")};var K=t.prototype;t._augment=function(e){return e.constructor=t,e._isBuffer=!0,e._set=e.set,e.get=K.get,e.set=K.set,e.write=K.write,e.toString=K.toString,e.toLocaleString=K.toString,e.toJSON=K.toJSON,e.equals=K.equals,e.compare=K.compare,e.indexOf=K.indexOf,e.copy=K.copy,e.slice=K.slice,e.readUIntLE=K.readUIntLE,e.readUIntBE=K.readUIntBE,e.readUInt8=K.readUInt8,e.readUInt16LE=K.readUInt16LE,e.readUInt16BE=K.readUInt16BE,e.readUInt32LE=K.readUInt32LE,e.readUInt32BE=K.readUInt32BE,e.readIntLE=K.readIntLE,e.readIntBE=K.readIntBE,e.readInt8=K.readInt8,e.readInt16LE=K.readInt16LE,e.readInt16BE=K.readInt16BE,e.readInt32LE=K.readInt32LE,e.readInt32BE=K.readInt32BE,e.readFloatLE=K.readFloatLE,e.readFloatBE=K.readFloatBE,e.readDoubleLE=K.readDoubleLE,e.readDoubleBE=K.readDoubleBE,e.writeUInt8=K.writeUInt8,e.writeUIntLE=K.writeUIntLE,e.writeUIntBE=K.writeUIntBE,e.writeUInt16LE=K.writeUInt16LE,e.writeUInt16BE=K.writeUInt16BE,e.writeUInt32LE=K.writeUInt32LE,e.writeUInt32BE=K.writeUInt32BE,e.writeIntLE=K.writeIntLE,e.writeIntBE=K.writeIntBE,e.writeInt8=K.writeInt8,e.writeInt16LE=K.writeInt16LE,e.writeInt16BE=K.writeInt16BE,e.writeInt32LE=K.writeInt32LE,e.writeInt32BE=K.writeInt32BE,e.writeFloatLE=K.writeFloatLE,e.writeFloatBE=K.writeFloatBE,e.writeDoubleLE=K.writeDoubleLE,e.writeDoubleBE=K.writeDoubleBE,e.fill=K.fill,e.inspect=K.inspect,e.toArrayBuffer=K.toArrayBuffer,e};var H=/[^+\/0-9A-z\-]/g}).call(e,r(3).Buffer)},function(t,e,r){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";!function(t){"use strict";function e(t){var e=t.charCodeAt(0);return e===u||e===c?62:e===a||e===l?63:s>e?-1:s+10>e?e-s+26+26:h+26>e?e-h:f+26>e?e-f+26:void 0}function r(t){function r(t){f[c++]=t}var n,i,u,a,s,f;if(t.length%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var h=t.length;s="="===t.charAt(h-2)?2:"="===t.charAt(h-1)?1:0,f=new o(3*t.length/4-s),u=s>0?t.length-4:t.length;var c=0;for(n=0,i=0;u>n;n+=4,i+=3)a=e(t.charAt(n))<<18|e(t.charAt(n+1))<<12|e(t.charAt(n+2))<<6|e(t.charAt(n+3)),r((16711680&a)>>16),r((65280&a)>>8),r(255&a);return 2===s?(a=e(t.charAt(n))<<2|e(t.charAt(n+1))>>4,r(255&a)):1===s&&(a=e(t.charAt(n))<<10|e(t.charAt(n+1))<<4|e(t.charAt(n+2))>>2,r(a>>8&255),r(255&a)),f}function i(t){function e(t){return n.charAt(t)}function r(t){return e(t>>18&63)+e(t>>12&63)+e(t>>6&63)+e(63&t)}var i,o,u,a=t.length%3,s="";for(i=0,u=t.length-a;u>i;i+=3)o=(t[i]<<16)+(t[i+1]<<8)+t[i+2],s+=r(o);switch(a){case 1:o=t[t.length-1],s+=e(o>>2),s+=e(o<<4&63),s+="==";break;case 2:o=(t[t.length-2]<<8)+t[t.length-1],s+=e(o>>10),s+=e(o>>4&63),s+=e(o<<2&63),s+="="}return s}var o="undefined"!=typeof Uint8Array?Uint8Array:Array,u="+".charCodeAt(0),a="/".charCodeAt(0),s="0".charCodeAt(0),f="a".charCodeAt(0),h="A".charCodeAt(0),c="-".charCodeAt(0),l="_".charCodeAt(0);t.toByteArray=r,t.fromByteArray=i}(e)},function(t,e){e.read=function(t,e,r,n,i){var o,u,a=8*i-n-1,s=(1<<a)-1,f=s>>1,h=-7,c=r?i-1:0,l=r?-1:1,p=t[e+c];for(c+=l,o=p&(1<<-h)-1,p>>=-h,h+=a;h>0;o=256*o+t[e+c],c+=l,h-=8);for(u=o&(1<<-h)-1,o>>=-h,h+=n;h>0;u=256*u+t[e+c],c+=l,h-=8);if(0===o)o=1-f;else{if(o===s)return u?0/0:(p?-1:1)*(1/0);u+=Math.pow(2,n),o-=f}return(p?-1:1)*u*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var u,a,s,f=8*o-i-1,h=(1<<f)-1,c=h>>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,g=n?1:-1,w=0>e||0===e&&0>1/e?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,u=h):(u=Math.floor(Math.log(e)/Math.LN2),e*(s=Math.pow(2,-u))<1&&(u--,s*=2),e+=u+c>=1?l/s:l*Math.pow(2,1-c),e*s>=2&&(u++,s/=2),u+c>=h?(a=0,u=h):u+c>=1?(a=(e*s-1)*Math.pow(2,i),u+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,i),u=0));i>=8;t[r+p]=255&a,p+=g,a/=256,i-=8);for(u=u<<i|a,f+=i;f>0;t[r+p]=255&u,p+=g,u/=256,f-=8);t[r+p-g]|=128*w}},function(t,e){var r=Array.isArray,n=Object.prototype.toString;t.exports=r||function(t){return!!t&&"[object Array]"==n.call(t)}},function(t,e){e.endianness=function(){return"LE"},e.hostname=function(){return"undefined"!=typeof location?location.hostname:""},e.loadavg=function(){return[]},e.uptime=function(){return 0},e.freemem=function(){return Number.MAX_VALUE},e.totalmem=function(){return Number.MAX_VALUE},e.cpus=function(){return[]},e.type=function(){return"Browser"},e.release=function(){return"undefined"!=typeof navigator?navigator.appVersion:""},e.networkInterfaces=e.getNetworkInterfaces=function(){return{}},e.arch=function(){return"javascript"},e.platform=function(){return"browser"},e.tmpdir=e.tmpDir=function(){return"/tmp"},e.EOL="\n"},function(t,e,r){"use strict";var n=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},i=r(9),o=i.isObject,u=i.isString,a=function(){function t(e,r){var i=void 0===arguments[2]?{}:arguments[2];n(this,t),this.key=e,this.value=r,this._options=i,this._options.ignoreCase=this._options.ignoreCase||!1}return t.prototype.has=function(e){return t.isEnumItem(e)?0!==(this.value&e.value):u(e)?this._options.ignoreCase?this.key.toLowerCase().indexOf(e.toLowerCase())>=0:this.key.indexOf(e)>=0:0!==(this.value&e)},t.prototype.is=function(e){return t.isEnumItem(e)?this.key===e.key:u(e)?this._options.ignoreCase?this.key.toLowerCase()===e.toLowerCase():this.key===e:this.value===e},t.prototype.toString=function(){return this.key},t.prototype.toJSON=function(){return this.key},t.prototype.valueOf=function(){return this.value},t.isEnumItem=function(e){return e instanceof t||o(e)&&void 0!==e.key&&void 0!==e.value},t}();t.exports=a},function(t,e){"use strict";{var r=e.isType=function(t,e){return typeof e===t};e.isObject=function(t){return r("object",t)},e.isString=function(t){return r("string",t)}}e.__esModule=!0},function(t,e){"use strict";e.indexOf=Array.prototype.indexOf||function(t,e){void 0===e&&(e=0),0>e&&(e+=this.length),0>e&&(e=0);for(var r=this.length;r>e;e++)if(e in this&&this[e]===t)return e;return-1};e.__esModule=!0},function(t,e,r){var n=r(12),i=t.exports=n.extendShallow;i(i,{clone:n.cloneShallow,extend:n.extendShallow,update:n.updateShallow,merge:n.mergeShallow})},function(t,e,r){function n(t){switch(c(t)){case"object":var e=l.call(arguments);return e.unshift({}),o.apply(null,e);case"array":return[].concat(t);case"date":return new Date(t.getTime());case"regexp":return new RegExp(t);default:return t}}function i(t){switch(c(t)){case"object":var e=l.call(arguments);return e.unshift({}),u.apply(null,e);case"array":return t.map(function(t){return i(t)});default:return n(t)}}function o(t,e){return l.call(arguments,1).forEach(function(e){Object.keys(e).forEach(function(r){t[r]=e[r]})}),t}function u(t,e){return l.call(arguments,1).forEach(function(e){Object.keys(e).forEach(function(r){"object"===c(e[r])&&"object"===c(t[r])?u(t[r],e[r]):t[r]=i(e[r])})}),t}function a(t,e){return l.call(arguments,1).forEach(function(e){Object.keys(e).forEach(function(r){t.hasOwnProperty(r)&&(t[r]=e[r])})}),t}function s(t,e){return l.call(arguments,1).forEach(function(e){var r,n,o,u;Object.keys(e).forEach(function(a){t.hasOwnProperty(a)&&(r=t[a],n=e[a],o=c(r),u=c(n),"object"===u&&"object"===o?s(r,n):"array"===u&&"array"===o?(r.length=0,r.push.apply(r,n.map(function(t){return i(t)}))):t[a]=i(n))})}),t}function f(t,e){return l.call(arguments,1).forEach(function(e){Object.keys(e).forEach(function(r){t.hasOwnProperty(r)||(t[r]=e[r])})}),t}function h(t,e){return l.call(arguments,1).forEach(function(e){var r,n,o,u;Object.keys(e).forEach(function(a){r=t[a],n=e[a],o=c(r),u=c(n),"object"===u&&"object"===o?h(r,n):t.hasOwnProperty(a)||(t[a]=i(n))})}),t}var c=r(13),l=Array.prototype.slice;t.exports={clone:i,cloneShallow:n,extend:u,extendShallow:o,update:s,updateShallow:a,merge:h,mergeShallow:f}},function(t,e){t.exports=function(t){var e=typeof t;if("object"!==e)return e;if(null===t)return"null";switch(t.constructor){case Array:return"array";case String:return"string";case Number:return"number";case Boolean:return"boolean";case RegExp:return"regexp";case Date:return"date"}return"object"}}])}); |
{ | ||
"name": "enum-i18n", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Enum with support for translated member descriptions", | ||
@@ -5,0 +5,0 @@ "main": "src/enum-i18n.js", |
Sorry, the diff of this file is too big to display
132672