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

@trademe/ensure

Package Overview
Dependencies
Maintainers
7
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@trademe/ensure - npm Package Compare versions

Comparing version 0.2.0-beta.2 to 0.2.0-beta.3

41

bundles/trademe-ensure.umd.js

@@ -29,3 +29,3 @@ (function (global, factory) {

var /** @type {?} */ whitespaceCount = n.search(/\S/);
if (whitespaceCount <= 0) {
if (whitespaceCount < 0) {
return p;

@@ -139,10 +139,12 @@ }

function isEnum(enumValues) {
// This functions is explicitly *not* using the `=>` syntax so that
// the `this` values is bound to the instance being checked.
// Prepare the enum values so lookups work in both directions,
// with both number and string enums:
var /** @type {?} */ flipped = flipEnum(enumValues);
var /** @type {?} */ stripped = stripEnum(enumValues);
return ensure(function (value, key) {
var /** @type {?} */ enumValue = enumValues[value];
var /** @type {?} */ enumValue = stripped[value] != null ? stripped[value] : stripped[flipped[value]];
if (enumValue == null) {
throw new EnsureError("\n \"" + value + "\" is not a valid value for '" + key + "'. You can use one of the following:\n " + getValues(enumValues) + "\n ");
}
return typeof enumValue === 'number' ? enumValue : value;
return enumValue;
});

@@ -155,2 +157,29 @@ }

*/
function flipEnum(enumT) {
var /** @type {?} */ flipped = {};
Object.keys(enumT).forEach(function (key) {
flipped[key] = enumT[key];
flipped[enumT[key]] = key;
});
return flipped;
}
/**
* @template T
* @param {?} enumT
* @return {?}
*/
function stripEnum(enumT) {
var /** @type {?} */ stripped = {};
Object.keys(enumT).forEach(function (key) {
if (isNaN(parseInt(key, 10))) {
stripped[key] = enumT[key];
}
});
return stripped;
}
/**
* @template T
* @param {?} enumT
* @return {?}
*/
function getValues(enumT) {

@@ -216,2 +245,2 @@ return Object.keys(enumT)

//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJhZGVtZS1lbnN1cmUudW1kLmpzLm1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2goZ2V0dGVyID0+IHtcbiAgICAgICAgICAgICAgICAgICAgZ2V0dGVyLmNhbGwodGhpcywgdmFsdWUsIHByb3BlcnR5S2V5KTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICByZXR1cm4gdmFsdWU7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgc2V0OiBmdW5jdGlvbiAodmFsdWUpIHtcbiAgICAgICAgICAgICAgICBsZXQgY2FzdFZhbHVlID0gdmFsdWU7XG5cbiAgICAgICAgICAgICAgICBpZiAoY2FzdFZhbHVlID09PSAnbnVsbCcpIHtcbiAgICAgICAgICAgICAgICAgICAgY2FzdFZhbHVlID0gbnVsbDtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBpZiAoY2FzdFZhbHVlICE9IG51bGwpIHtcbiAgICAgICAgICAgICAgICAgICAgc2V0dGVycy5mb3JFYWNoKHNldHRlciA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXN0VmFsdWUgPSBzZXR0ZXIuY2FsbCh0aGlzLCBjYXN0VmFsdWUsIHByb3BlcnR5S2V5KTtcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIChSZWZsZWN0IGFzIGFueSkuZGVmaW5lTWV0YWRhdGEoYCR7VkFMVUVfS0VZfSR7cHJvcGVydHlLZXl9YCwgY2FzdFZhbHVlLCB0aGlzKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgfTtcbn1cblxuZnVuY3Rpb24gZ2V0R3VhcmRzQXJyYXkgKGd1YXJkczogQXJyYXk8R3VhcmQ8YW55PiB8IEFycmF5PEd1YXJkPGFueT4+Pik6IEFycmF5PEd1YXJkPGFueT4+IHtcbiAgICAvLyBIYW5kbGUgb2xkIEBWYWx1ZShbZ3VhcmRPbmUsIGd1YXJkVHdvXSkgc3ludGF4OlxuICAgIGNvbnN0IFtmaXJzdEd1YXJk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dGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgY29uc3QgdmFsdWUgPSAoUmVmbGVjdCBhcyBhbnkpLmdldE1ldGFkYXRhKGAke1ZBTFVFX0tFWX0ke3Byb3BlcnR5S2V5fWAsIHRoaXMpO1xuICAgICAgICAgICAgICAgIGdldHRlcnMuZm9yRWFjaChnZXR0ZXIgPT4ge1xuICAgICAgICAgICAgICAgICAgICBnZXR0ZXIuY2FsbCh0aGlzLCB2YWx1ZSwgcHJvcGVydHlLZXkpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIHJldHVybiB2YWx1ZTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBzZXQ6IGZ1bmN0aW9uICh2YWx1ZSkge1xuICAgICAgICAgICAgICAgIGxldCBjYXN0VmFsdWUgPSB2YWx1ZTtcblxuICAgICAgICAgICAgICAgIGlmIChjYXN0VmFsdWUgPT09ICdudWxsJykge1xuICAgICAgICAgICAgICAgICAgICBjYXN0VmFsdWUgPSBudWxsO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGlmIChjYXN0VmFsdWUgIT0gbnVsbCkge1xuICAgICAgICAgICAgICAgICAgICBzZXR0ZXJzLmZvckVhY2goc2V0dGVyID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc3RWYWx1ZSA9IHNldHRlci5jYWxsKHRoaXMsIGNhc3RWYWx1ZSwgcHJvcGVydHlLZXkpO1xuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgKFJlZmxlY3QgYXMgYW55KS5kZWZpbmVNZXRhZGF0YShgJHtWQUxVRV9LRVl9JHtwcm9wZXJ0eUtleX1gLCBjYXN0VmFsdWUsIHRoaXMpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICB9O1xufVxuXG5mdW5jdGlvbiBnZXRHdWFyZHNBcnJheSAoZ3VhcmRzOiBBcnJheTx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NQUFNLENBQUMsVUFBQSxHQUFHLElBQUksT0FBQSxLQUFLLENBQUMsQ0FBQyxHQUFHLENBQUMsR0FBQSxDQUFDO2FBQzFCLEdBQUcsQ0FBQyxVQUFBLEdBQUcsSUFBSSxPQUFBLE9BQUksR0FBRyxPQUFHLEdBQUEsQ0FBQzthQUN0QixJQUFJLENBQUMseUJBQXlCLENBQUMsQ0FBQztLQUNwQzs7Ozs7O0FDN0NELHlCQUdhLFNBQVMsR0FBRyxNQUFNLENBQUMsVUFBQyxLQUFVLEVBQUUsR0FBUTtRQUNqRCxJQUFJLEtBQUssSUFBSSxJQUFJLEVBQUU7WUFDZixNQUFNLElBQUksV0FBVyxDQUFDLG9CQUNmLEdBQUcsdURBQ1QsQ0FBQyxDQUFDO1NBQ047UUFDRCxPQUFPLEtBQUssQ0FBQztLQUNoQixFQUFFO1FBQ0MsTUFBTSxFQUFFLElBQUk7S0FDZixDQUFDOzs7Ozs7QUNaRix5QkFHYSxRQUFRLEdBQUcsTUFBTSxDQUFDLFVBQUMsS0FBVSxFQUFFLEdBQVc7UUFDbkQsS0FBSyxHQUFHLENBQUMsVUFBVSxDQUFDLEtBQUssQ0FBQyxDQUFDO1FBQzNCLElBQUksS0FBSyxDQUFDLEtBQUssQ0FBQyxFQUFFO1lBQ2QsTUFBTSxJQUFJLFdBQVcsQ0FBQyxvQkFDZixHQUFHLGtDQUNULENBQUMsQ0FBQztTQUNOO1FBQ0QsT0FBTyxLQUFLLENBQUM7S0FDaEIsQ0FBQzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OzsifQ==

2

bundles/trademe-ensure.umd.min.js

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

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("tslib")):"function"==typeof define&&define.amd?define("@trademe/ensure",["exports","tslib"],t):t((e.trademe=e.trademe||{},e.trademe.ensure={}),e.tslib)}(this,function(e,f){"use strict";var i=function(r){function e(e){var t=this.constructor,n=r.call(this,u(e))||this;return Object.setPrototypeOf(n,t.prototype),n}return f.__extends(e,r),e}(Error);function u(e){var t=e.split(/\n/),n=t.reduce(function(e,t){var n=t.search(/\S/);return n<=0?e:n<e?n:e},Infinity);return t.map(function(e){return e.substr(n)}).join("\n")}var a="__value_";function t(e,t){return Object.defineProperty(e,"isGetter",{get:function(){return!!t&&t.getter}}),e}var n=t(function(e,t){if(!0===e||!1===e)return e;if("true"===e||""===e)return!0;if("false"===e)return!1;throw new i('\n "'+e+"\" is not a valid value for '"+t+'\'.\n The following values will evaluate to true: true, "true", "".\n The following values will evaluate to false: false, "false".\n ')});var r=t(function(e,t){if(null==e)throw new i("\n '"+t+'\' must not be "null" or "undefined".\n ');return e},{getter:!0}),o=t(function(e,t){if(e=+parseFloat(e),isNaN(e))throw new i("\n '"+t+"' must be a number.\n ");return e});e.EnsureError=i,e.dedent=u,e.Value=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n,r,u=(n=e,r=f.__read(n,1)[0],Array.isArray(r)?r:n),i=u.filter(function(e){return e.isGetter}),o=u.filter(function(e){return!e.isGetter});return function(e,r){Object.defineProperty(e,r,{get:function(){var t=this,n=Reflect.getMetadata(""+a+r,this);return i.forEach(function(e){e.call(t,n,r)}),n},set:function(e){var t=this,n=e;"null"===n&&(n=null),null!=n&&o.forEach(function(e){n=e.call(t,n,r)}),Reflect.defineMetadata(""+a+r,n,this)}})}},e.ensure=t,e.isBool=n,e.isEnum=function(u){return t(function(e,t){var n,r=u[e];if(null==r)throw new i('\n "'+e+"\" is not a valid value for '"+t+"'. You can use one of the following:\n "+(n=u,Object.keys(n).filter(function(e){return isNaN(+e)}).map(function(e){return'"'+e+'"'}).join(",\n "))+"\n ");return"number"==typeof r?r:e})},e.isNotNull=r,e.isNumber=o,Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("tslib")):"function"==typeof define&&define.amd?define("@trademe/ensure",["exports","tslib"],t):t((e.trademe=e.trademe||{},e.trademe.ensure={}),e.tslib)}(this,function(e,f){"use strict";var a=function(r){function e(e){var t=this.constructor,n=r.call(this,u(e))||this;return Object.setPrototypeOf(n,t.prototype),n}return f.__extends(e,r),e}(Error);function u(e){var t=e.split(/\n/),n=t.reduce(function(e,t){var n=t.search(/\S/);return n<0?e:n<e?n:e},Infinity);return t.map(function(e){return e.substr(n)}).join("\n")}var l="__value_";function s(e,t){return Object.defineProperty(e,"isGetter",{get:function(){return!!t&&t.getter}}),e}var t=s(function(e,t){if(!0===e||!1===e)return e;if("true"===e||""===e)return!0;if("false"===e)return!1;throw new a('\n "'+e+"\" is not a valid value for '"+t+'\'.\n The following values will evaluate to true: true, "true", "".\n The following values will evaluate to false: false, "false".\n ')});var n=s(function(e,t){if(null==e)throw new a("\n '"+t+'\' must not be "null" or "undefined".\n ');return e},{getter:!0}),r=s(function(e,t){if(e=+parseFloat(e),isNaN(e))throw new a("\n '"+t+"' must be a number.\n ");return e});e.EnsureError=a,e.dedent=u,e.Value=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n,r,u=(n=e,r=f.__read(n,1)[0],Array.isArray(r)?r:n),i=u.filter(function(e){return e.isGetter}),o=u.filter(function(e){return!e.isGetter});return function(e,r){Object.defineProperty(e,r,{get:function(){var t=this,n=Reflect.getMetadata(""+l+r,this);return i.forEach(function(e){e.call(t,n,r)}),n},set:function(e){var t=this,n=e;"null"===n&&(n=null),null!=n&&o.forEach(function(e){n=e.call(t,n,r)}),Reflect.defineMetadata(""+l+r,n,this)}})}},e.ensure=s,e.isBool=t,e.isEnum=function(u){var t,n,r,i,o=(t=u,n={},Object.keys(t).forEach(function(e){n[e]=t[e],n[t[e]]=e}),n),f=(r=u,i={},Object.keys(r).forEach(function(e){isNaN(parseInt(e,10))&&(i[e]=r[e])}),i);return s(function(e,t){var n,r=null!=f[e]?f[e]:f[o[e]];if(null==r)throw new a('\n "'+e+"\" is not a valid value for '"+t+"'. You can use one of the following:\n "+(n=u,Object.keys(n).filter(function(e){return isNaN(+e)}).map(function(e){return'"'+e+'"'}).join(",\n "))+"\n ");return r})},e.isNotNull=n,e.isNumber=r,Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=trademe-ensure.umd.min.js.map

@@ -22,3 +22,3 @@ /**

const /** @type {?} */ whitespaceCount = n.search(/\S/);
if (whitespaceCount <= 0) {
if (whitespaceCount < 0) {
return p;

@@ -32,2 +32,2 @@ }

//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW5zdXJlLWVycm9yLmpzIiwic291cmNlUm9vdCI6Im5nOi8vQHRyYWRlbWUvZW5zdXJlLyIsInNvdXJjZXMiOlsiZW5zdXJlLWVycm9yLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7QUFBQSxNQUFNLGtCQUFtQixTQUFRLEtBQUs7Ozs7SUFDbEMsWUFDSSxPQUFnQjtRQUVoQixLQUFLLENBQUMsTUFBTSxDQUFDLE9BQU8sQ0FBQyxDQUFDLENBQUM7UUFDdkIsTUFBTSxDQUFDLGNBQWMsQ0FBQyxJQUFJLEVBQUUsR0FBRyxDQUFDLE1BQU0sQ0FBQyxTQUFTLENBQUMsQ0FBQztLQUNyRDtDQUNKOzs7OztBQUVELE1BQU0saUJBQWtCLEdBQVc7SUFDL0IsdUJBQU0sS0FBSyxHQUFHLEdBQUcsQ0FBQyxLQUFLLENBQUMsSUFBSSxDQUFDLENBQUM7SUFDOUIsdUJBQU0sYUFBYSxHQUFHLEtBQUssQ0FBQyxNQUFNLENBQUMsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLEVBQUU7UUFDeEMsdUJBQU0sZUFBZSxHQUFHLENBQUMsQ0FBQyxNQUFNLENBQUMsSUFBSSxDQUFDLENBQUM7UUFDdkMsRUFBRSxDQUFDLENBQUMsZUFBZSxJQUFJLENBQUMsQ0FBQyxDQUFDLENBQUM7WUFDdkIsTUF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oaXBlU3BhY2UpKTtcbiAgICByZXR1cm4gbmV3TGluZXMuam9pbignXFxuJyk7XG59XG4iXX0=

@@ -13,6 +13,8 @@ /**

export function isEnum(enumValues) {
// This functions is explicitly *not* using the `=>` syntax so that
// the `this` values is bound to the instance being checked.
// Prepare the enum values so lookups work in both directions,
// with both number and string enums:
const /** @type {?} */ flipped = flipEnum(enumValues);
const /** @type {?} */ stripped = stripEnum(enumValues);
return ensure((value, key) => {
const /** @type {?} */ enumValue = enumValues[value];
const /** @type {?} */ enumValue = stripped[value] != null ? stripped[value] : stripped[flipped[value]];
if (enumValue == null) {

@@ -24,3 +26,3 @@ throw new EnsureError(`

}
return typeof enumValue === 'number' ? enumValue : value;
return enumValue;
});

@@ -33,2 +35,29 @@ }

*/
function flipEnum(enumT) {
const /** @type {?} */ flipped = {};
Object.keys(enumT).forEach(key => {
flipped[key] = enumT[key];
flipped[enumT[key]] = key;
});
return flipped;
}
/**
* @template T
* @param {?} enumT
* @return {?}
*/
function stripEnum(enumT) {
const /** @type {?} */ stripped = {};
Object.keys(enumT).forEach(key => {
if (isNaN(parseInt(key, 10))) {
stripped[key] = enumT[key];
}
});
return stripped;
}
/**
* @template T
* @param {?} enumT
* @return {?}
*/
function getValues(enumT) {

@@ -41,2 +70,2 @@ return Object.keys(enumT)

//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW51bS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0B0cmFkZW1lL2Vuc3VyZS8iLCJzb3VyY2VzIjpbImd1YXJkcy9lbnVtLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7QUFDQSxPQUFPLEVBQUUsV0FBVyxFQUFFLE1BQU0saUJBQWlCLENBQUM7QUFDOUMsT0FBTyxFQUFFLE1BQU0sRUFBUyxNQUFNLGdCQUFnQixDQUFDOzs7Ozs7QUFFL0MsTUFBTSxpQkFBc0IsVUFBYTs7O0lBR3JDLE1BQU0sQ0F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gZXhwbGljaXRseSAqbm90KiB1c2luZyB0aGUgYD0+YCBzeW50YXggc28gdGhhdFxuICAgIC8vIHRoZSBgdGhpc2AgdmFsdWVzIGlzIGJvdW5kIHRvIHRoZSBpbnN0YW5jZSBiZWluZyBjaGVja2VkLlxuICAgIHJldHVybiBlbnN1cmUoKHZhbHVlOiBhbnksIGtleTogc3RyaW5nKTogbnVtYmVyIHwgYW55ID0+IHtcbiAgICAgICAgY29uc3QgZW51bVZhbHVlID0gZW51bVZhbHVlc1t2YWx1ZV07XG4gICAgICAgIGlmIChlbnVtVmFsdWUgPT0gbnVsbCkge1xuICAgICAgICAgICAgdGhyb3cgbmV3IEVuc3VyZUVycm9yKGBcbiAgICAgICAgICAgICAgICBcIiR7dmFsdWV9XCIgaXMgbm90IGEgdmFsaWQgdmFsdWUgZm9yICcke2tleX0nLiBZb3UgY2FuIHVzZSBvbmUgb2YgdGhlIGZvbGxvd2luZzpcbiAgICAgICAgICAgICAgICAgICAgJHtnZXRWYWx1ZXM8VD4oZW51bVZhbHVlcyl9XG4gICAgICAgICAgICBgKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdHlwZW9mIGVudW1WYWx1ZSA9PT0gJ251bWJlcicgPyBlbnVtVmFsdWUgOiB2YWx1ZTtcbiAgICB9KTtcbn1cblxuZnVuY3Rpb24gZ2V0VmFsdWVzPFQ+IChlbnVtVDogVCk6IHN0cmluZyB7XG4gICAgcmV0dXJuIE9iamVjdC5rZXlzKGVudW1UKVxuICAgIC5maWx0ZXIoa2V5ID0+IGlzTmFOKCtrZXkpKVxuICAgIC5tYXAoa2V5ID0+IGBcIiR7a2V5fVwiYClcbiAgICAuam9pbignLFxcbiAgICAgICAgICAgICAgICAgICAgJyk7XG59XG4iXX0=
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW51bS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0B0cmFkZW1lL2Vuc3VyZS8iLCJzb3VyY2V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nN0IGZsaXBwZWQgPSB7fTtcbiAgICBPYmplY3Qua2V5cyhlbnVtVCkuZm9yRWFjaChrZXkgPT4ge1xuICAgICAgICBmbGlwcGVkW2tleV0gPSBlbnVtVFtrZXldO1xuICAgICAgICBmbGlwcGVkW2VudW1UW2tleV1dID0ga2V5O1xuICAgIH0pO1xuICAgIHJldHVybiBmbGlwcGVkO1xufVxuXG5mdW5jdGlvbiBzdHJpcEVudW0gPFQ+IChlbnVtVDogVCk6IHsgW2tleTogc3RyaW5nXTogYW55IH0ge1xuICAgIGNvbnN0IHN0cmlwcGVkID0ge307XG4gICAgT2JqZWN0LmtleXMoZW51bVQpLmZvckVhY2goa2V5ID0+IHtcbiAgICAgICAgaWYgKGlzTmFOKHBhcnNlSW50KGtleSwgMTApKSkge1xuICAgICAgICAgICAgc3RyaXBwZWRba2V5XSA9IGVudW1UW2tleV07XG4gICAgICAgIH1cbiAgICB9KTtcbiAgICByZXR1cm4gc3RyaXBwZWQ7XG59XG5cbmZ1bmN0aW9uIGdldFZhbHVlczxUPiAoZW51bVQ6IFQpOiBzdHJpbmcge1xuICAgIHJldHVybiBPYmplY3Qua2V5cyhlbnVtVClcbiAgICAuZmlsdGVyKGtleSA9PiBpc05hTigra2V5KSlcbiAgICAubWFwKGtleSA9PiBgXCIke2tleX1cImApXG4gICAgLmpvaW4oJyxcXG4gICAgICAgICAgICAgICAgICAgICcpO1xufVxuIl19

@@ -25,3 +25,3 @@ /**

var /** @type {?} */ whitespaceCount = n.search(/\S/);
if (whitespaceCount <= 0) {
if (whitespaceCount < 0) {
return p;

@@ -35,2 +35,2 @@ }

//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW5zdXJlLWVycm9yLmpzIiwic291cmNlUm9vdCI6Im5nOi8vQHRyYWRlbWUvZW5zdXJlLyIsInNvdXJjZXMiOlsiZW5zdXJlLWVycm9yLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0F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1xuICAgICkge1xuICAgICAgICBzdXBlcihkZWRlbnQobWVzc2FnZSkpO1xuICAgICAgICBPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcywgbmV3LnRhcmdldC5wcm90b3R5cGUpO1xuICAgIH1cbn1cblxuZXhwb3J0IGZ1bmN0aW9uIGRlZGVudCAoc3RyOiBzdHJpbmcpOiBzdHJpbmcge1xuICAgIGNvbnN0IGxpbmVzID0gc3RyLnNwbGl0KC9cXG4vKTtcbiAgICBjb25zdCBtaW5XaGlwZVNwYWNlID0gbGluZXMucmVkdWNlKChwLCBuKSA9PiB7XG4gICAgICAgIGNvbnN0IHdoaXRlc3BhY2VDb3VudCA9IG4uc2VhcmNoKC9cXFMvKTtcbiAgICAgICAgaWYgKHdoaXRlc3BhY2VDb3VudCA8IDApIHtcbiAgICAgICAgICAgIHJldHVybiBwO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB3aGl0ZXNwYWNlQ291bnQgPCBwID8gd2hpdGVzcGFjZUNvdW50IDogcDtcbiAgICB9LCBJbmZpbml0eSk7XG5cbiAgICBjb25zdCBuZXdMaW5lcyA9IGxpbmVzLm1hcChsID0+IGwuc3Vic3RyKG1pbldoaXBlU3BhY2UpKTtcbiAgICByZXR1cm4gbmV3TGluZXMuam9pbignXFxuJyk7XG59XG4iXX0=

@@ -13,10 +13,12 @@ /**

export function isEnum(enumValues) {
// This functions is explicitly *not* using the `=>` syntax so that
// the `this` values is bound to the instance being checked.
// Prepare the enum values so lookups work in both directions,
// with both number and string enums:
var /** @type {?} */ flipped = flipEnum(enumValues);
var /** @type {?} */ stripped = stripEnum(enumValues);
return ensure(function (value, key) {
var /** @type {?} */ enumValue = enumValues[value];
var /** @type {?} */ enumValue = stripped[value] != null ? stripped[value] : stripped[flipped[value]];
if (enumValue == null) {
throw new EnsureError("\n \"" + value + "\" is not a valid value for '" + key + "'. You can use one of the following:\n " + getValues(enumValues) + "\n ");
}
return typeof enumValue === 'number' ? enumValue : value;
return enumValue;
});

@@ -29,2 +31,29 @@ }

*/
function flipEnum(enumT) {
var /** @type {?} */ flipped = {};
Object.keys(enumT).forEach(function (key) {
flipped[key] = enumT[key];
flipped[enumT[key]] = key;
});
return flipped;
}
/**
* @template T
* @param {?} enumT
* @return {?}
*/
function stripEnum(enumT) {
var /** @type {?} */ stripped = {};
Object.keys(enumT).forEach(function (key) {
if (isNaN(parseInt(key, 10))) {
stripped[key] = enumT[key];
}
});
return stripped;
}
/**
* @template T
* @param {?} enumT
* @return {?}
*/
function getValues(enumT) {

@@ -37,2 +66,2 @@ return Object.keys(enumT)

//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW51bS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0B0cmFkZW1lL2Vuc3VyZS8iLCJzb3VyY2VzIjpbImd1YXJkcy9lbnVtLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7QUFDQSxPQUFPLEVBQUUsV0FBVyxFQUFFLE1BQU0saUJBQWlCLENBQUM7QUFDOUMsT0FBTyxFQUFFLE1BQU0sRUFBUyxNQUFNLGdCQUFnQixDQUFDOzs7Ozs7QUFFL0MsTUFBTSxpQkFBc0IsVUFBYTs7O0lBR3JDLE1BQU0sQ0FBQyxNQUFNLENBQUMsVUFBQyxLQUFVLEVBQUUsR0FBVztRQUNsQyxxQkFBTSxTQUFTLEdBQUcsVUFBVSxDQUFDLEtBQUssQ0FBQyxDQUFDO1FBQ3BDLEVBQUUsQ0FBQyxDQUFDLFNBQVMsSUFBSSxJQUFJLENBQUMsQ0FBQyxDQUFDO1lBQ3BCLE1BQU0sSUFBSSxXQUFXLENBQUMseUJBQ2YsS0FBSyxxQ0FBK0IsR0FBRyxrRUFDcEMsU0FBUyxDQUFJLFVBQVUsQ0FBQyxtQkFDakMsQ0FBQyxDQUFDO1NBQ047UUFDRCxNQUFNLENBQUMsT0FBTyxTQUFTLEtBQUssUUFBUSxDQUFDLENBQUMsQ0FBQ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cbiAgICAgICAgaWYgKGlzTmFOKHBhcnNlSW50KGtleSwgMTApKSkge1xuICAgICAgICAgICAgc3RyaXBwZWRba2V5XSA9IGVudW1UW2tleV07XG4gICAgICAgIH1cbiAgICB9KTtcbiAgICByZXR1cm4gc3RyaXBwZWQ7XG59XG5cbmZ1bmN0aW9uIGdldFZhbHVlczxUPiAoZW51bVQ6IFQpOiBzdHJpbmcge1xuICAgIHJldHVybiBPYmplY3Qua2V5cyhlbnVtVClcbiAgICAuZmlsdGVyKGtleSA9PiBpc05hTigra2V5KSlcbiAgICAubWFwKGtleSA9PiBgXCIke2tleX1cImApXG4gICAgLmpvaW4oJyxcXG4gICAgICAgICAgICAgICAgICAgICcpO1xufVxuIl19

@@ -22,3 +22,3 @@ /**

const /** @type {?} */ whitespaceCount = n.search(/\S/);
if (whitespaceCount <= 0) {
if (whitespaceCount < 0) {
return p;

@@ -130,6 +130,8 @@ }

function isEnum(enumValues) {
// This functions is explicitly *not* using the `=>` syntax so that
// the `this` values is bound to the instance being checked.
// Prepare the enum values so lookups work in both directions,
// with both number and string enums:
const /** @type {?} */ flipped = flipEnum(enumValues);
const /** @type {?} */ stripped = stripEnum(enumValues);
return ensure((value, key) => {
const /** @type {?} */ enumValue = enumValues[value];
const /** @type {?} */ enumValue = stripped[value] != null ? stripped[value] : stripped[flipped[value]];
if (enumValue == null) {

@@ -141,3 +143,3 @@ throw new EnsureError(`

}
return typeof enumValue === 'number' ? enumValue : value;
return enumValue;
});

@@ -150,2 +152,29 @@ }

*/
function flipEnum(enumT) {
const /** @type {?} */ flipped = {};
Object.keys(enumT).forEach(key => {
flipped[key] = enumT[key];
flipped[enumT[key]] = key;
});
return flipped;
}
/**
* @template T
* @param {?} enumT
* @return {?}
*/
function stripEnum(enumT) {
const /** @type {?} */ stripped = {};
Object.keys(enumT).forEach(key => {
if (isNaN(parseInt(key, 10))) {
stripped[key] = enumT[key];
}
});
return stripped;
}
/**
* @template T
* @param {?} enumT
* @return {?}
*/
function getValues(enumT) {

@@ -204,2 +233,2 @@ return Object.keys(enumT)

//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJhZGVtZS1lbnN1cmUuanMubWFwIiwic291cmNlcyI6WyJuZzovL0B0cmFkZW1lL2Vuc3VyZS9lbnN1cmUtZXJyb3IudHMiLCJuZzovL0B0cmFkZW1lL2Vuc3VyZS92YWx1ZS92YWx1ZS50cyIsIm5nOi8vQHRyYWRlbWUvZW5zdXJlL2d1YXJkL2d1YXJkLnRzIiwibmc6Ly9AdHJhZGVtZS9lbnN1cmUvZ3VhcmRzL2Jvb2wudHMiLCJuZzovL0B0cmFkZW1lL2Vuc3VyZS9ndWFyZHMvZW51bS50cyIsIm5nOi8vQHRyYWRlbWUvZW5zdXJlL2d1YXJkcy9ub3QtbnVsbC50cyIsIm5nOi8vQHRyYWRlbWUvZW5zdXJlL2d1YXJkcy9udW1iZXIudHMiXSwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGNsYXNzIEVuc3VyZUVycm9yIGV4dGVuZHMgRXJyb3Ige1xuICAgIGNvbnN0cnVjdG9yKFxuICAgICAgICBtZXNzYWdlPzogc3RyaW5nXG4gICAgKSB7XG4gICAgICAgIHN1cGVyKGRlZGVudChtZXNzYWdlKSk7XG4gICAgICAgIE9iamVjdC5zZXRQcm90b3R5cGVPZih0aGlzLCBuZXcudGFyZ2V0LnByb3RvdHlwZSk7XG4gICAgfVxufVxuXG5leHBvcnQgZnVuY3Rpb24gZGVkZW50IChzdHI6IHN0cmluZyk6IHN0cmluZyB7XG4gICAgY29uc3QgbGluZXMgPSBzdHIuc3BsaXQoL1xcbi8pO1xuICAgIGNvbnN0IG1pbldoaXBlU3BhY2UgPSBsaW5lcy5yZWR1Y2UoKHAsIG4pID0+IHtcbiAgICAgICAgY29uc3Qgd2hpdGVzcGFjZUNvdW50ID0gbi5zZWFyY2goL1xcUy8pO1xuICAgICAgICBpZiAod2hpdGVzcGFjZUNv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dWUgPSAoUmVmbGVjdCBhcyBhbnkpLmdldE1ldGFkYXRhKGAke1ZBTFVFX0tFWX0ke3Byb3BlcnR5S2V5fWAsIHRoaXMpO1xuICAgICAgICAgICAgICAgIGdldHRlcnMuZm9yRWFjaChnZXR0ZXIgPT4ge1xuICAgICAgICAgICAgICAgICAgICBnZXR0ZXIuY2FsbCh0aGlzLCB2YWx1ZSwgcHJvcGVydHlLZXkpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIHJldHVybiB2YWx1ZTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBzZXQ6IGZ1bmN0aW9uICh2YWx1ZSkge1xuICAgICAgICAgICAgICAgIGxldCBjYXN0VmFsdWUgPSB2YWx1ZTtcblxuICAgICAgICAgICAgICAgIGlmIChjYXN0VmFsdWUgPT09ICdudWxsJykge1xuICAgICAgICAgICAgICAgICAgICBjYXN0VmFsdWUgPSBudWxsO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGlmIChjYXN0VmFsdWUgIT0gbnVsbCkge1xuICAgICAgICAgICAgICAgICAgICBzZXR0ZXJzLmZvckVhY2goc2V0dGVyID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc3RWYWx1ZSA9IHNldHRlci5jYWxsKHRoaXMsIGNhc3RWYWx1ZSwgcHJvcGVydHlLZXkpO1xuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgKFJlZmxlY3QgYXMgYW55KS5kZWZpbmVNZXRhZGF0YShgJHtWQUxVRV9LRVl9JHtwcm9wZXJ0eUtleX1gLCBjYXN0VmFsdWUsIHRoaXMpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICB9O1xufVxuXG5mdW5jdGlvbiBnZXRHdWFyZHNBcnJheSAoZ3VhcmRzOiBBcnJheTxHdWFyZDxhbnk+IHwgQXJyYXk8R3VhcmQ8YW55Pj4+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cHJvcGVydHlLZXl9YCwgdGhpcyk7XG4gICAgICAgICAgICAgICAgZ2V0dGVycy5mb3JFYWNoKGdldHRlciA9PiB7XG4gICAgICAgICAgICAgICAgICAgIGdldHRlci5jYWxsKHRoaXMsIHZhbHVlLCBwcm9wZXJ0eUtleSk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHZhbHVlO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHNldDogZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgICAgICAgICAgbGV0IGNhc3RWYWx1ZSA9IHZhbHVlO1xuXG4gICAgICAgICAgICAgICAgaWYgKGNhc3RWYWx1ZSA9PT0gJ251bGwnKSB7XG4gICAgICAgICAgICAgICAgICAgIGNhc3RWYWx1ZSA9IG51bGw7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgaWYgKGNhc3RWYWx1ZSAhPSBudWxsKSB7XG4gICAgICAgICAgICAgICAgICAgIHNldHRlcnMuZm9yRWFjaChzZXR0ZXIgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgY2FzdFZhbHVlID0gc2V0dGVyLmNhbGwodGhpcywgY2FzdFZhbHVlLCBwcm9wZXJ0eUtleSk7XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAoUmVmbGVjdCBhcyBhbnkpLmRlZmluZU1ldGFkYXRhKGAke1ZBTFVFX0tFWX0ke3Byb3BlcnR5S2V5fWAsIGNhc3RWYWx1ZSwgdGhpcyk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgIH07XG59XG5cbmZ1bmN0aW9uIGdldEd1YXJkc0FycmF5IChndWFyZHM6IEFycmF5PEd1YXJkPGFueT4gfCBBcnJheTxHdWFyZDxhbnk+Pj4pOiBBcnJheTxHdWFyZDxhbnk+PiB7XG4gICAgLy8gSGFuZGxlIG9sZCBAVmFsdW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EdBQUc7U0FDVCxDQUFDLENBQUM7S0FDTjtJQUNELE9BQU8sS0FBSyxDQUFDO0NBQ2hCLEVBQUU7SUFDQyxNQUFNLEVBQUUsSUFBSTtDQUNmLENBQUM7Ozs7OztBQ1pGLHVCQUdhLFFBQVEsR0FBRyxNQUFNLENBQUMsQ0FBQyxLQUFVLEVBQUUsR0FBVztJQUNuRCxLQUFLLEdBQUcsQ0FBQyxVQUFVLENBQUMsS0FBSyxDQUFDLENBQUM7SUFDM0IsSUFBSSxLQUFLLENBQUMsS0FBSyxDQUFDLEVBQUU7UUFDZCxNQUFNLElBQUksV0FBVyxDQUFDO2VBQ2YsR0FBRztTQUNULENBQUMsQ0FBQztLQUNOO0lBQ0QsT0FBTyxLQUFLLENBQUM7Q0FDaEIsQ0FBQzs7Ozs7Ozs7Ozs7Ozs7Ozs7OzsifQ==

@@ -25,3 +25,3 @@ import { __extends, __read } from 'tslib';

var /** @type {?} */ whitespaceCount = n.search(/\S/);
if (whitespaceCount <= 0) {
if (whitespaceCount < 0) {
return p;

@@ -135,10 +135,12 @@ }

function isEnum(enumValues) {
// This functions is explicitly *not* using the `=>` syntax so that
// the `this` values is bound to the instance being checked.
// Prepare the enum values so lookups work in both directions,
// with both number and string enums:
var /** @type {?} */ flipped = flipEnum(enumValues);
var /** @type {?} */ stripped = stripEnum(enumValues);
return ensure(function (value, key) {
var /** @type {?} */ enumValue = enumValues[value];
var /** @type {?} */ enumValue = stripped[value] != null ? stripped[value] : stripped[flipped[value]];
if (enumValue == null) {
throw new EnsureError("\n \"" + value + "\" is not a valid value for '" + key + "'. You can use one of the following:\n " + getValues(enumValues) + "\n ");
}
return typeof enumValue === 'number' ? enumValue : value;
return enumValue;
});

@@ -151,2 +153,29 @@ }

*/
function flipEnum(enumT) {
var /** @type {?} */ flipped = {};
Object.keys(enumT).forEach(function (key) {
flipped[key] = enumT[key];
flipped[enumT[key]] = key;
});
return flipped;
}
/**
* @template T
* @param {?} enumT
* @return {?}
*/
function stripEnum(enumT) {
var /** @type {?} */ stripped = {};
Object.keys(enumT).forEach(function (key) {
if (isNaN(parseInt(key, 10))) {
stripped[key] = enumT[key];
}
});
return stripped;
}
/**
* @template T
* @param {?} enumT
* @return {?}
*/
function getValues(enumT) {

@@ -201,2 +230,2 @@ return Object.keys(enumT)

//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJhZGVtZS1lbnN1cmUuanMubWFwIiwic291cmNlcyI6WyJuZzovL0B0cmFkZW1lL2Vuc3VyZS9lbnN1cmUtZXJyb3IudHMiLCJuZzovL0B0cmFkZW1lL2Vuc3VyZS92YWx1ZS92YWx1ZS50cyIsIm5nOi8vQHRyYWRlbWUvZW5zdXJlL2d1YXJkL2d1YXJkLnRzIiwibmc6Ly9AdHJhZGVtZS9lbnN1cmUvZ3VhcmRzL2Jvb2wudHMiLCJuZzovL0B0cmFkZW1lL2Vuc3VyZS9ndWFyZHMvZW51bS50cyIsIm5nOi8vQHRyYWRlbWUvZW5zdXJlL2d1YXJkcy9ub3QtbnVsbC50cyIsIm5nOi8vQHRyYWRlbWUvZW5zdXJlL2d1YXJkcy9udW1iZXIudHMiXSwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGNsYXNzIEVuc3VyZUVycm9yIGV4dGVuZHMgRXJyb3Ige1xuICAgIGNvbnN0cnVjdG9yKFxuICAgICAgICBtZXNzYWdlPzogc3RyaW5nXG4gICAgKSB7XG4gICAgICAgIHN1cGVyKGRlZGVudChtZXNzYWdlKSk7XG4gICAgICAgIE9iamVjdC5zZXRQcm90b3R5cGVPZih0aGlzLCBuZXcudGFyZ2V0LnByb3RvdHlwZSk7XG4gICAgfVxufVxuXG5leHBvcnQgZnVuY3Rpb24gZGVkZW50IChzdHI6IHN0cmluZyk6IHN0cmluZyB7XG4gICAgY29uc3QgbGluZXMgPSBzdHIuc3BsaXQoL1xcbi8pO1xuICAgIGNvbnN0IG1pbldoaXBlU3BhY2UgPSBsa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mplY3QuZGVmaW5lUHJvcGVydHkodGFyZ2V0LCBwcm9wZXJ0eUtleSwge1xuICAgICAgICAgICAgZ2V0OiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgY29uc3QgdmFsdWUgPSAoUmVmbGVjdCBhcyBhbnkpLmdldE1ldGFkYXRhKGAke1ZBTFVFX0tFWX0ke3Byb3BlcnR5S2V5fWAsIHRoaXMpO1xuICAgICAgICAgICAgICAgIGdldHRlcnMuZm9yRWFjaChnZXR0ZXIgPT4ge1xuICAgICAgICAgICAgICAgICAgICBnZXR0ZXIuY2FsbCh0aGlzLCB2YWx1ZSwgcHJvcGVydHlLZXkpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIHJldHVybiB2YWx1ZTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBzZXQ6IGZ1bmN0aW9uICh2YWx1ZSkge1xuICAgICAgICAgICAgICAgIGxldCBjYXN0VmFsdWUgPSB2YWx1ZTtcblxuICAgICAgICAgICAgICAgIGlmIChjYXN0VmFsdWUgPT09ICdudWxsJykge1xuICAgICAgICAgICAgICAgICAgICBjYXN0VmFsdWUgPSBudWxsO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGlmIChjYXN0VmFsdWUgIT0gbnVsbCkge1xuICAgICAgICAgICAgICAgICAgICBzZXR0ZXJzLmZvckVhY2goc2V0dGVyID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc3RWYWx1ZSA9IHNldHRlci5jYWxsKHRoaXMsIGNhc3RWYWx1ZSwgcHJvcGVydHlLZXkpO1xuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgKFJlZmxlY3QgYXMgYW55KS5kZWZpbmVNZXRhZGF0YShgJHtWQUxVRV9LRVl9JHtwcm9wZXJ0eUtleX1gLCBjYXN0VmFsdWUsIHRoaXMpO1xuICAgICAgICAgICAgfVxu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MuaXNHZXR0ZXIpO1xuICAgIGNvbnN0IHNldHRlcnMgPSBndWFyZHNBcnJheS5maWx0ZXIoYyA9PiAhYy5pc0dldHRlcik7XG5cbiAgICByZXR1cm4gKHRhcmdldDogYW55LCBwcm9wZXJ0eUtleTogc3RyaW5nKSA9PiB7XG4gICAgICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eSh0YXJnZXQsIHByb3BlcnR5S2V5LCB7XG4gICAgICAgICAgICBnZXQ6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICBjb25zdCB2YWx1ZSA9IChSZWZsZWN0IGFzIGFueSkuZ2V0TWV0YWRhdGEoYCR7VkFMVUVfS0VZfSR7cHJvcGVydHlLZXl9YCwgdGhpcyk7XG4gICAgICAgICAgICAgICAgZ2V0dGVycy5mb3JFYWNoKGdldHRlciA9PiB7XG4gICAgICAgICAgICAgICAgICAgIGdldHRlci5jYWxsKHRoaXMsIHZhbHVlLCBwcm9wZXJ0eUtleSk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHZhbHVlO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHNldDogZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgICAgICAgICAgbGV0IGNhc3RWYWx1ZSA9IHZhbHVlO1xuXG4gICAgICAgICAgICAgICAgaWYgKGNhc3RWYWx1ZSA9PT0gJ251bGwnKSB7XG4gICAgICAgICAgICAgICAgICAgIGNhc3RWYWx1ZSA9IG51bGw7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgaWYgKGNhc3RWYWx1ZSAhPSBudWxsKSB7XG4gICAgICAgICAgICAgICAgICAgIHNldHRlcnMuZm9yRWFjaChzZXR0ZXIgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgY2FzdFZhbHVlID0gc2V0dGVyLmNhbGwodGhpcywgY2FzdFZhbHVlLCBwcm9wZXJ0eUtleSk7XG4gICAgICAgIC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ozs7In0=
{
"name": "@trademe/ensure",
"version": "0.2.0-beta.2",
"version": "0.2.0-beta.3",
"peerDependencies": {

@@ -5,0 +5,0 @@ "@angular/common": "^6.0.0-rc.0 || ^6.0.0",

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

{"__symbolic":"module","version":4,"metadata":{"EnsureError":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"Error"},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"}]}]}},"dedent":{"__symbolic":"function"},"Value":{"__symbolic":"function"},"GuardFunction":{"__symbolic":"interface"},"Guard":{"__symbolic":"interface"},"ensure":{"__symbolic":"function"},"isBool":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"ensure"},"arguments":[{"__symbolic":"error","message":"Lambda not supported","line":4,"character":29,"module":"./guards/bool"}]},"isEnum":{"__symbolic":"function","parameters":["enumValues"],"value":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"ensure"},"arguments":[{"__symbolic":"error","message":"Lambda not supported","line":7,"character":18,"module":"./guards/enum"}]}},"isNotNull":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"ensure"},"arguments":[{"__symbolic":"error","message":"Lambda not supported","line":4,"character":32,"module":"./guards/not-null"},{"getter":true}]},"isNumber":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"ensure"},"arguments":[{"__symbolic":"error","message":"Lambda not supported","line":4,"character":31,"module":"./guards/number"}]}},"origins":{"EnsureError":"./ensure-error","dedent":"./ensure-error","Value":"./value/value","GuardFunction":"./guard/guard","Guard":"./guard/guard","ensure":"./guard/guard","isBool":"./guards/bool","isEnum":"./guards/enum","isNotNull":"./guards/not-null","isNumber":"./guards/number"},"importAs":"@trademe/ensure"}
{"__symbolic":"module","version":4,"metadata":{"EnsureError":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"Error"},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"}]}]}},"dedent":{"__symbolic":"function"},"Value":{"__symbolic":"function"},"GuardFunction":{"__symbolic":"interface"},"Guard":{"__symbolic":"interface"},"ensure":{"__symbolic":"function"},"isBool":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"ensure"},"arguments":[{"__symbolic":"error","message":"Lambda not supported","line":4,"character":29,"module":"./guards/bool"}]},"isEnum":{"__symbolic":"function"},"isNotNull":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"ensure"},"arguments":[{"__symbolic":"error","message":"Lambda not supported","line":4,"character":32,"module":"./guards/not-null"},{"getter":true}]},"isNumber":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"ensure"},"arguments":[{"__symbolic":"error","message":"Lambda not supported","line":4,"character":31,"module":"./guards/number"}]}},"origins":{"EnsureError":"./ensure-error","dedent":"./ensure-error","Value":"./value/value","GuardFunction":"./guard/guard","Guard":"./guard/guard","ensure":"./guard/guard","isBool":"./guards/bool","isEnum":"./guards/enum","isNotNull":"./guards/not-null","isNumber":"./guards/number"},"importAs":"@trademe/ensure"}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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