diff --git a/dist/main.es.js b/dist/main.es.js index 28b541c..54c35b1 100644 --- a/dist/main.es.js +++ b/dist/main.es.js @@ -787,6 +787,52 @@ function dateEquals(data, expected) { return (convertedData === convertedExpectation); } +/** + * Matching after a specific date and time + * + * @since 4.11.0 + * @category Date + * @param {Date} data The value to be compared. + * @param {Date} expected The expected value. + * @returns {boolean} Returns `true` if `value` is after than `expected value`. + * @example + * ```javascript + * dateGreaterThan('December 17, 1994 03:24:00', 'December 16, 1994 03:24:00') + * // => true + * + * dateGreaterThan('December 15, 2000 03:24:00', 'December 15, 2000 03:24:00') + * // => false + * ``` + */ +function dateGreaterThan(data, expected) { + const convertedData = convertDate(data); + const convertedExpectation = convertDate(expected); + return convertedData > convertedExpectation; +} + +/** + * Matching at or after a specific date and time + * + * @since 4.11.0 + * @category Date + * @param {Date} data The value to be compared. + * @param {Date} expected The expected value. + * @returns {boolean} Returns `true` if `value` is after than or equals `expected value`. + * @example + * ```javascript + * dateGreaterThanEquals('December 17, 1994 03:24:00', 'December 16, 1994 03:24:00') + * // => true + * + * dateGreaterThanEquals('December 15, 2000 03:24:00', 'December 15, 2000 03:25:00') + * // => false + * ``` + */ +function dateGreaterThanEquals(data, expected) { + const convertedData = convertDate(data); + const convertedExpectation = convertDate(expected); + return convertedData >= convertedExpectation; +} + /** * Matching before a specific date and time * @@ -1090,6 +1136,8 @@ function stringNotEqualsIgnoreCase(data, expected) { const operators = { bool, dateEquals, + dateGreaterThan, + dateGreaterThanEquals, dateLessThan, dateLessThanEquals, dateNotEquals, diff --git a/dist/main.es.js.map b/dist/main.es.js.map index d1e936a..4708a85 100644 --- a/dist/main.es.js.map +++ b/dist/main.es.js.map @@ -1 +1 @@ -{"version":3,"file":"main.es.js","sources":["../src/utils/getTag.ts","../src/utils/isSymbol.ts","../src/utils/toKey.ts","../src/utils/isKey.ts","../src/utils/memoize.ts","../src/utils/memoizeCapped.ts","../src/utils/stringToPath.ts","../src/utils/getValueFromPath.ts","../src/utils/applyContext.ts","../src/utils/decomposeString.ts","../src/utils/braceExpand.ts","../src/Matcher.ts","../src/utils/mersenneTwister.ts","../src/utils/generateUUID.ts","../src/conditionOperators/boolean/bool.ts","../src/conditionOperators/date/convertDate.ts","../src/conditionOperators/date/dateEquals.ts","../src/conditionOperators/date/dateLessThan.ts","../src/conditionOperators/date/dateLessThanEquals.ts","../src/conditionOperators/date/dateNotEquals.ts","../src/conditionOperators/numeric/numericEquals.ts","../src/conditionOperators/numeric/numericGreaterThan.ts","../src/conditionOperators/numeric/numericGreaterThanEquals.ts","../src/conditionOperators/numeric/numericLessThan.ts","../src/conditionOperators/numeric/numericLessThanEquals.ts","../src/conditionOperators/numeric/numericNotEquals.ts","../src/conditionOperators/string/stringEquals.ts","../src/conditionOperators/string/stringEqualsIgnoreCase.ts","../src/conditionOperators/string/stringLike.ts","../src/conditionOperators/string/stringNotEquals.ts","../src/conditionOperators/string/stringNotEqualsIgnoreCase.ts","../src/conditionOperators/index.ts","../src/Statement.ts","../src/ActionBasedStatement.ts","../src/IdentityBasedStatement.ts","../src/ResourceBasedStatement.ts","../src/Policy.ts","../src/ActionBasedPolicy.ts","../src/IdentityBasedPolicy.ts","../src/ResourceBasedPolicy.ts"],"sourcesContent":["/**\n * Gets the `toStringTag` of `value`.\n *\n * @since 3.1.0\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n * @example\n * ```javascript\n * getTag(1)\n * // => '[object Number]'\n *\n * getTag(null)\n * // => '[object Null]'\n * ```\n */\nexport function getTag(value: unknown): string {\n return Object.prototype.toString.call(value);\n}\n","import { getTag } from './getTag';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @since 3.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n * ```javascript\n * isSymbol(Symbol())\n * // => true\n *\n * isSymbol('abc')\n * // => false\n * ```\n */\nexport function isSymbol(value?: unknown): value is symbol {\n const type = typeof value;\n return (\n type === 'symbol' ||\n (type === 'object' && value !== null && getTag(value) === '[object Symbol]')\n );\n}\n","import { isSymbol } from './isSymbol';\n\n/** Used as references for various `Number` constants. */\nconst INFINITY = 1 / 0;\n\n/**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @since 3.1.0\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n * @example\n *\n * toKey(Symbol.iterator)\n * // => true\n *\n * toKey('abc')\n * // => false\n */\nexport function toKey(value: unknown): string | symbol {\n if (typeof value === 'string' || isSymbol(value)) {\n return value;\n }\n\n return value === 0 && 1 / value === -INFINITY ? '-0' : `${value}`;\n}\n","import { isSymbol } from './isSymbol';\n\n/** Used to match property names within property paths. */\nconst reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/;\nconst reIsPlainProp = /^\\w*$/; //matches any word character (alphanumeric and underscore)\n\n/**\n * Checks if `value` is a property name and not a property path.\n *\n * @since 3.1.0\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n * @example\n * ```javascript\n * isKey(1)\n * // => true\n *\n * isKey('example[test]')\n * // => false\n *\n * isKey('a.b')\n * // => false\n *\n * const obj = {\n * '[a]': 5,\n * 'b.c': true\n * };\n *\n * isKey('[a]', obj)\n * // => true\n *\n * isKey('b.c', obj)\n * // => true\n * ```\n */\nexport function isKey(value: unknown, object?: T): boolean {\n const type = typeof value;\n if (\n type === 'number' ||\n type === 'boolean' ||\n value === null ||\n value === undefined ||\n isSymbol(value)\n ) {\n return true;\n }\n if (typeof value === 'string') {\n return (\n reIsPlainProp.test(value) ||\n !reIsDeepProp.test(value) ||\n (object !== null && value in Object(object))\n );\n }\n return false;\n}\n","import { MemoizeInterface } from '../types';\n\n/**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * @since 3.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n * ```javascript\n * const object = { 'a': 1, 'b': 2 }\n * const other = { 'c': 3, 'd': 4 }\n *\n * const values = memoize(values)\n * values(object)\n * // => [1, 2]\n *\n * values(other)\n * // => [3, 4]\n *\n * object.a = 2\n * values(object)\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b'])\n * values(object)\n * // => ['a', 'b']\n * ```\n */\nexport function memoize(\n func: (...args: unknown[]) => any,\n resolver?: (...args: unknown[]) => any\n): MemoizeInterface {\n const memoized = function (\n this: (...args: unknown[]) => any,\n ...args: unknown[]\n ): MemoizeInterface {\n const key = resolver ? resolver.apply(this, args) : args[0];\n const cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n const result = func.apply(this, args);\n cache.set(key, result);\n return result;\n };\n memoized.cache = new Map();\n return memoized;\n}\n\n/*const memoize = (fn: Function): Function => {\n const cache = {};\n return (...args): any => {\n const stringifiedArgs = JSON.stringify(args);\n const result = (cache[stringifiedArgs] =\n typeof cache[stringifiedArgs] === 'undefined'\n ? fn(...args)\n : cache[stringifiedArgs]);\n return result;\n };\n};*/\n","import { memoize } from './memoize';\nimport { MemoizeInterface } from '../types';\n\n/** Used as the maximum memoize cache size. */\nexport const MAX_MEMOIZE_SIZE = 500;\n\n/**\n * A specialized version of `memoize` which clears the memoized function's\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n *\n * @since 3.1.0\n * @private\n * @param {Function} func The function to have its output memoized.\n * @returns {Function} Returns the new memoized function.\n */\nexport function memoizeCapped(\n func: (...args: any) => unknown\n): MemoizeInterface {\n const result = memoize(func, (key: unknown) => {\n const { cache } = result;\n if (cache.size === MAX_MEMOIZE_SIZE) {\n cache.clear();\n }\n return key;\n });\n\n return result;\n}\n","import { memoizeCapped } from './memoizeCapped';\n\nconst charCodeOfDot = '.'.charCodeAt(0);\nconst reEscapeChar = /\\\\(\\\\)?/g;\nconst rePropName = RegExp(\n // Match anything that isn't a dot or bracket.\n '[^.[\\\\]]+' +\n '|' +\n // Or match property names within brackets.\n '\\\\[(?:' +\n // Match a non-string expression.\n '([^\"\\'][^[]*)' +\n '|' +\n // Or match strings (supports escaping characters).\n '([\"\\'])((?:(?!\\\\x02)[^\\\\\\\\]|\\\\\\\\.)*?)\\\\x02' +\n ')\\\\]' +\n '|' +\n // Or match \"\" as the space between consecutive dots or empty brackets.\n '(?=(?:\\\\.|\\\\[\\\\])(?:\\\\.|\\\\[\\\\]|$))',\n 'g'\n);\n\n/**\n * Converts `string` to a property path array.\n *\n * @since 3.1.0\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\nexport const stringToPath = memoizeCapped((string: string) => {\n const result = [];\n if (string.charCodeAt(0) === charCodeOfDot) {\n result.push('');\n }\n string.replace(\n rePropName,\n (\n match: string,\n expression: string,\n quote: string,\n subString: string\n ): string => {\n let key = match;\n if (quote) {\n key = subString.replace(reEscapeChar, '$1');\n } else if (expression) {\n key = expression.trim();\n }\n result.push(key);\n return '';\n }\n );\n return result;\n});\n","import { toKey } from './toKey';\nimport { isKey } from './isKey';\nimport { stringToPath } from './stringToPath';\n\n/**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {Object} [object] The object to query keys on.\n * @returns {Array} Returns the cast property path array.\n */\nexport function castPath(\n value: unknown,\n object: U\n): Array {\n if (Array.isArray(value)) {\n return value;\n }\n\n return isKey(value, object) ? [value] : stringToPath(value);\n}\n\n/**\n * The base implementation of `get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\nexport function baseGet(\n object: U,\n path: Array | string\n): any {\n const newPath = castPath(path, object);\n\n let index = 0;\n const length = newPath.length;\n\n let value: any = object;\n while (value instanceof Object && index < length) {\n value = value[toKey(newPath[index++])];\n }\n\n return index && index === length ? value : undefined;\n}\n\n/**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @since 3.1.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * const object = { 'a': [{ 'b': { 'c': 3 } }] }\n *\n * getValueFromPath(object, 'a[0].b.c')\n * // => 3\n *\n * getValueFromPath(object, ['a', '0', 'b', 'c'])\n * // => 3\n *\n * getValueFromPath(object, 'a.b.c', 'default')\n * // => 'default'\n */\nexport function getValueFromPath(\n object: U,\n path: Array | string,\n defaultValue?: unknown\n): any {\n const result = object === null ? undefined : baseGet(object, path);\n\n return result === undefined ? defaultValue : result;\n}\n","import { getValueFromPath } from './getValueFromPath';\n\nconst reDelimiters = /\\${([^}]*)}/g;\nconst trim = / +(?= )|^\\s+|\\s+$/g;\n\nconst specialTrim = (str: string): string => str.replace(trim, '');\n\n/**\n * Apply the context value in a string.\n *\n * @param {string} str Pattern string, containing context path.\n * @param {object} context Object to get values from path.\n * @returns {string} Returns a string with embedded context values.\n * @example\n * ```javascript\n * const context = {\n * user: { id: 456, bestFriends: [123, 532, 987] }\n * };\n * applyContext('secrets:${user.id}:*', context)\n * // => 'secrets:456:*'\n *\n * applyContext('secrets:${user.bestFriends}:*', context)\n * // => 'secrets:{123,532,987}:*'\n *\n * applyContext('secrets:${company.address}:account', context)\n * // => 'secrets:undefined:account'\n * ```\n */\nexport function applyContext(\n str: string,\n context?: T\n): string {\n if (!context) return str;\n\n return specialTrim(\n str.replace(reDelimiters, (_, path: string) => {\n const value = getValueFromPath(context, path);\n if (Array.isArray(value)) return `{${value}}`;\n if (value instanceof Object) return 'undefined';\n\n return String(value);\n })\n );\n}\n","import { DecomposeString } from '../types';\n\n/**\n * Get index range where separators are found.\n *\n * @private\n * @since 3.1.1\n * @param {string} initialSeparator First string to be found.\n * @param {string} finalSeparator Second string to be found.\n * @param {string} str String to be decomposed.\n * @returns {number[]} Returns the beginning and final index for those matches.\n * @example\n * ```javascript\n * getIndexRange('first', 'Second', 'firstAndSecond')\n * // => [0, 8]\n *\n * getIndexRange('First', 'Second', '++FirstAndSecond**')\n * // => [2, 10]\n * ```\n */\nfunction getIndexRange(\n initialSeparator: string,\n finalSeparator: string,\n str: string\n): number[] {\n const beginningIndex = str.indexOf(initialSeparator);\n const finalIndex = str.indexOf(finalSeparator, beginningIndex + 1);\n\n if (beginningIndex >= 0 && finalIndex > 0) {\n return [beginningIndex, finalIndex];\n }\n\n return [-1, -1];\n}\n\n/**\n * Object returned by decomposeString function\n *\n * @typedef {Object} DecomposedString\n * @property {number} start Beginning index for first separator match\n * @property {number} end Final index for second separator match\n * @property {string} pre Substring before first separator\n * @property {string} body Substring between separators\n * @property {string} post Substring after second separator\n */\n\n/**\n * Decompose string in pre, body and post strings by using separators.\n *\n * @private\n * @since 3.1.1\n * @param {string} initialSeparator First string to be found.\n * @param {string} finalSeparator Second string to be found.\n * @param {string} str String to be decomposed.\n * @returns {DecomposedString} Returns a decompose string.\n * @example\n * ```javascript\n * decomposeString('first', 'Second', 'firstAndSecond')\n * // => { start: 0, end: 8, pre: '', body: 'And', post: '' }\n *\n * decomposeString('First', 'Second', '++FirstAndSecond**')\n * // => { start: 2, end: 10, pre: '++', body: 'And', post: '**' }\n * ```\n */\nexport function decomposeString(\n initialSeparator: string,\n finalSeparator: string,\n str: string\n): DecomposeString {\n const [beginningIndex, finalIndex] = getIndexRange(\n initialSeparator,\n finalSeparator,\n str\n );\n\n return {\n start: beginningIndex,\n end: finalIndex,\n pre: beginningIndex >= 0 ? str.slice(0, beginningIndex) : '',\n body:\n beginningIndex >= 0\n ? str.slice(beginningIndex + initialSeparator.length, finalIndex)\n : '',\n post:\n beginningIndex >= 0 ? str.slice(finalIndex + finalSeparator.length) : ''\n };\n}\n","import { decomposeString } from './decomposeString';\n\n/**\n * Generate an array of string depending on {} blocks.\n *\n * @param {string} pattern Pattern string that can contains {} blocks.\n * @returns {string[]} Returns an array of string with all the combinations.\n * @example\n * ```javascript\n * braceExpand('${13}')\n * // => ['{13}']\n *\n * braceExpand('a{b,f,m}p')\n * // => ['abp','afp','amp']\n *\n * braceExpand('-v{,,}')\n * // => ['-v','-v','-v']\n * ```\n */\nconst braceExpand = (pattern: string): string[] => {\n if (!pattern.match(/{.*}/)) {\n return [pattern];\n }\n\n return expand(pattern, true);\n};\n\nconst expand = (str: string, isTop?: boolean): string[] => {\n const expansions = [] as string[];\n const balance = decomposeString('{', '}', str);\n if (balance.start < 0) return [str];\n\n const parts = balance.body.split(',');\n // no need to expand pre, since it is guaranteed to be free of brace-sets\n const pre = balance.pre;\n const postParts = balance.post.length ? expand(balance.post, false) : [''];\n\n if (/\\$$/.test(balance.pre)) {\n postParts.forEach((postPart) => {\n const expansion = `${balance.pre.slice(0, -1)}{${\n balance.body\n }}${postPart}`;\n expansions.push(expansion);\n });\n } else {\n parts.forEach((part: string) => {\n postParts.forEach((postPart) => {\n const expansion = pre + part + postPart;\n if (!isTop || expansion) expansions.push(expansion);\n });\n });\n }\n\n return expansions;\n};\n\nexport { braceExpand };\n","import { braceExpand } from './utils/braceExpand';\n\nexport class Matcher {\n private readonly pattern: string;\n private readonly maxLength: number;\n private readonly set: (string | RegExp)[];\n private readonly empty: boolean;\n\n constructor(pattern: string, maxLength = 1024 * 64) {\n this.set = [];\n this.pattern = pattern.trim();\n this.maxLength = maxLength;\n this.empty = !this.pattern ? true : false;\n\n const set = braceExpand(pattern);\n this.set = set.map((val) => this.parse(val));\n this.set = this.set.filter((s) => {\n return Boolean(s);\n });\n }\n\n match(this: Matcher, str: string): boolean {\n if (this.empty) return str === '';\n\n return this.set.some((pattern) => this.matchOne(str, pattern));\n }\n\n private parse(pattern: string): string | RegExp {\n if (pattern.length > this.maxLength) {\n throw new TypeError('Pattern is too long');\n }\n let regExp;\n let hasSpecialCharacter = false;\n if (pattern === '') return '';\n\n const re = pattern.replace(/\\*/g, () => {\n hasSpecialCharacter = true;\n return '.+?';\n });\n\n // skip the regexp for non-* patterns\n // unescape anything in it, though, so that it'll be\n // an exact match.\n if (!hasSpecialCharacter) {\n return pattern.replace(/\\\\(.)/g, '$1');\n }\n\n try {\n regExp = new RegExp('^' + re + '$');\n } catch (error) {\n // If it was an invalid regular expression, then it can't match\n // anything.\n return new RegExp('$.');\n }\n\n return regExp;\n }\n\n private matchOne(str: string, pattern: string | RegExp): boolean {\n if (typeof pattern === 'string') {\n return str === pattern;\n }\n\n return Boolean(str.match(pattern));\n }\n}\n","/*\n https://github.com/banksean wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace\n so it's better encapsulated. Now you can have multiple random number generators\n and they won't stomp all over each other's state.\n If you want to use this as a substitute for Math.random(), use the random()\n method like so:\n var m = new MersenneTwister();\n var randomNumber = m.random();\n You can also call the other genrand_{foo}() methods on the instance.\n If you want to use a specific seed in order to get a repeatable random\n sequence, pass an integer into the constructor:\n var m = new MersenneTwister(123);\n and that will always produce the same random sequence.\n Sean McCullough (banksean@gmail.com)\n*/\n\n/*\n A C-program for MT19937, with initialization improved 2002/1/26.\n Coded by Takuji Nishimura and Makoto Matsumoto.\n Before using, initialize the state by using init_seed(seed)\n or init_by_array(init_key, key_length).\n Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,\n All rights reserved.\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions\n are met:\n 1. Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n 2. Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n 3. The names of its contributors may not be used to endorse or promote\n products derived from this software without specific prior written\n permission.\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n Any feedback is very welcome.\n http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html\n email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space)\n*/\n\nexport class MersenneTwister {\n private readonly N: number;\n private readonly M: number;\n private readonly MATRIX_A: number;\n private readonly UPPER_MASK: number;\n private readonly LOWER_MASK: number;\n private readonly mt: number[];\n private mti: number;\n\n constructor(seed?: number | number[]) {\n /* Period parameters */\n this.N = 624;\n this.M = 397;\n this.MATRIX_A = 0x9908b0df; /* constant vector a */\n this.UPPER_MASK = 0x80000000; /* most significant w-r bits */\n this.LOWER_MASK = 0x7fffffff; /* least significant r bits */\n\n this.mt = new Array(this.N); /* the array for the state vector */\n this.mti = this.N + 1; /* mti==N+1 means mt[N] is not initialized */\n\n if (Array.isArray(seed)) {\n if (seed.length > 0) this.initByArray(seed, seed.length);\n } else {\n if (seed === undefined) {\n this.initSeed(new Date().getTime());\n } else {\n this.initSeed(seed);\n }\n }\n }\n\n /* initializes mt[N] with a seed */\n /* origin name init_genrand */\n initSeed(seed: number): void {\n this.mt[0] = seed >>> 0;\n for (this.mti = 1; this.mti < this.N; this.mti++) {\n const s = this.mt[this.mti - 1] ^ (this.mt[this.mti - 1] >>> 30);\n this.mt[this.mti] =\n ((((s & 0xffff0000) >>> 16) * 1812433253) << 16) +\n (s & 0x0000ffff) * 1812433253 +\n this.mti;\n /* See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier. */\n /* In the previous versions, MSBs of the seed affect */\n /* only MSBs of the array mt[]. */\n /* 2002/01/09 modified by Makoto Matsumoto */\n this.mt[this.mti] >>>= 0;\n /* for >32 bit machines */\n }\n }\n\n /* initialize by an array with array-length */\n /* init_key is the array for initializing keys */\n /* key_length is its length */\n /* slight change for C++, 2004/2/26 */\n initByArray(initKey: number[], keyLength: number): void {\n this.initSeed(19650218);\n let i = 1;\n let j = 0;\n let k = this.N > keyLength ? this.N : keyLength;\n for (; k; k--) {\n const s = this.mt[i - 1] ^ (this.mt[i - 1] >>> 30);\n this.mt[i] =\n (this.mt[i] ^\n (((((s & 0xffff0000) >>> 16) * 1664525) << 16) +\n (s & 0x0000ffff) * 1664525)) +\n initKey[j] +\n j; /* non linear */\n this.mt[i] >>>= 0; /* for WORDSIZE > 32 machines */\n i++;\n j++;\n if (i >= this.N) {\n this.mt[0] = this.mt[this.N - 1];\n i = 1;\n }\n if (j >= keyLength) j = 0;\n }\n for (k = this.N - 1; k; k--) {\n const s = this.mt[i - 1] ^ (this.mt[i - 1] >>> 30);\n this.mt[i] =\n (this.mt[i] ^\n (((((s & 0xffff0000) >>> 16) * 1566083941) << 16) +\n (s & 0x0000ffff) * 1566083941)) -\n i; /* non linear */\n this.mt[i] >>>= 0; /* for WORDSIZE > 32 machines */\n i++;\n if (i >= this.N) {\n this.mt[0] = this.mt[this.N - 1];\n i = 1;\n }\n }\n\n this.mt[0] = 0x80000000; /* MSB is 1; assuring non-zero initial array */\n }\n\n /* generates a random number on [0,0xffffffff]-interval */\n /* origin name genrand_int32 */\n randomInt32(): number {\n let y;\n const mag01 = [0x0, this.MATRIX_A];\n /* mag01[x] = x * MATRIX_A for x=0,1 */\n\n if (this.mti >= this.N) {\n /* generate N words at one time */\n let kk;\n\n if (this.mti === this.N + 1)\n /* if init_seed() has not been called, */\n this.initSeed(5489); /* a default initial seed is used */\n\n for (kk = 0; kk < this.N - this.M; kk++) {\n y =\n (this.mt[kk] & this.UPPER_MASK) | (this.mt[kk + 1] & this.LOWER_MASK);\n this.mt[kk] = this.mt[kk + this.M] ^ (y >>> 1) ^ mag01[y & 0x1];\n }\n for (; kk < this.N - 1; kk++) {\n y =\n (this.mt[kk] & this.UPPER_MASK) | (this.mt[kk + 1] & this.LOWER_MASK);\n this.mt[kk] =\n this.mt[kk + (this.M - this.N)] ^ (y >>> 1) ^ mag01[y & 0x1];\n }\n y =\n (this.mt[this.N - 1] & this.UPPER_MASK) |\n (this.mt[0] & this.LOWER_MASK);\n this.mt[this.N - 1] = this.mt[this.M - 1] ^ (y >>> 1) ^ mag01[y & 0x1];\n\n this.mti = 0;\n }\n\n y = this.mt[this.mti++];\n\n /* Tempering */\n y ^= y >>> 11;\n y ^= (y << 7) & 0x9d2c5680;\n y ^= (y << 15) & 0xefc60000;\n y ^= y >>> 18;\n\n return y >>> 0;\n }\n\n /* generates a random number on [0,0x7fffffff]-interval */\n /* origin name genrand_int31 */\n randomInt31(): number {\n return this.randomInt32() >>> 1;\n }\n\n /* generates a random number on [0,1]-real-interval */\n /* origin name genrand_real1 */\n randomReal1(): number {\n return this.randomInt32() * (1.0 / 4294967295.0);\n /* divided by 2^32-1 */\n }\n\n /* generates a random number on [0,1)-real-interval */\n /* origin name genrand_real2 */\n randomReal2(): number {\n return this.randomInt32() * (1.0 / 4294967296.0);\n /* divided by 2^32 */\n }\n\n /* generates a random number on (0,1)-real-interval */\n /* origin name genrand_real3 */\n randomReal3(): number {\n return (this.randomInt32() + 0.5) * (1.0 / 4294967296.0);\n /* divided by 2^32 */\n }\n\n /* generates a random number on [0,1) with 53-bit resolution*/\n /* origin name genrand_res53 */\n randomRes53(): number {\n const a = this.randomInt32() >>> 5;\n const b = this.randomInt32() >>> 6;\n return (a * 67108864.0 + b) * (1.0 / 9007199254740992.0);\n }\n}\n\n/* These real versions are due to Isaku Wada, 2002/01/09 added */\n","import { MersenneTwister } from './mersenneTwister';\n\nconst replacePlaceholders = (mersenne: MersenneTwister) => (\n placeholder: string\n): string => {\n const random = Math.floor(mersenne.randomReal2() * 16);\n\n const value = placeholder === 'x' ? random : (random & 0x3) | 0x8;\n return value.toString(16);\n};\n\n/**\n * Generate a uuid.\n *\n * @private\n * @since 3.5.0\n * @returns {string} Returns the generated uuid.\n * @example\n * ```javascript\n * generateUUID()\n * // => 49e71c40-9b21-4371-9699-2def33f62e66\n *\n * generateUUID()\n * // => da94f128-4247-48e3-bc73-d0cae46b5093\n * ```\n */\nexport function generateUUID(): string {\n const mersenne = new MersenneTwister();\n const RFC4122_TEMPLATE = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx';\n\n return RFC4122_TEMPLATE.replace(/[xy]/g, replacePlaceholders(mersenne));\n}\n","/**\n * Boolean matching.\n *\n * @since 4.7.0\n * @category Boolean\n * @param {number} data The value to be compared.\n * @param {number} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is equal to `expected value`.\n * @example\n * ```javascript\n * bool(true, true)\n * // => true\n *\n * bool(true, false)\n * // => false\n * ```\n */\nexport function bool(data: boolean, expected: boolean): boolean {\n return (\n data === expected\n );\n}\n","export type DateType = Date | string;\n\nexport const convertDate = (date: DateType): number=>{\n if(date instanceof Date){\n return date.getTime();\n }\n\n return Date.parse(date);\n}","import {DateType, convertDate} from './convertDate';\n\n/**\n * Exact date matching.\n *\n * @since 4.8.0\n * @category Date\n * @param {Date} data The value to be compared.\n * @param {Date} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is equal to `expected value`.\n * @example\n * ```javascript\n * dateEquals('December 15, 1994 03:24:00', 'December 15, 1994 03:24:00')\n * // => true\n *\n * dateEquals('December 15, 2000 03:24:00', 'December 10, 2001 03:24:00')\n * // => false\n * ```\n */\nexport function dateEquals(data: DateType, expected: DateType): boolean {\n const convertedData = convertDate(data);\n const convertedExpectation = convertDate(expected);\n return (\n convertedData === convertedExpectation\n );\n}\n","import {DateType, convertDate} from './convertDate';\n\n/**\n * Matching before a specific date and time\n *\n * @since 4.10.0\n * @category Date\n * @param {Date} data The value to be compared.\n * @param {Date} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is before than `expected value`.\n * @example\n * ```javascript\n * dateLessThan('December 15, 1994 03:24:00', 'December 16, 1994 03:24:00')\n * // => true\n *\n * dateLessThan('December 15, 2000 03:24:00', 'December 15, 2000 03:24:00')\n * // => false\n * ```\n */\nexport function dateLessThan(data: DateType, expected: DateType): boolean {\n const convertedData = convertDate(data);\n const convertedExpectation = convertDate(expected);\n return (\n convertedData < convertedExpectation\n );\n}\n","import {DateType, convertDate} from './convertDate';\n\n/**\n * Matching at or before a specific date and time\n *\n * @since 4.10.0\n * @category Date\n * @param {Date} data The value to be compared.\n * @param {Date} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is equal or before than `expected value`.\n * @example\n * ```javascript\n * dateLessThanEquals('December 15, 1994 03:24:00', 'December 15, 1994 03:24:00')\n * // => true\n *\n * dateLessThanEquals('December 15, 2000 03:24:00', 'December 15, 2000 03:24:00')\n * // => false\n * ```\n */\nexport function dateLessThanEquals(data: DateType, expected: DateType): boolean {\n const convertedData = convertDate(data);\n const convertedExpectation = convertDate(expected);\n return (\n convertedData <= convertedExpectation\n );\n}\n","import {DateType, convertDate} from './convertDate';\n\n/**\n * Negated date matching.\n *\n * @since 4.9.0\n * @category Date\n * @param {Date} data The value to be compared.\n * @param {Date} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is not equal to `expected value`.\n * @example\n * ```javascript\n * dateNotEquals('December 15, 1994 03:24:00', 'December 16, 1995 03:24:00')\n * // => true\n *\n * dateNotEquals('December 15, 2000 03:24:00', 'December 15, 2000 03:24:00')\n * // => false\n * ```\n */\nexport function dateNotEquals(data: DateType, expected: DateType): boolean {\n const convertedData = convertDate(data);\n const convertedExpectation = convertDate(expected);\n return (\n convertedData !== convertedExpectation\n );\n}\n","/**\n * Exact numeric matching.\n *\n * @since 4.6.0\n * @category Numeric\n * @param {number} data The value to be compared.\n * @param {number} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is equal to `expected value`.\n * @example\n * ```javascript\n * numericEquals(5, 5)\n * // => true\n *\n * numericEquals(2, 4)\n * // => false\n * ```\n */\nexport function numericEquals(data: number, expected: number): boolean {\n return (\n data === expected\n );\n}\n","/**\n * Numeric greater than matching.\n *\n * @since 4.6.0\n * @category Numeric\n * @param {number} data The value to be compared.\n * @param {number} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is greater than `expected value`.\n * @example\n * ```javascript\n * numericGreaterThan(6, 5)\n * // => true\n *\n * numericGreaterThan(4, 8)\n * // => false\n * ```\n */\nexport function numericGreaterThan(data: number, expected: number): boolean {\n return (\n data > expected\n );\n}\n","/**\n * Numeric greater than or equals matching.\n *\n * @since 4.6.0\n * @category Numeric\n * @param {number} data The value to be compared.\n * @param {number} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is greater than or equals `expected value`.\n * @example\n * ```javascript\n * numericGreaterThanEquals(5, 5)\n * // => true\n *\n * numericGreaterThanEquals(4, 8)\n * // => false\n * ```\n */\nexport function numericGreaterThanEquals(data: number, expected: number): boolean {\n return (\n data >= expected\n );\n}\n","/**\n * Numeric less than matching.\n *\n * @since 4.6.0\n * @category Numeric\n * @param {number} data The value to be compared.\n * @param {number} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is less than `expected value`.\n * @example\n * ```javascript\n * numericLessThan(5, 6)\n * // => true\n *\n * numericLessThan(8, 4)\n * // => false\n * ```\n */\nexport function numericLessThan(data: number, expected: number): boolean {\n return (\n data < expected\n );\n}\n","/**\n * Numeric less than or equals matching.\n *\n * @since 4.6.0\n * @category Numeric\n * @param {number} data The value to be compared.\n * @param {number} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is less than or equals `expected value`.\n * @example\n * ```javascript\n * numericLessThanEquals(5, 5)\n * // => true\n *\n * numericLessThanEquals(8, 4)\n * // => false\n * ```\n */\nexport function numericLessThanEquals(data: number, expected: number): boolean {\n return (\n data <= expected\n );\n}\n","/**\n * Negated numeric matching.\n *\n * @since 4.6.0\n * @category Numeric\n * @param {number} data The value to be compared.\n * @param {number} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is not equal to `expected value`.\n * @example\n * ```javascript\n * numericNotEquals(2, 4)\n * // => true\n *\n * numericNotEquals(5, 5)\n * // => false\n * ```\n */\nexport function numericNotEquals(data: number, expected: number): boolean {\n return (\n data !== expected\n );\n}\n","/**\n * Exact string matching, case sensitive.\n *\n * @since 4.3.0\n * @category String\n * @param {string} data The value to be compared.\n * @param {string} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is equal to `expected value`.\n * @example\n * ```javascript\n * stringEquals('hi', 'hi')\n * // => true\n *\n * stringEquals('hi', 'no')\n * // => false\n * ```\n */\nexport function stringEquals(data: string, expected: string): boolean {\n return (\n data === expected\n );\n}\n","/**\n * Exact string matching, ignoring case.\n *\n * @since 4.4.0\n * @category String\n * @param {string} data The value to be compared.\n * @param {string} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is equal to `expected value`.\n * @example\n * ```javascript\n * stringEqualsIgnoreCase('hi', 'Hi')\n * // => true\n *\n * stringEqualsIgnoreCase('hi', 'no')\n * // => false\n * ```\n */\nexport function stringEqualsIgnoreCase(data: string, expected: string): boolean {\n return (\n data.toLowerCase() === expected.toLowerCase()\n );\n}\n","import {Matcher} from '../../Matcher';\n\n/**\n * Case-sensitive matching. The values can include a multi-character match wildcard (*) anywhere in the string.\n *\n * @since 4.5.0\n * @category String\n * @param {string} data The value to be compared.\n * @param {string} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is equal like `expected value`.\n * @example\n * ```javascript\n * stringLike('newHouse', 'new*')\n * // => true\n *\n * stringLike('House', 'new*')\n * // => false\n * ```\n */\nexport function stringLike(data: string, expected: string): boolean {\n return (\n new Matcher(data).match(expected)\n );\n}\n","/**\n * Negated string matching.\n *\n * @since 4.4.0\n * @category String\n * @param {string} data The value to be compared.\n * @param {string} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is not equal to `expected value`.\n * @example\n * ```javascript\n * stringNotEquals('hi', 'no')\n * // => true\n * \n * stringNotEquals('hi', 'hi')\n * // => false\n * ```\n */\nexport function stringNotEquals(data: string, expected: string): boolean {\n return (\n data !== expected\n );\n}\n","/**\n * Negated string matching, ignoring case.\n *\n * @since 4.4.0\n * @category String\n * @param {string} data The value to be compared.\n * @param {string} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is not equal to `expected value`.\n * @example\n * ```javascript\n * stringNotEqualsIgnoreCase('hi', 'no')\n * // => true\n * \n * stringNotEqualsIgnoreCase('hi', 'Hi')\n * // => false\n * ```\n */\nexport function stringNotEqualsIgnoreCase(data: string, expected: string): boolean {\n return (\n data.toLowerCase() !== expected.toLowerCase()\n );\n}\n","import {bool} from './boolean/bool';\nimport {dateEquals} from './date/dateEquals';\nimport {dateLessThan} from './date/dateLessThan';\nimport {dateLessThanEquals} from './date/dateLessThanEquals';\nimport {dateNotEquals} from './date/dateNotEquals';\nimport {numericEquals} from './numeric/numericEquals';\nimport {numericGreaterThan} from './numeric/numericGreaterThan';\nimport {numericGreaterThanEquals} from './numeric/numericGreaterThanEquals';\nimport {numericLessThan} from './numeric/numericLessThan';\nimport {numericLessThanEquals} from './numeric/numericLessThanEquals';\nimport {numericNotEquals} from './numeric/numericNotEquals';\nimport {stringEquals} from './string/stringEquals';\nimport {stringEqualsIgnoreCase} from './string/stringEqualsIgnoreCase';\nimport {stringLike} from './string/stringLike';\nimport {stringNotEquals} from './string/stringNotEquals';\nimport {stringNotEqualsIgnoreCase} from './string/stringNotEqualsIgnoreCase';\n\nexport const operators: Record={\n bool,\n dateEquals,\n dateLessThan,\n dateLessThanEquals,\n dateNotEquals,\n numericEquals,\n numericGreaterThan,\n numericGreaterThanEquals,\n numericLessThan,\n numericLessThanEquals,\n numericNotEquals,\n stringEquals,\n stringEqualsIgnoreCase,\n stringLike,\n stringNotEquals,\n stringNotEqualsIgnoreCase\n};\n","import {\n EffectBlock,\n ConditionBlock,\n StatementInterface,\n MatchConditionInterface,\n MatchConditionResolverInterface\n} from './types';\nimport { getValueFromPath } from './utils/getValueFromPath';\nimport { generateUUID } from './utils/generateUUID';\nimport {operators} from './conditionOperators';\n\nabstract class Statement {\n protected sid: string;\n protected readonly condition?: ConditionBlock;\n effect: EffectBlock;\n\n constructor({ sid, effect = 'allow', condition }: StatementInterface) {\n if (!sid) {\n this.sid = generateUUID();\n } else {\n this.sid = sid;\n }\n this.effect = effect;\n this.condition = condition;\n }\n\n matchConditions(\n this: Statement,\n { context, conditionResolver }: MatchConditionInterface\n ): boolean {\n const { condition: conditions } = this;\n\n if(conditions && context){\n return Object.keys(conditions).every((condition) =>\n Object.keys(conditions[condition]).every((path) => {\n const conditionValues = conditions[condition][path];\n if (conditionValues instanceof Array) {\n return conditionValues.some((value) =>\n this.evaluateCondition({\n context,\n conditionResolver,\n condition,\n path,\n value\n })\n );\n }\n\n return this.evaluateCondition({\n context,\n conditionResolver,\n condition,\n path,\n value: conditionValues\n });\n })\n )\n }\n\n return true;\n }\n\n private evaluateCondition(\n this: Statement,\n { context, conditionResolver={}, path, value, condition }: MatchConditionResolverInterface\n ): boolean {\n\n const currentResolver= conditionResolver[condition] || operators[condition]\n\n if(currentResolver){\n return currentResolver(\n getValueFromPath(context, path),\n value\n )\n }\n return false;\n }\n}\n\nexport { Statement };\n","import { ActionBasedType, MatchActionBasedInterface } from './types';\nimport { Matcher } from './Matcher';\nimport { Statement } from './Statement';\nimport { applyContext } from './utils/applyContext';\n\nclass ActionBased extends Statement {\n private action?: string[];\n private notAction?: string[];\n private statement: ActionBasedType;\n\n constructor(action: ActionBasedType) {\n super(action);\n this.checkAndAssignActions(action);\n this.statement = { ...action, sid: this.sid };\n }\n\n getStatement(this: ActionBased): ActionBasedType {\n return this.statement;\n }\n\n matches(\n this: ActionBased,\n { action, context, conditionResolver }: MatchActionBasedInterface\n ): boolean {\n return (\n this.matchActions(action, context) &&\n this.matchNotActions(action, context) &&\n this.matchConditions({ context, conditionResolver })\n );\n }\n\n private checkAndAssignActions(action: ActionBasedType): void {\n const hasAction = 'action' in action;\n const hasNotAction = 'notAction' in action;\n if (hasAction && hasNotAction) {\n throw new TypeError(\n 'ActionBased statement should have an action or a notAction attribute, no both'\n );\n }\n if ('action' in action) {\n this.action =\n typeof action.action === 'string' ? [action.action] : action.action;\n } else {\n this.notAction =\n typeof action.notAction === 'string'\n ? [action.notAction]\n : action.notAction;\n }\n }\n\n private matchActions(action: string, context?: T): boolean {\n return this.action\n ? this.action.some((a) =>\n new Matcher(applyContext(a, context)).match(action)\n )\n : true;\n }\n\n private matchNotActions(action: string, context?: T): boolean {\n return this.notAction\n ? !this.notAction.some((a) =>\n new Matcher(applyContext(a, context)).match(action)\n )\n : true;\n }\n}\n\nexport { ActionBased };\n","import { IdentityBasedType, MatchIdentityBasedInterface } from './types';\nimport { Matcher } from './Matcher';\nimport { Statement } from './Statement';\nimport { applyContext } from './utils/applyContext';\n\nclass IdentityBased extends Statement {\n private resource?: string[];\n private action?: string[];\n private notResource?: string[];\n private notAction?: string[];\n private statement: IdentityBasedType;\n\n constructor(identity: IdentityBasedType) {\n super(identity);\n this.checkAndAssignActions(identity);\n this.checkAndAssignResources(identity);\n this.statement = { ...identity, sid: this.sid };\n }\n\n getStatement(this: IdentityBased): IdentityBasedType {\n return this.statement;\n }\n\n matches(\n this: IdentityBased,\n {\n action,\n resource,\n context,\n conditionResolver\n }: MatchIdentityBasedInterface\n ): boolean {\n return (\n this.matchActions(action, context) &&\n this.matchNotActions(action, context) &&\n this.matchResources(resource, context) &&\n this.matchNotResources(resource, context) &&\n this.matchConditions({ context, conditionResolver })\n );\n }\n\n private checkAndAssignActions(identity: IdentityBasedType): void {\n const hasAction = 'action' in identity;\n const hasNotAction = 'notAction' in identity;\n if (hasAction && hasNotAction) {\n throw new TypeError(\n 'IdentityBased statement should have an action or a notAction attribute, no both'\n );\n }\n if ('action' in identity) {\n this.action =\n typeof identity.action === 'string'\n ? [identity.action]\n : identity.action;\n } else {\n this.notAction =\n typeof identity.notAction === 'string'\n ? [identity.notAction]\n : identity.notAction;\n }\n }\n\n private checkAndAssignResources(identity: IdentityBasedType): void {\n const hasResource = 'resource' in identity;\n const hasNotResource = 'notResource' in identity;\n if (hasResource && hasNotResource) {\n throw new TypeError(\n 'IdentityBased statement should have a resource or a notResource attribute, no both'\n );\n }\n if ('resource' in identity) {\n this.resource =\n typeof identity.resource === 'string'\n ? [identity.resource]\n : identity.resource;\n } else {\n this.notResource =\n typeof identity.notResource === 'string'\n ? [identity.notResource]\n : identity.notResource;\n }\n }\n\n private matchActions(action: string, context?: T): boolean {\n return this.action\n ? this.action.some((a) =>\n new Matcher(applyContext(a, context)).match(action)\n )\n : true;\n }\n\n private matchNotActions(action: string, context?: T): boolean {\n return this.notAction\n ? !this.notAction.some((a) =>\n new Matcher(applyContext(a, context)).match(action)\n )\n : true;\n }\n\n private matchResources(resource: string, context?: T): boolean {\n return this.resource\n ? this.resource.some((a) =>\n new Matcher(applyContext(a, context)).match(resource)\n )\n : true;\n }\n\n private matchNotResources(resource: string, context?: T): boolean {\n return this.notResource\n ? !this.notResource.some((a) =>\n new Matcher(applyContext(a, context)).match(resource)\n )\n : true;\n }\n}\n\nexport { IdentityBased };\n","import {\n PrincipalMap,\n MatchResourceBasedInterface,\n ResourceBasedType\n} from './types';\nimport { Matcher } from './Matcher';\nimport { Statement } from './Statement';\nimport { applyContext } from './utils/applyContext';\n\nclass ResourceBased extends Statement {\n private principal?: PrincipalMap | string[];\n private resource?: string[];\n private action?: string[];\n private notPrincipal?: PrincipalMap | string[];\n private notResource?: string[];\n private notAction?: string[];\n private statement: ResourceBasedType;\n private hasPrincipals: boolean;\n private hasResources: boolean;\n\n constructor(identity: ResourceBasedType) {\n super(identity);\n this.hasPrincipals = false;\n this.hasResources = false;\n this.checkAndAssignActions(identity);\n this.checkAndAssignPrincipals(identity);\n this.checkAndAssignResources(identity);\n this.statement = { ...identity, sid: this.sid };\n }\n\n getStatement(this: ResourceBased): ResourceBasedType {\n return this.statement;\n }\n\n matches(\n this: ResourceBased,\n {\n principal,\n action,\n resource,\n principalType,\n context,\n conditionResolver\n }: MatchResourceBasedInterface\n ): boolean {\n return (\n this.matchPrincipalAndNotPrincipal(principal, principalType, context) &&\n this.matchActions(action, context) &&\n this.matchNotActions(action, context) &&\n this.matchResourceAndNotResource(resource, context) &&\n this.matchConditions({ context, conditionResolver })\n );\n }\n\n /*valueComing principal noPrincipal\n true false false false\n true true false true or false\n true false true true or false\n false false false true\n false true false false\n false false true false*/\n private matchPrincipalAndNotPrincipal(\n principal?: string,\n principalType?: string,\n context?: T\n ): boolean {\n if (principal) {\n if (this.hasPrincipals)\n return (\n this.matchPrincipals(principal, principalType, context) &&\n this.matchNotPrincipals(principal, principalType, context)\n );\n return false;\n }\n if (this.hasPrincipals) return false;\n return true;\n }\n\n /*valueComing resource noResource\n true false false false\n true true false true or false\n true false true true or false\n false false false true\n false true false false\n false false true false*/\n private matchResourceAndNotResource(resource?: string, context?: T): boolean {\n if (resource) {\n if (this.hasResources)\n return (\n this.matchResources(resource, context) &&\n this.matchNotResources(resource, context)\n );\n return false;\n }\n if (this.hasResources) return false;\n return true;\n }\n\n private checkAndAssignActions(identity: ResourceBasedType): void {\n const hasAction = 'action' in identity;\n const hasNotAction = 'notAction' in identity;\n if (hasAction && hasNotAction) {\n throw new TypeError(\n 'ResourceBased statement should have an action or a notAction attribute, no both'\n );\n }\n if ('action' in identity) {\n this.action =\n typeof identity.action === 'string'\n ? [identity.action]\n : identity.action;\n } else {\n this.notAction =\n typeof identity.notAction === 'string'\n ? [identity.notAction]\n : identity.notAction;\n }\n }\n\n private checkAndAssignPrincipals(identity: ResourceBasedType): void {\n const hasPrincipal = 'principal' in identity;\n const hasNotPrincipal = 'notPrincipal' in identity;\n if (hasPrincipal && hasNotPrincipal) {\n throw new TypeError(\n 'ResourceBased statement could have a principal or a notPrincipal attribute, no both'\n );\n }\n if ('principal' in identity) {\n this.principal =\n typeof identity.principal === 'string'\n ? [identity.principal]\n : identity.principal;\n this.hasPrincipals = true;\n } else if ('notPrincipal' in identity) {\n this.notPrincipal =\n typeof identity.notPrincipal === 'string'\n ? [identity.notPrincipal]\n : identity.notPrincipal;\n this.hasPrincipals = true;\n }\n }\n\n private checkAndAssignResources(identity: ResourceBasedType): void {\n const hasResource = 'resource' in identity;\n const hasNotResource = 'notResource' in identity;\n if (hasResource && hasNotResource) {\n throw new TypeError(\n 'ResourceBased statement could have a resource or a notResource attribute, no both'\n );\n }\n if ('resource' in identity) {\n this.resource =\n typeof identity.resource === 'string'\n ? [identity.resource]\n : identity.resource;\n this.hasResources = true;\n } else if ('notResource' in identity) {\n this.notResource =\n typeof identity.notResource === 'string'\n ? [identity.notResource]\n : identity.notResource;\n this.hasResources = true;\n }\n }\n\n private matchPrincipals(\n principal: string,\n principalType?: string,\n context?: T\n ): boolean {\n if (this.principal) {\n if (this.principal instanceof Array) {\n return principalType\n ? false\n : this.principal.some((a) =>\n new Matcher(applyContext(a, context)).match(principal)\n );\n } else {\n if (principalType) {\n const principalValues = this.principal[principalType];\n if (principalValues instanceof Array) {\n return principalValues.some((a) =>\n new Matcher(applyContext(a, context)).match(principal)\n );\n } else if (principalValues) {\n return new Matcher(applyContext(principalValues, context)).match(\n principal\n );\n }\n return false;\n }\n return false;\n }\n }\n return true;\n }\n\n private matchNotPrincipals(\n principal: string,\n principalType?: string,\n context?: T\n ): boolean {\n if (this.notPrincipal) {\n if (this.notPrincipal instanceof Array) {\n return principalType\n ? true\n : !this.notPrincipal.some((a) =>\n new Matcher(applyContext(a, context)).match(principal)\n );\n } else {\n if (principalType) {\n const principalValues = this.notPrincipal[principalType];\n if (principalValues instanceof Array) {\n return !principalValues.some((a) =>\n new Matcher(applyContext(a, context)).match(principal)\n );\n } else if (principalValues) {\n return !new Matcher(applyContext(principalValues, context)).match(\n principal\n );\n }\n return true;\n }\n return true;\n }\n }\n return true;\n }\n\n private matchActions(action: string, context?: T): boolean {\n return this.action\n ? this.action.some((a) =>\n new Matcher(applyContext(a, context)).match(action)\n )\n : true;\n }\n\n private matchNotActions(action: string, context?: T): boolean {\n return this.notAction\n ? !this.notAction.some((a) =>\n new Matcher(applyContext(a, context)).match(action)\n )\n : true;\n }\n\n private matchResources(resource: string, context?: T): boolean {\n return this.resource\n ? this.resource.some((a) =>\n new Matcher(applyContext(a, context)).match(resource)\n )\n : true;\n }\n\n private matchNotResources(resource: string, context?: T): boolean {\n return this.notResource\n ? !this.notResource.some((a) =>\n new Matcher(applyContext(a, context)).match(resource)\n )\n : true;\n }\n}\n\nexport { ResourceBased };\n","import { MatchConditionInterface, ConditionResolver } from './types';\n\nabstract class Policy {\n protected context?: T;\n protected conditionResolver?: ConditionResolver;\n\n constructor({ context, conditionResolver }: MatchConditionInterface) {\n this.context = context;\n this.conditionResolver = conditionResolver;\n }\n\n setContext(this: Policy, context: T): void {\n this.context = context;\n }\n\n getContext(this: Policy): T | undefined {\n return this.context;\n }\n\n setConditionResolver(\n this: Policy,\n conditionResolver: ConditionResolver\n ): void {\n this.conditionResolver = conditionResolver;\n }\n\n getConditionResolver(this: Policy): ConditionResolver | undefined {\n return this.conditionResolver;\n }\n\n abstract getStatements(this: Policy): U[];\n}\n\nexport { Policy };\n","import {\n ActionBasedType,\n ConditionResolver,\n EvaluateActionBasedInterface,\n ProxyOptions\n} from './types';\nimport { ActionBased } from './ActionBasedStatement';\nimport { Policy } from './Policy';\n\nexport interface ActionBasedPolicyInterface {\n statements: ActionBasedType[];\n conditionResolver?: ConditionResolver;\n context?: T;\n}\n\nexport class ActionBasedPolicy extends Policy<\n T,\n ActionBasedType\n> {\n private denyStatements: ActionBased[];\n private allowStatements: ActionBased[];\n private statements: ActionBasedType[];\n\n constructor({\n statements,\n conditionResolver,\n context\n }: ActionBasedPolicyInterface) {\n super({ context, conditionResolver });\n const statementInstances = statements.map(\n (statement) => new ActionBased(statement)\n );\n this.allowStatements = statementInstances.filter(\n (s) => s.effect === 'allow'\n );\n this.denyStatements = statementInstances.filter((s) => s.effect === 'deny');\n this.statements = statementInstances.map((statement) =>\n statement.getStatement()\n );\n }\n\n addStatement(this: ActionBasedPolicy, statement: ActionBasedType): void {\n const statementInstance = new ActionBased(statement);\n if (statementInstance.effect === 'allow') {\n this.allowStatements.push(statementInstance);\n } else {\n this.denyStatements.push(statementInstance);\n }\n this.statements.push(statementInstance.getStatement());\n }\n\n getStatements(this: ActionBasedPolicy): ActionBasedType[] {\n return this.statements;\n }\n\n evaluate(\n this: ActionBasedPolicy,\n { action, context }: EvaluateActionBasedInterface\n ): boolean {\n const args = { action, context };\n return !this.cannot(args) && this.can(args);\n }\n\n can(\n this: ActionBasedPolicy,\n { action, context }: EvaluateActionBasedInterface\n ): boolean {\n return this.allowStatements.some((s) =>\n s.matches({\n action,\n context: context || this.context,\n conditionResolver: this.conditionResolver\n })\n );\n }\n\n cannot(\n this: ActionBasedPolicy,\n { action, context }: EvaluateActionBasedInterface\n ): boolean {\n return this.denyStatements.some((s) =>\n s.matches({\n action,\n context: context || this.context,\n conditionResolver: this.conditionResolver\n })\n );\n }\n\n generateProxy(\n this: ActionBasedPolicy,\n obj: U,\n options: ProxyOptions = {}\n ): U {\n const { get = {}, set = {} } = options;\n const { allow: allowGet = true, propertyMap: propertyMapGet = {} } = get;\n const { allow: allowSet = true, propertyMap: propertyMapSet = {} } = set;\n const handler = {\n ...(allowGet\n ? {\n get: (target: U, prop: W): any => {\n if (prop in target) {\n if (typeof prop === 'string') {\n const property = propertyMapGet[prop] || prop;\n if (this.evaluate({ action: property })) return target[prop];\n throw new Error(`Unauthorize to get ${prop} property`);\n }\n }\n return target[prop];\n }\n }\n : {}),\n ...(allowSet\n ? {\n set: (target: U, prop: W, value: any): boolean => {\n if (typeof prop === 'string') {\n const property = propertyMapSet[prop] || prop;\n if (this.evaluate({ action: property })) {\n target[prop] = value;\n return true;\n } else throw new Error(`Unauthorize to set ${prop} property`);\n }\n return true;\n }\n }\n : {})\n };\n\n return new Proxy(obj, handler);\n }\n}\n","import {\n ConditionResolver,\n EvaluateIdentityBasedInterface,\n IdentityBasedType\n} from './types';\nimport { IdentityBased } from './IdentityBasedStatement';\nimport { Policy } from './Policy';\n\ninterface IdentityBasedPolicyInterface {\n statements: IdentityBasedType[];\n conditionResolver?: ConditionResolver;\n context?: T;\n}\n\nexport class IdentityBasedPolicy extends Policy<\n T,\n IdentityBasedType\n> {\n private denyStatements: IdentityBased[];\n private allowStatements: IdentityBased[];\n private statements: IdentityBasedType[];\n\n constructor({\n statements,\n conditionResolver,\n context\n }: IdentityBasedPolicyInterface) {\n super({ context, conditionResolver });\n const statementInstances = statements.map(\n (statement) => new IdentityBased(statement)\n );\n this.allowStatements = statementInstances.filter(\n (s) => s.effect === 'allow'\n );\n this.denyStatements = statementInstances.filter((s) => s.effect === 'deny');\n this.statements = statementInstances.map((statement) =>\n statement.getStatement()\n );\n }\n\n addStatement(\n this: IdentityBasedPolicy,\n statement: IdentityBasedType\n ): void {\n const statementInstance = new IdentityBased(statement);\n if (statementInstance.effect === 'allow') {\n this.allowStatements.push(statementInstance);\n } else {\n this.denyStatements.push(statementInstance);\n }\n this.statements.push(statementInstance.getStatement());\n }\n\n getStatements(this: IdentityBasedPolicy): IdentityBasedType[] {\n return this.statements;\n }\n\n evaluate(\n this: IdentityBasedPolicy,\n { action, resource, context }: EvaluateIdentityBasedInterface\n ): boolean {\n const args = { action, resource, context };\n return !this.cannot(args) && this.can(args);\n }\n\n can(\n this: IdentityBasedPolicy,\n { action, resource, context }: EvaluateIdentityBasedInterface\n ): boolean {\n return this.allowStatements.some((s) =>\n s.matches({\n action,\n resource,\n context: context || this.context,\n conditionResolver: this.conditionResolver\n })\n );\n }\n\n cannot(\n this: IdentityBasedPolicy,\n { action, resource, context }: EvaluateIdentityBasedInterface\n ): boolean {\n return this.denyStatements.some((s) =>\n s.matches({\n action,\n resource,\n context: context || this.context,\n conditionResolver: this.conditionResolver\n })\n );\n }\n}\n","import {\n ConditionResolver,\n EvaluateResourceBasedInterface,\n ResourceBasedType\n} from './types';\nimport { ResourceBased } from './ResourceBasedStatement';\nimport { Policy } from './Policy';\n\ninterface ResourceBasedPolicyInterface {\n statements: ResourceBasedType[];\n conditionResolver?: ConditionResolver;\n context?: T;\n}\n\nexport class ResourceBasedPolicy extends Policy<\n T,\n ResourceBasedType\n> {\n private denyStatements: ResourceBased[];\n private allowStatements: ResourceBased[];\n private statements: ResourceBasedType[];\n\n constructor({\n statements,\n conditionResolver,\n context\n }: ResourceBasedPolicyInterface) {\n super({ context, conditionResolver });\n const statementInstances = statements.map(\n (statement) => new ResourceBased(statement)\n );\n this.allowStatements = statementInstances.filter(\n (s) => s.effect === 'allow'\n );\n this.denyStatements = statementInstances.filter((s) => s.effect === 'deny');\n this.statements = statementInstances.map((statement) =>\n statement.getStatement()\n );\n }\n\n addStatement(\n this: ResourceBasedPolicy,\n statement: ResourceBasedType\n ): void {\n const statementInstance = new ResourceBased(statement);\n if (statementInstance.effect === 'allow') {\n this.allowStatements.push(statementInstance);\n } else {\n this.denyStatements.push(statementInstance);\n }\n this.statements.push(statementInstance.getStatement());\n }\n\n getStatements(this: ResourceBasedPolicy): ResourceBasedType[] {\n return this.statements;\n }\n\n evaluate(\n this: ResourceBasedPolicy,\n {\n principal,\n action,\n resource,\n principalType,\n context\n }: EvaluateResourceBasedInterface\n ): boolean {\n const args = { principal, action, resource, principalType, context };\n return !this.cannot(args) && this.can(args);\n }\n\n can(\n this: ResourceBasedPolicy,\n {\n principal,\n action,\n resource,\n principalType,\n context\n }: EvaluateResourceBasedInterface\n ): boolean {\n return this.allowStatements.some((s) =>\n s.matches({\n principal,\n action,\n resource,\n principalType,\n context: context || this.context,\n conditionResolver: this.conditionResolver\n })\n );\n }\n\n cannot(\n this: ResourceBasedPolicy,\n {\n principal,\n action,\n resource,\n principalType,\n context\n }: EvaluateResourceBasedInterface\n ): boolean {\n return this.denyStatements.some((s) =>\n s.matches({\n principal,\n action,\n resource,\n principalType,\n context: context || this.context,\n conditionResolver: this.conditionResolver\n })\n );\n }\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;SAgBgB,MAAM,CAAC,KAAc;IACnC,OAAO,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC/C;;AChBA;;;;;;;;;;;;;;;;SAgBgB,QAAQ,CAAC,KAAe;IACtC,MAAM,IAAI,GAAG,OAAO,KAAK,CAAC;IAC1B,QACE,IAAI,KAAK,QAAQ;SAChB,IAAI,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,iBAAiB,CAAC,EAC5E;AACJ;;ACtBA;AACA,MAAM,QAAQ,GAAG,CAAC,GAAG,CAAC,CAAC;AAEvB;;;;;;;;;;;;;;;SAegB,KAAK,CAAC,KAAc;IAClC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,QAAQ,CAAC,KAAK,CAAC,EAAE;QAChD,OAAO,KAAK,CAAC;KACd;IAED,OAAO,KAAK,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,KAAK,CAAC,QAAQ,GAAG,IAAI,GAAG,GAAG,KAAK,EAAE,CAAC;AACpE;;ACxBA;AACA,MAAM,YAAY,GAAG,kDAAkD,CAAC;AACxE,MAAM,aAAa,GAAG,OAAO,CAAC;AAE9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SA+BgB,KAAK,CAAmB,KAAc,EAAE,MAAU;IAChE,MAAM,IAAI,GAAG,OAAO,KAAK,CAAC;IAC1B,IACE,IAAI,KAAK,QAAQ;QACjB,IAAI,KAAK,SAAS;QAClB,KAAK,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;KACH;IAED,MAAM,CAEJ,EACE,SAAS,EACT,MAAM,EACN,QAAQ,EACR,aAAa,EACb,OAAO,EAC2B;QAEpC,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,KAChC,CAAC,CAAC,OAAO,CAAC;YACR,SAAS;YACT,MAAM;YACN,QAAQ;YACR,aAAa;YACb,OAAO,EAAE,OAAO,IAAI,IAAI,CAAC,OAAO;YAChC,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;SAC1C,CAAC,CACH,CAAC;KACH;;;;;"} \ No newline at end of file +{"version":3,"file":"main.es.js","sources":["../src/utils/getTag.ts","../src/utils/isSymbol.ts","../src/utils/toKey.ts","../src/utils/isKey.ts","../src/utils/memoize.ts","../src/utils/memoizeCapped.ts","../src/utils/stringToPath.ts","../src/utils/getValueFromPath.ts","../src/utils/applyContext.ts","../src/utils/decomposeString.ts","../src/utils/braceExpand.ts","../src/Matcher.ts","../src/utils/mersenneTwister.ts","../src/utils/generateUUID.ts","../src/conditionOperators/boolean/bool.ts","../src/conditionOperators/date/convertDate.ts","../src/conditionOperators/date/dateEquals.ts","../src/conditionOperators/date/dateGreaterThan.ts","../src/conditionOperators/date/dateGreaterThanEquals.ts","../src/conditionOperators/date/dateLessThan.ts","../src/conditionOperators/date/dateLessThanEquals.ts","../src/conditionOperators/date/dateNotEquals.ts","../src/conditionOperators/numeric/numericEquals.ts","../src/conditionOperators/numeric/numericGreaterThan.ts","../src/conditionOperators/numeric/numericGreaterThanEquals.ts","../src/conditionOperators/numeric/numericLessThan.ts","../src/conditionOperators/numeric/numericLessThanEquals.ts","../src/conditionOperators/numeric/numericNotEquals.ts","../src/conditionOperators/string/stringEquals.ts","../src/conditionOperators/string/stringEqualsIgnoreCase.ts","../src/conditionOperators/string/stringLike.ts","../src/conditionOperators/string/stringNotEquals.ts","../src/conditionOperators/string/stringNotEqualsIgnoreCase.ts","../src/conditionOperators/index.ts","../src/Statement.ts","../src/ActionBasedStatement.ts","../src/IdentityBasedStatement.ts","../src/ResourceBasedStatement.ts","../src/Policy.ts","../src/ActionBasedPolicy.ts","../src/IdentityBasedPolicy.ts","../src/ResourceBasedPolicy.ts"],"sourcesContent":["/**\n * Gets the `toStringTag` of `value`.\n *\n * @since 3.1.0\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n * @example\n * ```javascript\n * getTag(1)\n * // => '[object Number]'\n *\n * getTag(null)\n * // => '[object Null]'\n * ```\n */\nexport function getTag(value: unknown): string {\n return Object.prototype.toString.call(value);\n}\n","import { getTag } from './getTag';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @since 3.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n * ```javascript\n * isSymbol(Symbol())\n * // => true\n *\n * isSymbol('abc')\n * // => false\n * ```\n */\nexport function isSymbol(value?: unknown): value is symbol {\n const type = typeof value;\n return (\n type === 'symbol' ||\n (type === 'object' && value !== null && getTag(value) === '[object Symbol]')\n );\n}\n","import { isSymbol } from './isSymbol';\n\n/** Used as references for various `Number` constants. */\nconst INFINITY = 1 / 0;\n\n/**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @since 3.1.0\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n * @example\n *\n * toKey(Symbol.iterator)\n * // => true\n *\n * toKey('abc')\n * // => false\n */\nexport function toKey(value: unknown): string | symbol {\n if (typeof value === 'string' || isSymbol(value)) {\n return value;\n }\n\n return value === 0 && 1 / value === -INFINITY ? '-0' : `${value}`;\n}\n","import { isSymbol } from './isSymbol';\n\n/** Used to match property names within property paths. */\nconst reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/;\nconst reIsPlainProp = /^\\w*$/; //matches any word character (alphanumeric and underscore)\n\n/**\n * Checks if `value` is a property name and not a property path.\n *\n * @since 3.1.0\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n * @example\n * ```javascript\n * isKey(1)\n * // => true\n *\n * isKey('example[test]')\n * // => false\n *\n * isKey('a.b')\n * // => false\n *\n * const obj = {\n * '[a]': 5,\n * 'b.c': true\n * };\n *\n * isKey('[a]', obj)\n * // => true\n *\n * isKey('b.c', obj)\n * // => true\n * ```\n */\nexport function isKey(value: unknown, object?: T): boolean {\n const type = typeof value;\n if (\n type === 'number' ||\n type === 'boolean' ||\n value === null ||\n value === undefined ||\n isSymbol(value)\n ) {\n return true;\n }\n if (typeof value === 'string') {\n return (\n reIsPlainProp.test(value) ||\n !reIsDeepProp.test(value) ||\n (object !== null && value in Object(object))\n );\n }\n return false;\n}\n","import { MemoizeInterface } from '../types';\n\n/**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * @since 3.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n * ```javascript\n * const object = { 'a': 1, 'b': 2 }\n * const other = { 'c': 3, 'd': 4 }\n *\n * const values = memoize(values)\n * values(object)\n * // => [1, 2]\n *\n * values(other)\n * // => [3, 4]\n *\n * object.a = 2\n * values(object)\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b'])\n * values(object)\n * // => ['a', 'b']\n * ```\n */\nexport function memoize(\n func: (...args: unknown[]) => any,\n resolver?: (...args: unknown[]) => any\n): MemoizeInterface {\n const memoized = function (\n this: (...args: unknown[]) => any,\n ...args: unknown[]\n ): MemoizeInterface {\n const key = resolver ? resolver.apply(this, args) : args[0];\n const cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n const result = func.apply(this, args);\n cache.set(key, result);\n return result;\n };\n memoized.cache = new Map();\n return memoized;\n}\n\n/*const memoize = (fn: Function): Function => {\n const cache = {};\n return (...args): any => {\n const stringifiedArgs = JSON.stringify(args);\n const result = (cache[stringifiedArgs] =\n typeof cache[stringifiedArgs] === 'undefined'\n ? fn(...args)\n : cache[stringifiedArgs]);\n return result;\n };\n};*/\n","import { memoize } from './memoize';\nimport { MemoizeInterface } from '../types';\n\n/** Used as the maximum memoize cache size. */\nexport const MAX_MEMOIZE_SIZE = 500;\n\n/**\n * A specialized version of `memoize` which clears the memoized function's\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n *\n * @since 3.1.0\n * @private\n * @param {Function} func The function to have its output memoized.\n * @returns {Function} Returns the new memoized function.\n */\nexport function memoizeCapped(\n func: (...args: any) => unknown\n): MemoizeInterface {\n const result = memoize(func, (key: unknown) => {\n const { cache } = result;\n if (cache.size === MAX_MEMOIZE_SIZE) {\n cache.clear();\n }\n return key;\n });\n\n return result;\n}\n","import { memoizeCapped } from './memoizeCapped';\n\nconst charCodeOfDot = '.'.charCodeAt(0);\nconst reEscapeChar = /\\\\(\\\\)?/g;\nconst rePropName = RegExp(\n // Match anything that isn't a dot or bracket.\n '[^.[\\\\]]+' +\n '|' +\n // Or match property names within brackets.\n '\\\\[(?:' +\n // Match a non-string expression.\n '([^\"\\'][^[]*)' +\n '|' +\n // Or match strings (supports escaping characters).\n '([\"\\'])((?:(?!\\\\x02)[^\\\\\\\\]|\\\\\\\\.)*?)\\\\x02' +\n ')\\\\]' +\n '|' +\n // Or match \"\" as the space between consecutive dots or empty brackets.\n '(?=(?:\\\\.|\\\\[\\\\])(?:\\\\.|\\\\[\\\\]|$))',\n 'g'\n);\n\n/**\n * Converts `string` to a property path array.\n *\n * @since 3.1.0\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\nexport const stringToPath = memoizeCapped((string: string) => {\n const result = [];\n if (string.charCodeAt(0) === charCodeOfDot) {\n result.push('');\n }\n string.replace(\n rePropName,\n (\n match: string,\n expression: string,\n quote: string,\n subString: string\n ): string => {\n let key = match;\n if (quote) {\n key = subString.replace(reEscapeChar, '$1');\n } else if (expression) {\n key = expression.trim();\n }\n result.push(key);\n return '';\n }\n );\n return result;\n});\n","import { toKey } from './toKey';\nimport { isKey } from './isKey';\nimport { stringToPath } from './stringToPath';\n\n/**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {Object} [object] The object to query keys on.\n * @returns {Array} Returns the cast property path array.\n */\nexport function castPath(\n value: unknown,\n object: U\n): Array {\n if (Array.isArray(value)) {\n return value;\n }\n\n return isKey(value, object) ? [value] : stringToPath(value);\n}\n\n/**\n * The base implementation of `get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\nexport function baseGet(\n object: U,\n path: Array | string\n): any {\n const newPath = castPath(path, object);\n\n let index = 0;\n const length = newPath.length;\n\n let value: any = object;\n while (value instanceof Object && index < length) {\n value = value[toKey(newPath[index++])];\n }\n\n return index && index === length ? value : undefined;\n}\n\n/**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @since 3.1.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * const object = { 'a': [{ 'b': { 'c': 3 } }] }\n *\n * getValueFromPath(object, 'a[0].b.c')\n * // => 3\n *\n * getValueFromPath(object, ['a', '0', 'b', 'c'])\n * // => 3\n *\n * getValueFromPath(object, 'a.b.c', 'default')\n * // => 'default'\n */\nexport function getValueFromPath(\n object: U,\n path: Array | string,\n defaultValue?: unknown\n): any {\n const result = object === null ? undefined : baseGet(object, path);\n\n return result === undefined ? defaultValue : result;\n}\n","import { getValueFromPath } from './getValueFromPath';\n\nconst reDelimiters = /\\${([^}]*)}/g;\nconst trim = / +(?= )|^\\s+|\\s+$/g;\n\nconst specialTrim = (str: string): string => str.replace(trim, '');\n\n/**\n * Apply the context value in a string.\n *\n * @param {string} str Pattern string, containing context path.\n * @param {object} context Object to get values from path.\n * @returns {string} Returns a string with embedded context values.\n * @example\n * ```javascript\n * const context = {\n * user: { id: 456, bestFriends: [123, 532, 987] }\n * };\n * applyContext('secrets:${user.id}:*', context)\n * // => 'secrets:456:*'\n *\n * applyContext('secrets:${user.bestFriends}:*', context)\n * // => 'secrets:{123,532,987}:*'\n *\n * applyContext('secrets:${company.address}:account', context)\n * // => 'secrets:undefined:account'\n * ```\n */\nexport function applyContext(\n str: string,\n context?: T\n): string {\n if (!context) return str;\n\n return specialTrim(\n str.replace(reDelimiters, (_, path: string) => {\n const value = getValueFromPath(context, path);\n if (Array.isArray(value)) return `{${value}}`;\n if (value instanceof Object) return 'undefined';\n\n return String(value);\n })\n );\n}\n","import { DecomposeString } from '../types';\n\n/**\n * Get index range where separators are found.\n *\n * @private\n * @since 3.1.1\n * @param {string} initialSeparator First string to be found.\n * @param {string} finalSeparator Second string to be found.\n * @param {string} str String to be decomposed.\n * @returns {number[]} Returns the beginning and final index for those matches.\n * @example\n * ```javascript\n * getIndexRange('first', 'Second', 'firstAndSecond')\n * // => [0, 8]\n *\n * getIndexRange('First', 'Second', '++FirstAndSecond**')\n * // => [2, 10]\n * ```\n */\nfunction getIndexRange(\n initialSeparator: string,\n finalSeparator: string,\n str: string\n): number[] {\n const beginningIndex = str.indexOf(initialSeparator);\n const finalIndex = str.indexOf(finalSeparator, beginningIndex + 1);\n\n if (beginningIndex >= 0 && finalIndex > 0) {\n return [beginningIndex, finalIndex];\n }\n\n return [-1, -1];\n}\n\n/**\n * Object returned by decomposeString function\n *\n * @typedef {Object} DecomposedString\n * @property {number} start Beginning index for first separator match\n * @property {number} end Final index for second separator match\n * @property {string} pre Substring before first separator\n * @property {string} body Substring between separators\n * @property {string} post Substring after second separator\n */\n\n/**\n * Decompose string in pre, body and post strings by using separators.\n *\n * @private\n * @since 3.1.1\n * @param {string} initialSeparator First string to be found.\n * @param {string} finalSeparator Second string to be found.\n * @param {string} str String to be decomposed.\n * @returns {DecomposedString} Returns a decompose string.\n * @example\n * ```javascript\n * decomposeString('first', 'Second', 'firstAndSecond')\n * // => { start: 0, end: 8, pre: '', body: 'And', post: '' }\n *\n * decomposeString('First', 'Second', '++FirstAndSecond**')\n * // => { start: 2, end: 10, pre: '++', body: 'And', post: '**' }\n * ```\n */\nexport function decomposeString(\n initialSeparator: string,\n finalSeparator: string,\n str: string\n): DecomposeString {\n const [beginningIndex, finalIndex] = getIndexRange(\n initialSeparator,\n finalSeparator,\n str\n );\n\n return {\n start: beginningIndex,\n end: finalIndex,\n pre: beginningIndex >= 0 ? str.slice(0, beginningIndex) : '',\n body:\n beginningIndex >= 0\n ? str.slice(beginningIndex + initialSeparator.length, finalIndex)\n : '',\n post:\n beginningIndex >= 0 ? str.slice(finalIndex + finalSeparator.length) : ''\n };\n}\n","import { decomposeString } from './decomposeString';\n\n/**\n * Generate an array of string depending on {} blocks.\n *\n * @param {string} pattern Pattern string that can contains {} blocks.\n * @returns {string[]} Returns an array of string with all the combinations.\n * @example\n * ```javascript\n * braceExpand('${13}')\n * // => ['{13}']\n *\n * braceExpand('a{b,f,m}p')\n * // => ['abp','afp','amp']\n *\n * braceExpand('-v{,,}')\n * // => ['-v','-v','-v']\n * ```\n */\nconst braceExpand = (pattern: string): string[] => {\n if (!pattern.match(/{.*}/)) {\n return [pattern];\n }\n\n return expand(pattern, true);\n};\n\nconst expand = (str: string, isTop?: boolean): string[] => {\n const expansions = [] as string[];\n const balance = decomposeString('{', '}', str);\n if (balance.start < 0) return [str];\n\n const parts = balance.body.split(',');\n // no need to expand pre, since it is guaranteed to be free of brace-sets\n const pre = balance.pre;\n const postParts = balance.post.length ? expand(balance.post, false) : [''];\n\n if (/\\$$/.test(balance.pre)) {\n postParts.forEach((postPart) => {\n const expansion = `${balance.pre.slice(0, -1)}{${\n balance.body\n }}${postPart}`;\n expansions.push(expansion);\n });\n } else {\n parts.forEach((part: string) => {\n postParts.forEach((postPart) => {\n const expansion = pre + part + postPart;\n if (!isTop || expansion) expansions.push(expansion);\n });\n });\n }\n\n return expansions;\n};\n\nexport { braceExpand };\n","import { braceExpand } from './utils/braceExpand';\n\nexport class Matcher {\n private readonly pattern: string;\n private readonly maxLength: number;\n private readonly set: (string | RegExp)[];\n private readonly empty: boolean;\n\n constructor(pattern: string, maxLength = 1024 * 64) {\n this.set = [];\n this.pattern = pattern.trim();\n this.maxLength = maxLength;\n this.empty = !this.pattern ? true : false;\n\n const set = braceExpand(pattern);\n this.set = set.map((val) => this.parse(val));\n this.set = this.set.filter((s) => {\n return Boolean(s);\n });\n }\n\n match(this: Matcher, str: string): boolean {\n if (this.empty) return str === '';\n\n return this.set.some((pattern) => this.matchOne(str, pattern));\n }\n\n private parse(pattern: string): string | RegExp {\n if (pattern.length > this.maxLength) {\n throw new TypeError('Pattern is too long');\n }\n let regExp;\n let hasSpecialCharacter = false;\n if (pattern === '') return '';\n\n const re = pattern.replace(/\\*/g, () => {\n hasSpecialCharacter = true;\n return '.+?';\n });\n\n // skip the regexp for non-* patterns\n // unescape anything in it, though, so that it'll be\n // an exact match.\n if (!hasSpecialCharacter) {\n return pattern.replace(/\\\\(.)/g, '$1');\n }\n\n try {\n regExp = new RegExp('^' + re + '$');\n } catch (error) {\n // If it was an invalid regular expression, then it can't match\n // anything.\n return new RegExp('$.');\n }\n\n return regExp;\n }\n\n private matchOne(str: string, pattern: string | RegExp): boolean {\n if (typeof pattern === 'string') {\n return str === pattern;\n }\n\n return Boolean(str.match(pattern));\n }\n}\n","/*\n https://github.com/banksean wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace\n so it's better encapsulated. Now you can have multiple random number generators\n and they won't stomp all over each other's state.\n If you want to use this as a substitute for Math.random(), use the random()\n method like so:\n var m = new MersenneTwister();\n var randomNumber = m.random();\n You can also call the other genrand_{foo}() methods on the instance.\n If you want to use a specific seed in order to get a repeatable random\n sequence, pass an integer into the constructor:\n var m = new MersenneTwister(123);\n and that will always produce the same random sequence.\n Sean McCullough (banksean@gmail.com)\n*/\n\n/*\n A C-program for MT19937, with initialization improved 2002/1/26.\n Coded by Takuji Nishimura and Makoto Matsumoto.\n Before using, initialize the state by using init_seed(seed)\n or init_by_array(init_key, key_length).\n Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,\n All rights reserved.\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions\n are met:\n 1. Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n 2. Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n 3. The names of its contributors may not be used to endorse or promote\n products derived from this software without specific prior written\n permission.\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n Any feedback is very welcome.\n http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html\n email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space)\n*/\n\nexport class MersenneTwister {\n private readonly N: number;\n private readonly M: number;\n private readonly MATRIX_A: number;\n private readonly UPPER_MASK: number;\n private readonly LOWER_MASK: number;\n private readonly mt: number[];\n private mti: number;\n\n constructor(seed?: number | number[]) {\n /* Period parameters */\n this.N = 624;\n this.M = 397;\n this.MATRIX_A = 0x9908b0df; /* constant vector a */\n this.UPPER_MASK = 0x80000000; /* most significant w-r bits */\n this.LOWER_MASK = 0x7fffffff; /* least significant r bits */\n\n this.mt = new Array(this.N); /* the array for the state vector */\n this.mti = this.N + 1; /* mti==N+1 means mt[N] is not initialized */\n\n if (Array.isArray(seed)) {\n if (seed.length > 0) this.initByArray(seed, seed.length);\n } else {\n if (seed === undefined) {\n this.initSeed(new Date().getTime());\n } else {\n this.initSeed(seed);\n }\n }\n }\n\n /* initializes mt[N] with a seed */\n /* origin name init_genrand */\n initSeed(seed: number): void {\n this.mt[0] = seed >>> 0;\n for (this.mti = 1; this.mti < this.N; this.mti++) {\n const s = this.mt[this.mti - 1] ^ (this.mt[this.mti - 1] >>> 30);\n this.mt[this.mti] =\n ((((s & 0xffff0000) >>> 16) * 1812433253) << 16) +\n (s & 0x0000ffff) * 1812433253 +\n this.mti;\n /* See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier. */\n /* In the previous versions, MSBs of the seed affect */\n /* only MSBs of the array mt[]. */\n /* 2002/01/09 modified by Makoto Matsumoto */\n this.mt[this.mti] >>>= 0;\n /* for >32 bit machines */\n }\n }\n\n /* initialize by an array with array-length */\n /* init_key is the array for initializing keys */\n /* key_length is its length */\n /* slight change for C++, 2004/2/26 */\n initByArray(initKey: number[], keyLength: number): void {\n this.initSeed(19650218);\n let i = 1;\n let j = 0;\n let k = this.N > keyLength ? this.N : keyLength;\n for (; k; k--) {\n const s = this.mt[i - 1] ^ (this.mt[i - 1] >>> 30);\n this.mt[i] =\n (this.mt[i] ^\n (((((s & 0xffff0000) >>> 16) * 1664525) << 16) +\n (s & 0x0000ffff) * 1664525)) +\n initKey[j] +\n j; /* non linear */\n this.mt[i] >>>= 0; /* for WORDSIZE > 32 machines */\n i++;\n j++;\n if (i >= this.N) {\n this.mt[0] = this.mt[this.N - 1];\n i = 1;\n }\n if (j >= keyLength) j = 0;\n }\n for (k = this.N - 1; k; k--) {\n const s = this.mt[i - 1] ^ (this.mt[i - 1] >>> 30);\n this.mt[i] =\n (this.mt[i] ^\n (((((s & 0xffff0000) >>> 16) * 1566083941) << 16) +\n (s & 0x0000ffff) * 1566083941)) -\n i; /* non linear */\n this.mt[i] >>>= 0; /* for WORDSIZE > 32 machines */\n i++;\n if (i >= this.N) {\n this.mt[0] = this.mt[this.N - 1];\n i = 1;\n }\n }\n\n this.mt[0] = 0x80000000; /* MSB is 1; assuring non-zero initial array */\n }\n\n /* generates a random number on [0,0xffffffff]-interval */\n /* origin name genrand_int32 */\n randomInt32(): number {\n let y;\n const mag01 = [0x0, this.MATRIX_A];\n /* mag01[x] = x * MATRIX_A for x=0,1 */\n\n if (this.mti >= this.N) {\n /* generate N words at one time */\n let kk;\n\n if (this.mti === this.N + 1)\n /* if init_seed() has not been called, */\n this.initSeed(5489); /* a default initial seed is used */\n\n for (kk = 0; kk < this.N - this.M; kk++) {\n y =\n (this.mt[kk] & this.UPPER_MASK) | (this.mt[kk + 1] & this.LOWER_MASK);\n this.mt[kk] = this.mt[kk + this.M] ^ (y >>> 1) ^ mag01[y & 0x1];\n }\n for (; kk < this.N - 1; kk++) {\n y =\n (this.mt[kk] & this.UPPER_MASK) | (this.mt[kk + 1] & this.LOWER_MASK);\n this.mt[kk] =\n this.mt[kk + (this.M - this.N)] ^ (y >>> 1) ^ mag01[y & 0x1];\n }\n y =\n (this.mt[this.N - 1] & this.UPPER_MASK) |\n (this.mt[0] & this.LOWER_MASK);\n this.mt[this.N - 1] = this.mt[this.M - 1] ^ (y >>> 1) ^ mag01[y & 0x1];\n\n this.mti = 0;\n }\n\n y = this.mt[this.mti++];\n\n /* Tempering */\n y ^= y >>> 11;\n y ^= (y << 7) & 0x9d2c5680;\n y ^= (y << 15) & 0xefc60000;\n y ^= y >>> 18;\n\n return y >>> 0;\n }\n\n /* generates a random number on [0,0x7fffffff]-interval */\n /* origin name genrand_int31 */\n randomInt31(): number {\n return this.randomInt32() >>> 1;\n }\n\n /* generates a random number on [0,1]-real-interval */\n /* origin name genrand_real1 */\n randomReal1(): number {\n return this.randomInt32() * (1.0 / 4294967295.0);\n /* divided by 2^32-1 */\n }\n\n /* generates a random number on [0,1)-real-interval */\n /* origin name genrand_real2 */\n randomReal2(): number {\n return this.randomInt32() * (1.0 / 4294967296.0);\n /* divided by 2^32 */\n }\n\n /* generates a random number on (0,1)-real-interval */\n /* origin name genrand_real3 */\n randomReal3(): number {\n return (this.randomInt32() + 0.5) * (1.0 / 4294967296.0);\n /* divided by 2^32 */\n }\n\n /* generates a random number on [0,1) with 53-bit resolution*/\n /* origin name genrand_res53 */\n randomRes53(): number {\n const a = this.randomInt32() >>> 5;\n const b = this.randomInt32() >>> 6;\n return (a * 67108864.0 + b) * (1.0 / 9007199254740992.0);\n }\n}\n\n/* These real versions are due to Isaku Wada, 2002/01/09 added */\n","import { MersenneTwister } from './mersenneTwister';\n\nconst replacePlaceholders = (mersenne: MersenneTwister) => (\n placeholder: string\n): string => {\n const random = Math.floor(mersenne.randomReal2() * 16);\n\n const value = placeholder === 'x' ? random : (random & 0x3) | 0x8;\n return value.toString(16);\n};\n\n/**\n * Generate a uuid.\n *\n * @private\n * @since 3.5.0\n * @returns {string} Returns the generated uuid.\n * @example\n * ```javascript\n * generateUUID()\n * // => 49e71c40-9b21-4371-9699-2def33f62e66\n *\n * generateUUID()\n * // => da94f128-4247-48e3-bc73-d0cae46b5093\n * ```\n */\nexport function generateUUID(): string {\n const mersenne = new MersenneTwister();\n const RFC4122_TEMPLATE = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx';\n\n return RFC4122_TEMPLATE.replace(/[xy]/g, replacePlaceholders(mersenne));\n}\n","/**\n * Boolean matching.\n *\n * @since 4.7.0\n * @category Boolean\n * @param {number} data The value to be compared.\n * @param {number} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is equal to `expected value`.\n * @example\n * ```javascript\n * bool(true, true)\n * // => true\n *\n * bool(true, false)\n * // => false\n * ```\n */\nexport function bool(data: boolean, expected: boolean): boolean {\n return (\n data === expected\n );\n}\n","export type DateType = Date | string;\n\nexport const convertDate = (date: DateType): number=>{\n if(date instanceof Date){\n return date.getTime();\n }\n\n return Date.parse(date);\n}","import {DateType, convertDate} from './convertDate';\n\n/**\n * Exact date matching.\n *\n * @since 4.8.0\n * @category Date\n * @param {Date} data The value to be compared.\n * @param {Date} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is equal to `expected value`.\n * @example\n * ```javascript\n * dateEquals('December 15, 1994 03:24:00', 'December 15, 1994 03:24:00')\n * // => true\n *\n * dateEquals('December 15, 2000 03:24:00', 'December 10, 2001 03:24:00')\n * // => false\n * ```\n */\nexport function dateEquals(data: DateType, expected: DateType): boolean {\n const convertedData = convertDate(data);\n const convertedExpectation = convertDate(expected);\n return (\n convertedData === convertedExpectation\n );\n}\n","import { DateType, convertDate } from './convertDate';\n\n/**\n * Matching after a specific date and time\n *\n * @since 4.11.0\n * @category Date\n * @param {Date} data The value to be compared.\n * @param {Date} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is after than `expected value`.\n * @example\n * ```javascript\n * dateGreaterThan('December 17, 1994 03:24:00', 'December 16, 1994 03:24:00')\n * // => true\n *\n * dateGreaterThan('December 15, 2000 03:24:00', 'December 15, 2000 03:24:00')\n * // => false\n * ```\n */\nexport function dateGreaterThan(data: DateType, expected: DateType): boolean {\n const convertedData = convertDate(data);\n const convertedExpectation = convertDate(expected);\n return convertedData > convertedExpectation;\n}\n","import { DateType, convertDate } from './convertDate';\n\n/**\n * Matching at or after a specific date and time\n *\n * @since 4.11.0\n * @category Date\n * @param {Date} data The value to be compared.\n * @param {Date} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is after than or equals `expected value`.\n * @example\n * ```javascript\n * dateGreaterThanEquals('December 17, 1994 03:24:00', 'December 16, 1994 03:24:00')\n * // => true\n *\n * dateGreaterThanEquals('December 15, 2000 03:24:00', 'December 15, 2000 03:25:00')\n * // => false\n * ```\n */\nexport function dateGreaterThanEquals(\n data: DateType,\n expected: DateType\n): boolean {\n const convertedData = convertDate(data);\n const convertedExpectation = convertDate(expected);\n return convertedData >= convertedExpectation;\n}\n","import {DateType, convertDate} from './convertDate';\n\n/**\n * Matching before a specific date and time\n *\n * @since 4.10.0\n * @category Date\n * @param {Date} data The value to be compared.\n * @param {Date} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is before than `expected value`.\n * @example\n * ```javascript\n * dateLessThan('December 15, 1994 03:24:00', 'December 16, 1994 03:24:00')\n * // => true\n *\n * dateLessThan('December 15, 2000 03:24:00', 'December 15, 2000 03:24:00')\n * // => false\n * ```\n */\nexport function dateLessThan(data: DateType, expected: DateType): boolean {\n const convertedData = convertDate(data);\n const convertedExpectation = convertDate(expected);\n return (\n convertedData < convertedExpectation\n );\n}\n","import {DateType, convertDate} from './convertDate';\n\n/**\n * Matching at or before a specific date and time\n *\n * @since 4.10.0\n * @category Date\n * @param {Date} data The value to be compared.\n * @param {Date} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is equal or before than `expected value`.\n * @example\n * ```javascript\n * dateLessThanEquals('December 15, 1994 03:24:00', 'December 15, 1994 03:24:00')\n * // => true\n *\n * dateLessThanEquals('December 15, 2000 03:24:00', 'December 15, 2000 03:24:00')\n * // => false\n * ```\n */\nexport function dateLessThanEquals(data: DateType, expected: DateType): boolean {\n const convertedData = convertDate(data);\n const convertedExpectation = convertDate(expected);\n return (\n convertedData <= convertedExpectation\n );\n}\n","import {DateType, convertDate} from './convertDate';\n\n/**\n * Negated date matching.\n *\n * @since 4.9.0\n * @category Date\n * @param {Date} data The value to be compared.\n * @param {Date} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is not equal to `expected value`.\n * @example\n * ```javascript\n * dateNotEquals('December 15, 1994 03:24:00', 'December 16, 1995 03:24:00')\n * // => true\n *\n * dateNotEquals('December 15, 2000 03:24:00', 'December 15, 2000 03:24:00')\n * // => false\n * ```\n */\nexport function dateNotEquals(data: DateType, expected: DateType): boolean {\n const convertedData = convertDate(data);\n const convertedExpectation = convertDate(expected);\n return (\n convertedData !== convertedExpectation\n );\n}\n","/**\n * Exact numeric matching.\n *\n * @since 4.6.0\n * @category Numeric\n * @param {number} data The value to be compared.\n * @param {number} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is equal to `expected value`.\n * @example\n * ```javascript\n * numericEquals(5, 5)\n * // => true\n *\n * numericEquals(2, 4)\n * // => false\n * ```\n */\nexport function numericEquals(data: number, expected: number): boolean {\n return (\n data === expected\n );\n}\n","/**\n * Numeric greater than matching.\n *\n * @since 4.6.0\n * @category Numeric\n * @param {number} data The value to be compared.\n * @param {number} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is greater than `expected value`.\n * @example\n * ```javascript\n * numericGreaterThan(6, 5)\n * // => true\n *\n * numericGreaterThan(4, 8)\n * // => false\n * ```\n */\nexport function numericGreaterThan(data: number, expected: number): boolean {\n return (\n data > expected\n );\n}\n","/**\n * Numeric greater than or equals matching.\n *\n * @since 4.6.0\n * @category Numeric\n * @param {number} data The value to be compared.\n * @param {number} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is greater than or equals `expected value`.\n * @example\n * ```javascript\n * numericGreaterThanEquals(5, 5)\n * // => true\n *\n * numericGreaterThanEquals(4, 8)\n * // => false\n * ```\n */\nexport function numericGreaterThanEquals(data: number, expected: number): boolean {\n return (\n data >= expected\n );\n}\n","/**\n * Numeric less than matching.\n *\n * @since 4.6.0\n * @category Numeric\n * @param {number} data The value to be compared.\n * @param {number} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is less than `expected value`.\n * @example\n * ```javascript\n * numericLessThan(5, 6)\n * // => true\n *\n * numericLessThan(8, 4)\n * // => false\n * ```\n */\nexport function numericLessThan(data: number, expected: number): boolean {\n return (\n data < expected\n );\n}\n","/**\n * Numeric less than or equals matching.\n *\n * @since 4.6.0\n * @category Numeric\n * @param {number} data The value to be compared.\n * @param {number} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is less than or equals `expected value`.\n * @example\n * ```javascript\n * numericLessThanEquals(5, 5)\n * // => true\n *\n * numericLessThanEquals(8, 4)\n * // => false\n * ```\n */\nexport function numericLessThanEquals(data: number, expected: number): boolean {\n return (\n data <= expected\n );\n}\n","/**\n * Negated numeric matching.\n *\n * @since 4.6.0\n * @category Numeric\n * @param {number} data The value to be compared.\n * @param {number} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is not equal to `expected value`.\n * @example\n * ```javascript\n * numericNotEquals(2, 4)\n * // => true\n *\n * numericNotEquals(5, 5)\n * // => false\n * ```\n */\nexport function numericNotEquals(data: number, expected: number): boolean {\n return (\n data !== expected\n );\n}\n","/**\n * Exact string matching, case sensitive.\n *\n * @since 4.3.0\n * @category String\n * @param {string} data The value to be compared.\n * @param {string} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is equal to `expected value`.\n * @example\n * ```javascript\n * stringEquals('hi', 'hi')\n * // => true\n *\n * stringEquals('hi', 'no')\n * // => false\n * ```\n */\nexport function stringEquals(data: string, expected: string): boolean {\n return (\n data === expected\n );\n}\n","/**\n * Exact string matching, ignoring case.\n *\n * @since 4.4.0\n * @category String\n * @param {string} data The value to be compared.\n * @param {string} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is equal to `expected value`.\n * @example\n * ```javascript\n * stringEqualsIgnoreCase('hi', 'Hi')\n * // => true\n *\n * stringEqualsIgnoreCase('hi', 'no')\n * // => false\n * ```\n */\nexport function stringEqualsIgnoreCase(data: string, expected: string): boolean {\n return (\n data.toLowerCase() === expected.toLowerCase()\n );\n}\n","import {Matcher} from '../../Matcher';\n\n/**\n * Case-sensitive matching. The values can include a multi-character match wildcard (*) anywhere in the string.\n *\n * @since 4.5.0\n * @category String\n * @param {string} data The value to be compared.\n * @param {string} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is equal like `expected value`.\n * @example\n * ```javascript\n * stringLike('newHouse', 'new*')\n * // => true\n *\n * stringLike('House', 'new*')\n * // => false\n * ```\n */\nexport function stringLike(data: string, expected: string): boolean {\n return (\n new Matcher(data).match(expected)\n );\n}\n","/**\n * Negated string matching.\n *\n * @since 4.4.0\n * @category String\n * @param {string} data The value to be compared.\n * @param {string} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is not equal to `expected value`.\n * @example\n * ```javascript\n * stringNotEquals('hi', 'no')\n * // => true\n * \n * stringNotEquals('hi', 'hi')\n * // => false\n * ```\n */\nexport function stringNotEquals(data: string, expected: string): boolean {\n return (\n data !== expected\n );\n}\n","/**\n * Negated string matching, ignoring case.\n *\n * @since 4.4.0\n * @category String\n * @param {string} data The value to be compared.\n * @param {string} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is not equal to `expected value`.\n * @example\n * ```javascript\n * stringNotEqualsIgnoreCase('hi', 'no')\n * // => true\n * \n * stringNotEqualsIgnoreCase('hi', 'Hi')\n * // => false\n * ```\n */\nexport function stringNotEqualsIgnoreCase(data: string, expected: string): boolean {\n return (\n data.toLowerCase() !== expected.toLowerCase()\n );\n}\n","import { bool } from './boolean/bool';\nimport { dateEquals } from './date/dateEquals';\nimport { dateGreaterThan } from './date/dateGreaterThan';\nimport { dateGreaterThanEquals } from './date/dateGreaterThanEquals';\nimport { dateLessThan } from './date/dateLessThan';\nimport { dateLessThanEquals } from './date/dateLessThanEquals';\nimport { dateNotEquals } from './date/dateNotEquals';\nimport { numericEquals } from './numeric/numericEquals';\nimport { numericGreaterThan } from './numeric/numericGreaterThan';\nimport { numericGreaterThanEquals } from './numeric/numericGreaterThanEquals';\nimport { numericLessThan } from './numeric/numericLessThan';\nimport { numericLessThanEquals } from './numeric/numericLessThanEquals';\nimport { numericNotEquals } from './numeric/numericNotEquals';\nimport { stringEquals } from './string/stringEquals';\nimport { stringEqualsIgnoreCase } from './string/stringEqualsIgnoreCase';\nimport { stringLike } from './string/stringLike';\nimport { stringNotEquals } from './string/stringNotEquals';\nimport { stringNotEqualsIgnoreCase } from './string/stringNotEqualsIgnoreCase';\n\nexport const operators: Record = {\n bool,\n dateEquals,\n dateGreaterThan,\n dateGreaterThanEquals,\n dateLessThan,\n dateLessThanEquals,\n dateNotEquals,\n numericEquals,\n numericGreaterThan,\n numericGreaterThanEquals,\n numericLessThan,\n numericLessThanEquals,\n numericNotEquals,\n stringEquals,\n stringEqualsIgnoreCase,\n stringLike,\n stringNotEquals,\n stringNotEqualsIgnoreCase\n};\n","import {\n EffectBlock,\n ConditionBlock,\n StatementInterface,\n MatchConditionInterface,\n MatchConditionResolverInterface\n} from './types';\nimport { getValueFromPath } from './utils/getValueFromPath';\nimport { generateUUID } from './utils/generateUUID';\nimport {operators} from './conditionOperators';\n\nabstract class Statement {\n protected sid: string;\n protected readonly condition?: ConditionBlock;\n effect: EffectBlock;\n\n constructor({ sid, effect = 'allow', condition }: StatementInterface) {\n if (!sid) {\n this.sid = generateUUID();\n } else {\n this.sid = sid;\n }\n this.effect = effect;\n this.condition = condition;\n }\n\n matchConditions(\n this: Statement,\n { context, conditionResolver }: MatchConditionInterface\n ): boolean {\n const { condition: conditions } = this;\n\n if(conditions && context){\n return Object.keys(conditions).every((condition) =>\n Object.keys(conditions[condition]).every((path) => {\n const conditionValues = conditions[condition][path];\n if (conditionValues instanceof Array) {\n return conditionValues.some((value) =>\n this.evaluateCondition({\n context,\n conditionResolver,\n condition,\n path,\n value\n })\n );\n }\n\n return this.evaluateCondition({\n context,\n conditionResolver,\n condition,\n path,\n value: conditionValues\n });\n })\n )\n }\n\n return true;\n }\n\n private evaluateCondition(\n this: Statement,\n { context, conditionResolver={}, path, value, condition }: MatchConditionResolverInterface\n ): boolean {\n\n const currentResolver= conditionResolver[condition] || operators[condition]\n\n if(currentResolver){\n return currentResolver(\n getValueFromPath(context, path),\n value\n )\n }\n return false;\n }\n}\n\nexport { Statement };\n","import { ActionBasedType, MatchActionBasedInterface } from './types';\nimport { Matcher } from './Matcher';\nimport { Statement } from './Statement';\nimport { applyContext } from './utils/applyContext';\n\nclass ActionBased extends Statement {\n private action?: string[];\n private notAction?: string[];\n private statement: ActionBasedType;\n\n constructor(action: ActionBasedType) {\n super(action);\n this.checkAndAssignActions(action);\n this.statement = { ...action, sid: this.sid };\n }\n\n getStatement(this: ActionBased): ActionBasedType {\n return this.statement;\n }\n\n matches(\n this: ActionBased,\n { action, context, conditionResolver }: MatchActionBasedInterface\n ): boolean {\n return (\n this.matchActions(action, context) &&\n this.matchNotActions(action, context) &&\n this.matchConditions({ context, conditionResolver })\n );\n }\n\n private checkAndAssignActions(action: ActionBasedType): void {\n const hasAction = 'action' in action;\n const hasNotAction = 'notAction' in action;\n if (hasAction && hasNotAction) {\n throw new TypeError(\n 'ActionBased statement should have an action or a notAction attribute, no both'\n );\n }\n if ('action' in action) {\n this.action =\n typeof action.action === 'string' ? [action.action] : action.action;\n } else {\n this.notAction =\n typeof action.notAction === 'string'\n ? [action.notAction]\n : action.notAction;\n }\n }\n\n private matchActions(action: string, context?: T): boolean {\n return this.action\n ? this.action.some((a) =>\n new Matcher(applyContext(a, context)).match(action)\n )\n : true;\n }\n\n private matchNotActions(action: string, context?: T): boolean {\n return this.notAction\n ? !this.notAction.some((a) =>\n new Matcher(applyContext(a, context)).match(action)\n )\n : true;\n }\n}\n\nexport { ActionBased };\n","import { IdentityBasedType, MatchIdentityBasedInterface } from './types';\nimport { Matcher } from './Matcher';\nimport { Statement } from './Statement';\nimport { applyContext } from './utils/applyContext';\n\nclass IdentityBased extends Statement {\n private resource?: string[];\n private action?: string[];\n private notResource?: string[];\n private notAction?: string[];\n private statement: IdentityBasedType;\n\n constructor(identity: IdentityBasedType) {\n super(identity);\n this.checkAndAssignActions(identity);\n this.checkAndAssignResources(identity);\n this.statement = { ...identity, sid: this.sid };\n }\n\n getStatement(this: IdentityBased): IdentityBasedType {\n return this.statement;\n }\n\n matches(\n this: IdentityBased,\n {\n action,\n resource,\n context,\n conditionResolver\n }: MatchIdentityBasedInterface\n ): boolean {\n return (\n this.matchActions(action, context) &&\n this.matchNotActions(action, context) &&\n this.matchResources(resource, context) &&\n this.matchNotResources(resource, context) &&\n this.matchConditions({ context, conditionResolver })\n );\n }\n\n private checkAndAssignActions(identity: IdentityBasedType): void {\n const hasAction = 'action' in identity;\n const hasNotAction = 'notAction' in identity;\n if (hasAction && hasNotAction) {\n throw new TypeError(\n 'IdentityBased statement should have an action or a notAction attribute, no both'\n );\n }\n if ('action' in identity) {\n this.action =\n typeof identity.action === 'string'\n ? [identity.action]\n : identity.action;\n } else {\n this.notAction =\n typeof identity.notAction === 'string'\n ? [identity.notAction]\n : identity.notAction;\n }\n }\n\n private checkAndAssignResources(identity: IdentityBasedType): void {\n const hasResource = 'resource' in identity;\n const hasNotResource = 'notResource' in identity;\n if (hasResource && hasNotResource) {\n throw new TypeError(\n 'IdentityBased statement should have a resource or a notResource attribute, no both'\n );\n }\n if ('resource' in identity) {\n this.resource =\n typeof identity.resource === 'string'\n ? [identity.resource]\n : identity.resource;\n } else {\n this.notResource =\n typeof identity.notResource === 'string'\n ? [identity.notResource]\n : identity.notResource;\n }\n }\n\n private matchActions(action: string, context?: T): boolean {\n return this.action\n ? this.action.some((a) =>\n new Matcher(applyContext(a, context)).match(action)\n )\n : true;\n }\n\n private matchNotActions(action: string, context?: T): boolean {\n return this.notAction\n ? !this.notAction.some((a) =>\n new Matcher(applyContext(a, context)).match(action)\n )\n : true;\n }\n\n private matchResources(resource: string, context?: T): boolean {\n return this.resource\n ? this.resource.some((a) =>\n new Matcher(applyContext(a, context)).match(resource)\n )\n : true;\n }\n\n private matchNotResources(resource: string, context?: T): boolean {\n return this.notResource\n ? !this.notResource.some((a) =>\n new Matcher(applyContext(a, context)).match(resource)\n )\n : true;\n }\n}\n\nexport { IdentityBased };\n","import {\n PrincipalMap,\n MatchResourceBasedInterface,\n ResourceBasedType\n} from './types';\nimport { Matcher } from './Matcher';\nimport { Statement } from './Statement';\nimport { applyContext } from './utils/applyContext';\n\nclass ResourceBased extends Statement {\n private principal?: PrincipalMap | string[];\n private resource?: string[];\n private action?: string[];\n private notPrincipal?: PrincipalMap | string[];\n private notResource?: string[];\n private notAction?: string[];\n private statement: ResourceBasedType;\n private hasPrincipals: boolean;\n private hasResources: boolean;\n\n constructor(identity: ResourceBasedType) {\n super(identity);\n this.hasPrincipals = false;\n this.hasResources = false;\n this.checkAndAssignActions(identity);\n this.checkAndAssignPrincipals(identity);\n this.checkAndAssignResources(identity);\n this.statement = { ...identity, sid: this.sid };\n }\n\n getStatement(this: ResourceBased): ResourceBasedType {\n return this.statement;\n }\n\n matches(\n this: ResourceBased,\n {\n principal,\n action,\n resource,\n principalType,\n context,\n conditionResolver\n }: MatchResourceBasedInterface\n ): boolean {\n return (\n this.matchPrincipalAndNotPrincipal(principal, principalType, context) &&\n this.matchActions(action, context) &&\n this.matchNotActions(action, context) &&\n this.matchResourceAndNotResource(resource, context) &&\n this.matchConditions({ context, conditionResolver })\n );\n }\n\n /*valueComing principal noPrincipal\n true false false false\n true true false true or false\n true false true true or false\n false false false true\n false true false false\n false false true false*/\n private matchPrincipalAndNotPrincipal(\n principal?: string,\n principalType?: string,\n context?: T\n ): boolean {\n if (principal) {\n if (this.hasPrincipals)\n return (\n this.matchPrincipals(principal, principalType, context) &&\n this.matchNotPrincipals(principal, principalType, context)\n );\n return false;\n }\n if (this.hasPrincipals) return false;\n return true;\n }\n\n /*valueComing resource noResource\n true false false false\n true true false true or false\n true false true true or false\n false false false true\n false true false false\n false false true false*/\n private matchResourceAndNotResource(resource?: string, context?: T): boolean {\n if (resource) {\n if (this.hasResources)\n return (\n this.matchResources(resource, context) &&\n this.matchNotResources(resource, context)\n );\n return false;\n }\n if (this.hasResources) return false;\n return true;\n }\n\n private checkAndAssignActions(identity: ResourceBasedType): void {\n const hasAction = 'action' in identity;\n const hasNotAction = 'notAction' in identity;\n if (hasAction && hasNotAction) {\n throw new TypeError(\n 'ResourceBased statement should have an action or a notAction attribute, no both'\n );\n }\n if ('action' in identity) {\n this.action =\n typeof identity.action === 'string'\n ? [identity.action]\n : identity.action;\n } else {\n this.notAction =\n typeof identity.notAction === 'string'\n ? [identity.notAction]\n : identity.notAction;\n }\n }\n\n private checkAndAssignPrincipals(identity: ResourceBasedType): void {\n const hasPrincipal = 'principal' in identity;\n const hasNotPrincipal = 'notPrincipal' in identity;\n if (hasPrincipal && hasNotPrincipal) {\n throw new TypeError(\n 'ResourceBased statement could have a principal or a notPrincipal attribute, no both'\n );\n }\n if ('principal' in identity) {\n this.principal =\n typeof identity.principal === 'string'\n ? [identity.principal]\n : identity.principal;\n this.hasPrincipals = true;\n } else if ('notPrincipal' in identity) {\n this.notPrincipal =\n typeof identity.notPrincipal === 'string'\n ? [identity.notPrincipal]\n : identity.notPrincipal;\n this.hasPrincipals = true;\n }\n }\n\n private checkAndAssignResources(identity: ResourceBasedType): void {\n const hasResource = 'resource' in identity;\n const hasNotResource = 'notResource' in identity;\n if (hasResource && hasNotResource) {\n throw new TypeError(\n 'ResourceBased statement could have a resource or a notResource attribute, no both'\n );\n }\n if ('resource' in identity) {\n this.resource =\n typeof identity.resource === 'string'\n ? [identity.resource]\n : identity.resource;\n this.hasResources = true;\n } else if ('notResource' in identity) {\n this.notResource =\n typeof identity.notResource === 'string'\n ? [identity.notResource]\n : identity.notResource;\n this.hasResources = true;\n }\n }\n\n private matchPrincipals(\n principal: string,\n principalType?: string,\n context?: T\n ): boolean {\n if (this.principal) {\n if (this.principal instanceof Array) {\n return principalType\n ? false\n : this.principal.some((a) =>\n new Matcher(applyContext(a, context)).match(principal)\n );\n } else {\n if (principalType) {\n const principalValues = this.principal[principalType];\n if (principalValues instanceof Array) {\n return principalValues.some((a) =>\n new Matcher(applyContext(a, context)).match(principal)\n );\n } else if (principalValues) {\n return new Matcher(applyContext(principalValues, context)).match(\n principal\n );\n }\n return false;\n }\n return false;\n }\n }\n return true;\n }\n\n private matchNotPrincipals(\n principal: string,\n principalType?: string,\n context?: T\n ): boolean {\n if (this.notPrincipal) {\n if (this.notPrincipal instanceof Array) {\n return principalType\n ? true\n : !this.notPrincipal.some((a) =>\n new Matcher(applyContext(a, context)).match(principal)\n );\n } else {\n if (principalType) {\n const principalValues = this.notPrincipal[principalType];\n if (principalValues instanceof Array) {\n return !principalValues.some((a) =>\n new Matcher(applyContext(a, context)).match(principal)\n );\n } else if (principalValues) {\n return !new Matcher(applyContext(principalValues, context)).match(\n principal\n );\n }\n return true;\n }\n return true;\n }\n }\n return true;\n }\n\n private matchActions(action: string, context?: T): boolean {\n return this.action\n ? this.action.some((a) =>\n new Matcher(applyContext(a, context)).match(action)\n )\n : true;\n }\n\n private matchNotActions(action: string, context?: T): boolean {\n return this.notAction\n ? !this.notAction.some((a) =>\n new Matcher(applyContext(a, context)).match(action)\n )\n : true;\n }\n\n private matchResources(resource: string, context?: T): boolean {\n return this.resource\n ? this.resource.some((a) =>\n new Matcher(applyContext(a, context)).match(resource)\n )\n : true;\n }\n\n private matchNotResources(resource: string, context?: T): boolean {\n return this.notResource\n ? !this.notResource.some((a) =>\n new Matcher(applyContext(a, context)).match(resource)\n )\n : true;\n }\n}\n\nexport { ResourceBased };\n","import { MatchConditionInterface, ConditionResolver } from './types';\n\nabstract class Policy {\n protected context?: T;\n protected conditionResolver?: ConditionResolver;\n\n constructor({ context, conditionResolver }: MatchConditionInterface) {\n this.context = context;\n this.conditionResolver = conditionResolver;\n }\n\n setContext(this: Policy, context: T): void {\n this.context = context;\n }\n\n getContext(this: Policy): T | undefined {\n return this.context;\n }\n\n setConditionResolver(\n this: Policy,\n conditionResolver: ConditionResolver\n ): void {\n this.conditionResolver = conditionResolver;\n }\n\n getConditionResolver(this: Policy): ConditionResolver | undefined {\n return this.conditionResolver;\n }\n\n abstract getStatements(this: Policy): U[];\n}\n\nexport { Policy };\n","import {\n ActionBasedType,\n ConditionResolver,\n EvaluateActionBasedInterface,\n ProxyOptions\n} from './types';\nimport { ActionBased } from './ActionBasedStatement';\nimport { Policy } from './Policy';\n\nexport interface ActionBasedPolicyInterface {\n statements: ActionBasedType[];\n conditionResolver?: ConditionResolver;\n context?: T;\n}\n\nexport class ActionBasedPolicy extends Policy<\n T,\n ActionBasedType\n> {\n private denyStatements: ActionBased[];\n private allowStatements: ActionBased[];\n private statements: ActionBasedType[];\n\n constructor({\n statements,\n conditionResolver,\n context\n }: ActionBasedPolicyInterface) {\n super({ context, conditionResolver });\n const statementInstances = statements.map(\n (statement) => new ActionBased(statement)\n );\n this.allowStatements = statementInstances.filter(\n (s) => s.effect === 'allow'\n );\n this.denyStatements = statementInstances.filter((s) => s.effect === 'deny');\n this.statements = statementInstances.map((statement) =>\n statement.getStatement()\n );\n }\n\n addStatement(this: ActionBasedPolicy, statement: ActionBasedType): void {\n const statementInstance = new ActionBased(statement);\n if (statementInstance.effect === 'allow') {\n this.allowStatements.push(statementInstance);\n } else {\n this.denyStatements.push(statementInstance);\n }\n this.statements.push(statementInstance.getStatement());\n }\n\n getStatements(this: ActionBasedPolicy): ActionBasedType[] {\n return this.statements;\n }\n\n evaluate(\n this: ActionBasedPolicy,\n { action, context }: EvaluateActionBasedInterface\n ): boolean {\n const args = { action, context };\n return !this.cannot(args) && this.can(args);\n }\n\n can(\n this: ActionBasedPolicy,\n { action, context }: EvaluateActionBasedInterface\n ): boolean {\n return this.allowStatements.some((s) =>\n s.matches({\n action,\n context: context || this.context,\n conditionResolver: this.conditionResolver\n })\n );\n }\n\n cannot(\n this: ActionBasedPolicy,\n { action, context }: EvaluateActionBasedInterface\n ): boolean {\n return this.denyStatements.some((s) =>\n s.matches({\n action,\n context: context || this.context,\n conditionResolver: this.conditionResolver\n })\n );\n }\n\n generateProxy(\n this: ActionBasedPolicy,\n obj: U,\n options: ProxyOptions = {}\n ): U {\n const { get = {}, set = {} } = options;\n const { allow: allowGet = true, propertyMap: propertyMapGet = {} } = get;\n const { allow: allowSet = true, propertyMap: propertyMapSet = {} } = set;\n const handler = {\n ...(allowGet\n ? {\n get: (target: U, prop: W): any => {\n if (prop in target) {\n if (typeof prop === 'string') {\n const property = propertyMapGet[prop] || prop;\n if (this.evaluate({ action: property })) return target[prop];\n throw new Error(`Unauthorize to get ${prop} property`);\n }\n }\n return target[prop];\n }\n }\n : {}),\n ...(allowSet\n ? {\n set: (target: U, prop: W, value: any): boolean => {\n if (typeof prop === 'string') {\n const property = propertyMapSet[prop] || prop;\n if (this.evaluate({ action: property })) {\n target[prop] = value;\n return true;\n } else throw new Error(`Unauthorize to set ${prop} property`);\n }\n return true;\n }\n }\n : {})\n };\n\n return new Proxy(obj, handler);\n }\n}\n","import {\n ConditionResolver,\n EvaluateIdentityBasedInterface,\n IdentityBasedType\n} from './types';\nimport { IdentityBased } from './IdentityBasedStatement';\nimport { Policy } from './Policy';\n\ninterface IdentityBasedPolicyInterface {\n statements: IdentityBasedType[];\n conditionResolver?: ConditionResolver;\n context?: T;\n}\n\nexport class IdentityBasedPolicy extends Policy<\n T,\n IdentityBasedType\n> {\n private denyStatements: IdentityBased[];\n private allowStatements: IdentityBased[];\n private statements: IdentityBasedType[];\n\n constructor({\n statements,\n conditionResolver,\n context\n }: IdentityBasedPolicyInterface) {\n super({ context, conditionResolver });\n const statementInstances = statements.map(\n (statement) => new IdentityBased(statement)\n );\n this.allowStatements = statementInstances.filter(\n (s) => s.effect === 'allow'\n );\n this.denyStatements = statementInstances.filter((s) => s.effect === 'deny');\n this.statements = statementInstances.map((statement) =>\n statement.getStatement()\n );\n }\n\n addStatement(\n this: IdentityBasedPolicy,\n statement: IdentityBasedType\n ): void {\n const statementInstance = new IdentityBased(statement);\n if (statementInstance.effect === 'allow') {\n this.allowStatements.push(statementInstance);\n } else {\n this.denyStatements.push(statementInstance);\n }\n this.statements.push(statementInstance.getStatement());\n }\n\n getStatements(this: IdentityBasedPolicy): IdentityBasedType[] {\n return this.statements;\n }\n\n evaluate(\n this: IdentityBasedPolicy,\n { action, resource, context }: EvaluateIdentityBasedInterface\n ): boolean {\n const args = { action, resource, context };\n return !this.cannot(args) && this.can(args);\n }\n\n can(\n this: IdentityBasedPolicy,\n { action, resource, context }: EvaluateIdentityBasedInterface\n ): boolean {\n return this.allowStatements.some((s) =>\n s.matches({\n action,\n resource,\n context: context || this.context,\n conditionResolver: this.conditionResolver\n })\n );\n }\n\n cannot(\n this: IdentityBasedPolicy,\n { action, resource, context }: EvaluateIdentityBasedInterface\n ): boolean {\n return this.denyStatements.some((s) =>\n s.matches({\n action,\n resource,\n context: context || this.context,\n conditionResolver: this.conditionResolver\n })\n );\n }\n}\n","import {\n ConditionResolver,\n EvaluateResourceBasedInterface,\n ResourceBasedType\n} from './types';\nimport { ResourceBased } from './ResourceBasedStatement';\nimport { Policy } from './Policy';\n\ninterface ResourceBasedPolicyInterface {\n statements: ResourceBasedType[];\n conditionResolver?: ConditionResolver;\n context?: T;\n}\n\nexport class ResourceBasedPolicy extends Policy<\n T,\n ResourceBasedType\n> {\n private denyStatements: ResourceBased[];\n private allowStatements: ResourceBased[];\n private statements: ResourceBasedType[];\n\n constructor({\n statements,\n conditionResolver,\n context\n }: ResourceBasedPolicyInterface) {\n super({ context, conditionResolver });\n const statementInstances = statements.map(\n (statement) => new ResourceBased(statement)\n );\n this.allowStatements = statementInstances.filter(\n (s) => s.effect === 'allow'\n );\n this.denyStatements = statementInstances.filter((s) => s.effect === 'deny');\n this.statements = statementInstances.map((statement) =>\n statement.getStatement()\n );\n }\n\n addStatement(\n this: ResourceBasedPolicy,\n statement: ResourceBasedType\n ): void {\n const statementInstance = new ResourceBased(statement);\n if (statementInstance.effect === 'allow') {\n this.allowStatements.push(statementInstance);\n } else {\n this.denyStatements.push(statementInstance);\n }\n this.statements.push(statementInstance.getStatement());\n }\n\n getStatements(this: ResourceBasedPolicy): ResourceBasedType[] {\n return this.statements;\n }\n\n evaluate(\n this: ResourceBasedPolicy,\n {\n principal,\n action,\n resource,\n principalType,\n context\n }: EvaluateResourceBasedInterface\n ): boolean {\n const args = { principal, action, resource, principalType, context };\n return !this.cannot(args) && this.can(args);\n }\n\n can(\n this: ResourceBasedPolicy,\n {\n principal,\n action,\n resource,\n principalType,\n context\n }: EvaluateResourceBasedInterface\n ): boolean {\n return this.allowStatements.some((s) =>\n s.matches({\n principal,\n action,\n resource,\n principalType,\n context: context || this.context,\n conditionResolver: this.conditionResolver\n })\n );\n }\n\n cannot(\n this: ResourceBasedPolicy,\n {\n principal,\n action,\n resource,\n principalType,\n context\n }: EvaluateResourceBasedInterface\n ): boolean {\n return this.denyStatements.some((s) =>\n s.matches({\n principal,\n action,\n resource,\n principalType,\n context: context || this.context,\n conditionResolver: this.conditionResolver\n })\n );\n }\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;SAgBgB,MAAM,CAAC,KAAc;IACnC,OAAO,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC/C;;AChBA;;;;;;;;;;;;;;;;SAgBgB,QAAQ,CAAC,KAAe;IACtC,MAAM,IAAI,GAAG,OAAO,KAAK,CAAC;IAC1B,QACE,IAAI,KAAK,QAAQ;SAChB,IAAI,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,iBAAiB,CAAC,EAC5E;AACJ;;ACtBA;AACA,MAAM,QAAQ,GAAG,CAAC,GAAG,CAAC,CAAC;AAEvB;;;;;;;;;;;;;;;SAegB,KAAK,CAAC,KAAc;IAClC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,QAAQ,CAAC,KAAK,CAAC,EAAE;QAChD,OAAO,KAAK,CAAC;KACd;IAED,OAAO,KAAK,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,KAAK,CAAC,QAAQ,GAAG,IAAI,GAAG,GAAG,KAAK,EAAE,C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C;SAC7C;QACD,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,iBAAiB,CAAC,YAAY,EAAE,CAAC,CAAC;KACxD;IAED,aAAa;QACX,OAAO,IAAI,CAAC,UAAU,CAAC;KACxB;IAED,QAAQ,CAEN,EACE,SAAS,EACT,MAAM,EACN,QAAQ,EACR,aAAa,EACb,OAAO,EAC2B;QAEpC,MAAM,IAAI,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC;QACrE,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;KAC7C;IAED,GAAG,CAED,EACE,SAAS,EACT,MAAM,EACN,QAAQ,EACR,aAAa,EACb,OAAO,EAC2B;QAEpC,OAAO,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KACjC,CAAC,CAAC,OAAO,CAAC;YACR,SAAS;YACT,MAAM;YACN,QAAQ;YACR,aAAa;YACb,OAAO,EAAE,OAAO,IAAI,IAAI,CAAC,OAAO;YAChC,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;SAC1C,CAAC,CACH,CAAC;KACH;IAED,MAAM,CAEJ,EACE,SAAS,EACT,MAAM,EACN,QAAQ,EACR,aAAa,EACb,OAAO,EAC2B;QAEpC,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,KAChC,CAAC,CAAC,OAAO,CAAC;YACR,SAAS;YACT,MAAM;YACN,QAAQ;YACR,aAAa;YACb,OAAO,EAAE,OAAO,IAAI,IAAI,CAAC,OAAO;YAChC,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;SAC1C,CAAC,CACH,CAAC;KACH;;;;;"} \ No newline at end of file diff --git a/dist/main.js b/dist/main.js index a189e6c..14b8d49 100644 --- a/dist/main.js +++ b/dist/main.js @@ -791,6 +791,52 @@ function dateEquals(data, expected) { return (convertedData === convertedExpectation); } +/** + * Matching after a specific date and time + * + * @since 4.11.0 + * @category Date + * @param {Date} data The value to be compared. + * @param {Date} expected The expected value. + * @returns {boolean} Returns `true` if `value` is after than `expected value`. + * @example + * ```javascript + * dateGreaterThan('December 17, 1994 03:24:00', 'December 16, 1994 03:24:00') + * // => true + * + * dateGreaterThan('December 15, 2000 03:24:00', 'December 15, 2000 03:24:00') + * // => false + * ``` + */ +function dateGreaterThan(data, expected) { + const convertedData = convertDate(data); + const convertedExpectation = convertDate(expected); + return convertedData > convertedExpectation; +} + +/** + * Matching at or after a specific date and time + * + * @since 4.11.0 + * @category Date + * @param {Date} data The value to be compared. + * @param {Date} expected The expected value. + * @returns {boolean} Returns `true` if `value` is after than or equals `expected value`. + * @example + * ```javascript + * dateGreaterThanEquals('December 17, 1994 03:24:00', 'December 16, 1994 03:24:00') + * // => true + * + * dateGreaterThanEquals('December 15, 2000 03:24:00', 'December 15, 2000 03:25:00') + * // => false + * ``` + */ +function dateGreaterThanEquals(data, expected) { + const convertedData = convertDate(data); + const convertedExpectation = convertDate(expected); + return convertedData >= convertedExpectation; +} + /** * Matching before a specific date and time * @@ -1094,6 +1140,8 @@ function stringNotEqualsIgnoreCase(data, expected) { const operators = { bool, dateEquals, + dateGreaterThan, + dateGreaterThanEquals, dateLessThan, dateLessThanEquals, dateNotEquals, diff --git a/dist/main.js.map b/dist/main.js.map index fc865bf..44ce0d5 100644 --- a/dist/main.js.map +++ b/dist/main.js.map @@ -1 +1 @@ -{"version":3,"file":"main.js","sources":["../src/utils/getTag.ts","../src/utils/isSymbol.ts","../src/utils/toKey.ts","../src/utils/isKey.ts","../src/utils/memoize.ts","../src/utils/memoizeCapped.ts","../src/utils/stringToPath.ts","../src/utils/getValueFromPath.ts","../src/utils/applyContext.ts","../src/utils/decomposeString.ts","../src/utils/braceExpand.ts","../src/Matcher.ts","../src/utils/mersenneTwister.ts","../src/utils/generateUUID.ts","../src/conditionOperators/boolean/bool.ts","../src/conditionOperators/date/convertDate.ts","../src/conditionOperators/date/dateEquals.ts","../src/conditionOperators/date/dateLessThan.ts","../src/conditionOperators/date/dateLessThanEquals.ts","../src/conditionOperators/date/dateNotEquals.ts","../src/conditionOperators/numeric/numericEquals.ts","../src/conditionOperators/numeric/numericGreaterThan.ts","../src/conditionOperators/numeric/numericGreaterThanEquals.ts","../src/conditionOperators/numeric/numericLessThan.ts","../src/conditionOperators/numeric/numericLessThanEquals.ts","../src/conditionOperators/numeric/numericNotEquals.ts","../src/conditionOperators/string/stringEquals.ts","../src/conditionOperators/string/stringEqualsIgnoreCase.ts","../src/conditionOperators/string/stringLike.ts","../src/conditionOperators/string/stringNotEquals.ts","../src/conditionOperators/string/stringNotEqualsIgnoreCase.ts","../src/conditionOperators/index.ts","../src/Statement.ts","../src/ActionBasedStatement.ts","../src/IdentityBasedStatement.ts","../src/ResourceBasedStatement.ts","../src/Policy.ts","../src/ActionBasedPolicy.ts","../src/IdentityBasedPolicy.ts","../src/ResourceBasedPolicy.ts"],"sourcesContent":["/**\n * Gets the `toStringTag` of `value`.\n *\n * @since 3.1.0\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n * @example\n * ```javascript\n * getTag(1)\n * // => '[object Number]'\n *\n * getTag(null)\n * // => '[object Null]'\n * ```\n */\nexport function getTag(value: unknown): string {\n return Object.prototype.toString.call(value);\n}\n","import { getTag } from './getTag';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @since 3.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n * ```javascript\n * isSymbol(Symbol())\n * // => true\n *\n * isSymbol('abc')\n * // => false\n * ```\n */\nexport function isSymbol(value?: unknown): value is symbol {\n const type = typeof value;\n return (\n type === 'symbol' ||\n (type === 'object' && value !== null && getTag(value) === '[object Symbol]')\n );\n}\n","import { isSymbol } from './isSymbol';\n\n/** Used as references for various `Number` constants. */\nconst INFINITY = 1 / 0;\n\n/**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @since 3.1.0\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n * @example\n *\n * toKey(Symbol.iterator)\n * // => true\n *\n * toKey('abc')\n * // => false\n */\nexport function toKey(value: unknown): string | symbol {\n if (typeof value === 'string' || isSymbol(value)) {\n return value;\n }\n\n return value === 0 && 1 / value === -INFINITY ? '-0' : `${value}`;\n}\n","import { isSymbol } from './isSymbol';\n\n/** Used to match property names within property paths. */\nconst reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/;\nconst reIsPlainProp = /^\\w*$/; //matches any word character (alphanumeric and underscore)\n\n/**\n * Checks if `value` is a property name and not a property path.\n *\n * @since 3.1.0\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n * @example\n * ```javascript\n * isKey(1)\n * // => true\n *\n * isKey('example[test]')\n * // => false\n *\n * isKey('a.b')\n * // => false\n *\n * const obj = {\n * '[a]': 5,\n * 'b.c': true\n * };\n *\n * isKey('[a]', obj)\n * // => true\n *\n * isKey('b.c', obj)\n * // => true\n * ```\n */\nexport function isKey(value: unknown, object?: T): boolean {\n const type = typeof value;\n if (\n type === 'number' ||\n type === 'boolean' ||\n value === null ||\n value === undefined ||\n isSymbol(value)\n ) {\n return true;\n }\n if (typeof value === 'string') {\n return (\n reIsPlainProp.test(value) ||\n !reIsDeepProp.test(value) ||\n (object !== null && value in Object(object))\n );\n }\n return false;\n}\n","import { MemoizeInterface } from '../types';\n\n/**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * @since 3.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n * ```javascript\n * const object = { 'a': 1, 'b': 2 }\n * const other = { 'c': 3, 'd': 4 }\n *\n * const values = memoize(values)\n * values(object)\n * // => [1, 2]\n *\n * values(other)\n * // => [3, 4]\n *\n * object.a = 2\n * values(object)\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b'])\n * values(object)\n * // => ['a', 'b']\n * ```\n */\nexport function memoize(\n func: (...args: unknown[]) => any,\n resolver?: (...args: unknown[]) => any\n): MemoizeInterface {\n const memoized = function (\n this: (...args: unknown[]) => any,\n ...args: unknown[]\n ): MemoizeInterface {\n const key = resolver ? resolver.apply(this, args) : args[0];\n const cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n const result = func.apply(this, args);\n cache.set(key, result);\n return result;\n };\n memoized.cache = new Map();\n return memoized;\n}\n\n/*const memoize = (fn: Function): Function => {\n const cache = {};\n return (...args): any => {\n const stringifiedArgs = JSON.stringify(args);\n const result = (cache[stringifiedArgs] =\n typeof cache[stringifiedArgs] === 'undefined'\n ? fn(...args)\n : cache[stringifiedArgs]);\n return result;\n };\n};*/\n","import { memoize } from './memoize';\nimport { MemoizeInterface } from '../types';\n\n/** Used as the maximum memoize cache size. */\nexport const MAX_MEMOIZE_SIZE = 500;\n\n/**\n * A specialized version of `memoize` which clears the memoized function's\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n *\n * @since 3.1.0\n * @private\n * @param {Function} func The function to have its output memoized.\n * @returns {Function} Returns the new memoized function.\n */\nexport function memoizeCapped(\n func: (...args: any) => unknown\n): MemoizeInterface {\n const result = memoize(func, (key: unknown) => {\n const { cache } = result;\n if (cache.size === MAX_MEMOIZE_SIZE) {\n cache.clear();\n }\n return key;\n });\n\n return result;\n}\n","import { memoizeCapped } from './memoizeCapped';\n\nconst charCodeOfDot = '.'.charCodeAt(0);\nconst reEscapeChar = /\\\\(\\\\)?/g;\nconst rePropName = RegExp(\n // Match anything that isn't a dot or bracket.\n '[^.[\\\\]]+' +\n '|' +\n // Or match property names within brackets.\n '\\\\[(?:' +\n // Match a non-string expression.\n '([^\"\\'][^[]*)' +\n '|' +\n // Or match strings (supports escaping characters).\n '([\"\\'])((?:(?!\\\\x02)[^\\\\\\\\]|\\\\\\\\.)*?)\\\\x02' +\n ')\\\\]' +\n '|' +\n // Or match \"\" as the space between consecutive dots or empty brackets.\n '(?=(?:\\\\.|\\\\[\\\\])(?:\\\\.|\\\\[\\\\]|$))',\n 'g'\n);\n\n/**\n * Converts `string` to a property path array.\n *\n * @since 3.1.0\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\nexport const stringToPath = memoizeCapped((string: string) => {\n const result = [];\n if (string.charCodeAt(0) === charCodeOfDot) {\n result.push('');\n }\n string.replace(\n rePropName,\n (\n match: string,\n expression: string,\n quote: string,\n subString: string\n ): string => {\n let key = match;\n if (quote) {\n key = subString.replace(reEscapeChar, '$1');\n } else if (expression) {\n key = expression.trim();\n }\n result.push(key);\n return '';\n }\n );\n return result;\n});\n","import { toKey } from './toKey';\nimport { isKey } from './isKey';\nimport { stringToPath } from './stringToPath';\n\n/**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {Object} [object] The object to query keys on.\n * @returns {Array} Returns the cast property path array.\n */\nexport function castPath(\n value: unknown,\n object: U\n): Array {\n if (Array.isArray(value)) {\n return value;\n }\n\n return isKey(value, object) ? [value] : stringToPath(value);\n}\n\n/**\n * The base implementation of `get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\nexport function baseGet(\n object: U,\n path: Array | string\n): any {\n const newPath = castPath(path, object);\n\n let index = 0;\n const length = newPath.length;\n\n let value: any = object;\n while (value instanceof Object && index < length) {\n value = value[toKey(newPath[index++])];\n }\n\n return index && index === length ? value : undefined;\n}\n\n/**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @since 3.1.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * const object = { 'a': [{ 'b': { 'c': 3 } }] }\n *\n * getValueFromPath(object, 'a[0].b.c')\n * // => 3\n *\n * getValueFromPath(object, ['a', '0', 'b', 'c'])\n * // => 3\n *\n * getValueFromPath(object, 'a.b.c', 'default')\n * // => 'default'\n */\nexport function getValueFromPath(\n object: U,\n path: Array | string,\n defaultValue?: unknown\n): any {\n const result = object === null ? undefined : baseGet(object, path);\n\n return result === undefined ? defaultValue : result;\n}\n","import { getValueFromPath } from './getValueFromPath';\n\nconst reDelimiters = /\\${([^}]*)}/g;\nconst trim = / +(?= )|^\\s+|\\s+$/g;\n\nconst specialTrim = (str: string): string => str.replace(trim, '');\n\n/**\n * Apply the context value in a string.\n *\n * @param {string} str Pattern string, containing context path.\n * @param {object} context Object to get values from path.\n * @returns {string} Returns a string with embedded context values.\n * @example\n * ```javascript\n * const context = {\n * user: { id: 456, bestFriends: [123, 532, 987] }\n * };\n * applyContext('secrets:${user.id}:*', context)\n * // => 'secrets:456:*'\n *\n * applyContext('secrets:${user.bestFriends}:*', context)\n * // => 'secrets:{123,532,987}:*'\n *\n * applyContext('secrets:${company.address}:account', context)\n * // => 'secrets:undefined:account'\n * ```\n */\nexport function applyContext(\n str: string,\n context?: T\n): string {\n if (!context) return str;\n\n return specialTrim(\n str.replace(reDelimiters, (_, path: string) => {\n const value = getValueFromPath(context, path);\n if (Array.isArray(value)) return `{${value}}`;\n if (value instanceof Object) return 'undefined';\n\n return String(value);\n })\n );\n}\n","import { DecomposeString } from '../types';\n\n/**\n * Get index range where separators are found.\n *\n * @private\n * @since 3.1.1\n * @param {string} initialSeparator First string to be found.\n * @param {string} finalSeparator Second string to be found.\n * @param {string} str String to be decomposed.\n * @returns {number[]} Returns the beginning and final index for those matches.\n * @example\n * ```javascript\n * getIndexRange('first', 'Second', 'firstAndSecond')\n * // => [0, 8]\n *\n * getIndexRange('First', 'Second', '++FirstAndSecond**')\n * // => [2, 10]\n * ```\n */\nfunction getIndexRange(\n initialSeparator: string,\n finalSeparator: string,\n str: string\n): number[] {\n const beginningIndex = str.indexOf(initialSeparator);\n const finalIndex = str.indexOf(finalSeparator, beginningIndex + 1);\n\n if (beginningIndex >= 0 && finalIndex > 0) {\n return [beginningIndex, finalIndex];\n }\n\n return [-1, -1];\n}\n\n/**\n * Object returned by decomposeString function\n *\n * @typedef {Object} DecomposedString\n * @property {number} start Beginning index for first separator match\n * @property {number} end Final index for second separator match\n * @property {string} pre Substring before first separator\n * @property {string} body Substring between separators\n * @property {string} post Substring after second separator\n */\n\n/**\n * Decompose string in pre, body and post strings by using separators.\n *\n * @private\n * @since 3.1.1\n * @param {string} initialSeparator First string to be found.\n * @param {string} finalSeparator Second string to be found.\n * @param {string} str String to be decomposed.\n * @returns {DecomposedString} Returns a decompose string.\n * @example\n * ```javascript\n * decomposeString('first', 'Second', 'firstAndSecond')\n * // => { start: 0, end: 8, pre: '', body: 'And', post: '' }\n *\n * decomposeString('First', 'Second', '++FirstAndSecond**')\n * // => { start: 2, end: 10, pre: '++', body: 'And', post: '**' }\n * ```\n */\nexport function decomposeString(\n initialSeparator: string,\n finalSeparator: string,\n str: string\n): DecomposeString {\n const [beginningIndex, finalIndex] = getIndexRange(\n initialSeparator,\n finalSeparator,\n str\n );\n\n return {\n start: beginningIndex,\n end: finalIndex,\n pre: beginningIndex >= 0 ? str.slice(0, beginningIndex) : '',\n body:\n beginningIndex >= 0\n ? str.slice(beginningIndex + initialSeparator.length, finalIndex)\n : '',\n post:\n beginningIndex >= 0 ? str.slice(finalIndex + finalSeparator.length) : ''\n };\n}\n","import { decomposeString } from './decomposeString';\n\n/**\n * Generate an array of string depending on {} blocks.\n *\n * @param {string} pattern Pattern string that can contains {} blocks.\n * @returns {string[]} Returns an array of string with all the combinations.\n * @example\n * ```javascript\n * braceExpand('${13}')\n * // => ['{13}']\n *\n * braceExpand('a{b,f,m}p')\n * // => ['abp','afp','amp']\n *\n * braceExpand('-v{,,}')\n * // => ['-v','-v','-v']\n * ```\n */\nconst braceExpand = (pattern: string): string[] => {\n if (!pattern.match(/{.*}/)) {\n return [pattern];\n }\n\n return expand(pattern, true);\n};\n\nconst expand = (str: string, isTop?: boolean): string[] => {\n const expansions = [] as string[];\n const balance = decomposeString('{', '}', str);\n if (balance.start < 0) return [str];\n\n const parts = balance.body.split(',');\n // no need to expand pre, since it is guaranteed to be free of brace-sets\n const pre = balance.pre;\n const postParts = balance.post.length ? expand(balance.post, false) : [''];\n\n if (/\\$$/.test(balance.pre)) {\n postParts.forEach((postPart) => {\n const expansion = `${balance.pre.slice(0, -1)}{${\n balance.body\n }}${postPart}`;\n expansions.push(expansion);\n });\n } else {\n parts.forEach((part: string) => {\n postParts.forEach((postPart) => {\n const expansion = pre + part + postPart;\n if (!isTop || expansion) expansions.push(expansion);\n });\n });\n }\n\n return expansions;\n};\n\nexport { braceExpand };\n","import { braceExpand } from './utils/braceExpand';\n\nexport class Matcher {\n private readonly pattern: string;\n private readonly maxLength: number;\n private readonly set: (string | RegExp)[];\n private readonly empty: boolean;\n\n constructor(pattern: string, maxLength = 1024 * 64) {\n this.set = [];\n this.pattern = pattern.trim();\n this.maxLength = maxLength;\n this.empty = !this.pattern ? true : false;\n\n const set = braceExpand(pattern);\n this.set = set.map((val) => this.parse(val));\n this.set = this.set.filter((s) => {\n return Boolean(s);\n });\n }\n\n match(this: Matcher, str: string): boolean {\n if (this.empty) return str === '';\n\n return this.set.some((pattern) => this.matchOne(str, pattern));\n }\n\n private parse(pattern: string): string | RegExp {\n if (pattern.length > this.maxLength) {\n throw new TypeError('Pattern is too long');\n }\n let regExp;\n let hasSpecialCharacter = false;\n if (pattern === '') return '';\n\n const re = pattern.replace(/\\*/g, () => {\n hasSpecialCharacter = true;\n return '.+?';\n });\n\n // skip the regexp for non-* patterns\n // unescape anything in it, though, so that it'll be\n // an exact match.\n if (!hasSpecialCharacter) {\n return pattern.replace(/\\\\(.)/g, '$1');\n }\n\n try {\n regExp = new RegExp('^' + re + '$');\n } catch (error) {\n // If it was an invalid regular expression, then it can't match\n // anything.\n return new RegExp('$.');\n }\n\n return regExp;\n }\n\n private matchOne(str: string, pattern: string | RegExp): boolean {\n if (typeof pattern === 'string') {\n return str === pattern;\n }\n\n return Boolean(str.match(pattern));\n }\n}\n","/*\n https://github.com/banksean wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace\n so it's better encapsulated. Now you can have multiple random number generators\n and they won't stomp all over each other's state.\n If you want to use this as a substitute for Math.random(), use the random()\n method like so:\n var m = new MersenneTwister();\n var randomNumber = m.random();\n You can also call the other genrand_{foo}() methods on the instance.\n If you want to use a specific seed in order to get a repeatable random\n sequence, pass an integer into the constructor:\n var m = new MersenneTwister(123);\n and that will always produce the same random sequence.\n Sean McCullough (banksean@gmail.com)\n*/\n\n/*\n A C-program for MT19937, with initialization improved 2002/1/26.\n Coded by Takuji Nishimura and Makoto Matsumoto.\n Before using, initialize the state by using init_seed(seed)\n or init_by_array(init_key, key_length).\n Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,\n All rights reserved.\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions\n are met:\n 1. Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n 2. Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n 3. The names of its contributors may not be used to endorse or promote\n products derived from this software without specific prior written\n permission.\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n Any feedback is very welcome.\n http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html\n email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space)\n*/\n\nexport class MersenneTwister {\n private readonly N: number;\n private readonly M: number;\n private readonly MATRIX_A: number;\n private readonly UPPER_MASK: number;\n private readonly LOWER_MASK: number;\n private readonly mt: number[];\n private mti: number;\n\n constructor(seed?: number | number[]) {\n /* Period parameters */\n this.N = 624;\n this.M = 397;\n this.MATRIX_A = 0x9908b0df; /* constant vector a */\n this.UPPER_MASK = 0x80000000; /* most significant w-r bits */\n this.LOWER_MASK = 0x7fffffff; /* least significant r bits */\n\n this.mt = new Array(this.N); /* the array for the state vector */\n this.mti = this.N + 1; /* mti==N+1 means mt[N] is not initialized */\n\n if (Array.isArray(seed)) {\n if (seed.length > 0) this.initByArray(seed, seed.length);\n } else {\n if (seed === undefined) {\n this.initSeed(new Date().getTime());\n } else {\n this.initSeed(seed);\n }\n }\n }\n\n /* initializes mt[N] with a seed */\n /* origin name init_genrand */\n initSeed(seed: number): void {\n this.mt[0] = seed >>> 0;\n for (this.mti = 1; this.mti < this.N; this.mti++) {\n const s = this.mt[this.mti - 1] ^ (this.mt[this.mti - 1] >>> 30);\n this.mt[this.mti] =\n ((((s & 0xffff0000) >>> 16) * 1812433253) << 16) +\n (s & 0x0000ffff) * 1812433253 +\n this.mti;\n /* See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier. */\n /* In the previous versions, MSBs of the seed affect */\n /* only MSBs of the array mt[]. */\n /* 2002/01/09 modified by Makoto Matsumoto */\n this.mt[this.mti] >>>= 0;\n /* for >32 bit machines */\n }\n }\n\n /* initialize by an array with array-length */\n /* init_key is the array for initializing keys */\n /* key_length is its length */\n /* slight change for C++, 2004/2/26 */\n initByArray(initKey: number[], keyLength: number): void {\n this.initSeed(19650218);\n let i = 1;\n let j = 0;\n let k = this.N > keyLength ? this.N : keyLength;\n for (; k; k--) {\n const s = this.mt[i - 1] ^ (this.mt[i - 1] >>> 30);\n this.mt[i] =\n (this.mt[i] ^\n (((((s & 0xffff0000) >>> 16) * 1664525) << 16) +\n (s & 0x0000ffff) * 1664525)) +\n initKey[j] +\n j; /* non linear */\n this.mt[i] >>>= 0; /* for WORDSIZE > 32 machines */\n i++;\n j++;\n if (i >= this.N) {\n this.mt[0] = this.mt[this.N - 1];\n i = 1;\n }\n if (j >= keyLength) j = 0;\n }\n for (k = this.N - 1; k; k--) {\n const s = this.mt[i - 1] ^ (this.mt[i - 1] >>> 30);\n this.mt[i] =\n (this.mt[i] ^\n (((((s & 0xffff0000) >>> 16) * 1566083941) << 16) +\n (s & 0x0000ffff) * 1566083941)) -\n i; /* non linear */\n this.mt[i] >>>= 0; /* for WORDSIZE > 32 machines */\n i++;\n if (i >= this.N) {\n this.mt[0] = this.mt[this.N - 1];\n i = 1;\n }\n }\n\n this.mt[0] = 0x80000000; /* MSB is 1; assuring non-zero initial array */\n }\n\n /* generates a random number on [0,0xffffffff]-interval */\n /* origin name genrand_int32 */\n randomInt32(): number {\n let y;\n const mag01 = [0x0, this.MATRIX_A];\n /* mag01[x] = x * MATRIX_A for x=0,1 */\n\n if (this.mti >= this.N) {\n /* generate N words at one time */\n let kk;\n\n if (this.mti === this.N + 1)\n /* if init_seed() has not been called, */\n this.initSeed(5489); /* a default initial seed is used */\n\n for (kk = 0; kk < this.N - this.M; kk++) {\n y =\n (this.mt[kk] & this.UPPER_MASK) | (this.mt[kk + 1] & this.LOWER_MASK);\n this.mt[kk] = this.mt[kk + this.M] ^ (y >>> 1) ^ mag01[y & 0x1];\n }\n for (; kk < this.N - 1; kk++) {\n y =\n (this.mt[kk] & this.UPPER_MASK) | (this.mt[kk + 1] & this.LOWER_MASK);\n this.mt[kk] =\n this.mt[kk + (this.M - this.N)] ^ (y >>> 1) ^ mag01[y & 0x1];\n }\n y =\n (this.mt[this.N - 1] & this.UPPER_MASK) |\n (this.mt[0] & this.LOWER_MASK);\n this.mt[this.N - 1] = this.mt[this.M - 1] ^ (y >>> 1) ^ mag01[y & 0x1];\n\n this.mti = 0;\n }\n\n y = this.mt[this.mti++];\n\n /* Tempering */\n y ^= y >>> 11;\n y ^= (y << 7) & 0x9d2c5680;\n y ^= (y << 15) & 0xefc60000;\n y ^= y >>> 18;\n\n return y >>> 0;\n }\n\n /* generates a random number on [0,0x7fffffff]-interval */\n /* origin name genrand_int31 */\n randomInt31(): number {\n return this.randomInt32() >>> 1;\n }\n\n /* generates a random number on [0,1]-real-interval */\n /* origin name genrand_real1 */\n randomReal1(): number {\n return this.randomInt32() * (1.0 / 4294967295.0);\n /* divided by 2^32-1 */\n }\n\n /* generates a random number on [0,1)-real-interval */\n /* origin name genrand_real2 */\n randomReal2(): number {\n return this.randomInt32() * (1.0 / 4294967296.0);\n /* divided by 2^32 */\n }\n\n /* generates a random number on (0,1)-real-interval */\n /* origin name genrand_real3 */\n randomReal3(): number {\n return (this.randomInt32() + 0.5) * (1.0 / 4294967296.0);\n /* divided by 2^32 */\n }\n\n /* generates a random number on [0,1) with 53-bit resolution*/\n /* origin name genrand_res53 */\n randomRes53(): number {\n const a = this.randomInt32() >>> 5;\n const b = this.randomInt32() >>> 6;\n return (a * 67108864.0 + b) * (1.0 / 9007199254740992.0);\n }\n}\n\n/* These real versions are due to Isaku Wada, 2002/01/09 added */\n","import { MersenneTwister } from './mersenneTwister';\n\nconst replacePlaceholders = (mersenne: MersenneTwister) => (\n placeholder: string\n): string => {\n const random = Math.floor(mersenne.randomReal2() * 16);\n\n const value = placeholder === 'x' ? random : (random & 0x3) | 0x8;\n return value.toString(16);\n};\n\n/**\n * Generate a uuid.\n *\n * @private\n * @since 3.5.0\n * @returns {string} Returns the generated uuid.\n * @example\n * ```javascript\n * generateUUID()\n * // => 49e71c40-9b21-4371-9699-2def33f62e66\n *\n * generateUUID()\n * // => da94f128-4247-48e3-bc73-d0cae46b5093\n * ```\n */\nexport function generateUUID(): string {\n const mersenne = new MersenneTwister();\n const RFC4122_TEMPLATE = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx';\n\n return RFC4122_TEMPLATE.replace(/[xy]/g, replacePlaceholders(mersenne));\n}\n","/**\n * Boolean matching.\n *\n * @since 4.7.0\n * @category Boolean\n * @param {number} data The value to be compared.\n * @param {number} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is equal to `expected value`.\n * @example\n * ```javascript\n * bool(true, true)\n * // => true\n *\n * bool(true, false)\n * // => false\n * ```\n */\nexport function bool(data: boolean, expected: boolean): boolean {\n return (\n data === expected\n );\n}\n","export type DateType = Date | string;\n\nexport const convertDate = (date: DateType): number=>{\n if(date instanceof Date){\n return date.getTime();\n }\n\n return Date.parse(date);\n}","import {DateType, convertDate} from './convertDate';\n\n/**\n * Exact date matching.\n *\n * @since 4.8.0\n * @category Date\n * @param {Date} data The value to be compared.\n * @param {Date} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is equal to `expected value`.\n * @example\n * ```javascript\n * dateEquals('December 15, 1994 03:24:00', 'December 15, 1994 03:24:00')\n * // => true\n *\n * dateEquals('December 15, 2000 03:24:00', 'December 10, 2001 03:24:00')\n * // => false\n * ```\n */\nexport function dateEquals(data: DateType, expected: DateType): boolean {\n const convertedData = convertDate(data);\n const convertedExpectation = convertDate(expected);\n return (\n convertedData === convertedExpectation\n );\n}\n","import {DateType, convertDate} from './convertDate';\n\n/**\n * Matching before a specific date and time\n *\n * @since 4.10.0\n * @category Date\n * @param {Date} data The value to be compared.\n * @param {Date} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is before than `expected value`.\n * @example\n * ```javascript\n * dateLessThan('December 15, 1994 03:24:00', 'December 16, 1994 03:24:00')\n * // => true\n *\n * dateLessThan('December 15, 2000 03:24:00', 'December 15, 2000 03:24:00')\n * // => false\n * ```\n */\nexport function dateLessThan(data: DateType, expected: DateType): boolean {\n const convertedData = convertDate(data);\n const convertedExpectation = convertDate(expected);\n return (\n convertedData < convertedExpectation\n );\n}\n","import {DateType, convertDate} from './convertDate';\n\n/**\n * Matching at or before a specific date and time\n *\n * @since 4.10.0\n * @category Date\n * @param {Date} data The value to be compared.\n * @param {Date} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is equal or before than `expected value`.\n * @example\n * ```javascript\n * dateLessThanEquals('December 15, 1994 03:24:00', 'December 15, 1994 03:24:00')\n * // => true\n *\n * dateLessThanEquals('December 15, 2000 03:24:00', 'December 15, 2000 03:24:00')\n * // => false\n * ```\n */\nexport function dateLessThanEquals(data: DateType, expected: DateType): boolean {\n const convertedData = convertDate(data);\n const convertedExpectation = convertDate(expected);\n return (\n convertedData <= convertedExpectation\n );\n}\n","import {DateType, convertDate} from './convertDate';\n\n/**\n * Negated date matching.\n *\n * @since 4.9.0\n * @category Date\n * @param {Date} data The value to be compared.\n * @param {Date} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is not equal to `expected value`.\n * @example\n * ```javascript\n * dateNotEquals('December 15, 1994 03:24:00', 'December 16, 1995 03:24:00')\n * // => true\n *\n * dateNotEquals('December 15, 2000 03:24:00', 'December 15, 2000 03:24:00')\n * // => false\n * ```\n */\nexport function dateNotEquals(data: DateType, expected: DateType): boolean {\n const convertedData = convertDate(data);\n const convertedExpectation = convertDate(expected);\n return (\n convertedData !== convertedExpectation\n );\n}\n","/**\n * Exact numeric matching.\n *\n * @since 4.6.0\n * @category Numeric\n * @param {number} data The value to be compared.\n * @param {number} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is equal to `expected value`.\n * @example\n * ```javascript\n * numericEquals(5, 5)\n * // => true\n *\n * numericEquals(2, 4)\n * // => false\n * ```\n */\nexport function numericEquals(data: number, expected: number): boolean {\n return (\n data === expected\n );\n}\n","/**\n * Numeric greater than matching.\n *\n * @since 4.6.0\n * @category Numeric\n * @param {number} data The value to be compared.\n * @param {number} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is greater than `expected value`.\n * @example\n * ```javascript\n * numericGreaterThan(6, 5)\n * // => true\n *\n * numericGreaterThan(4, 8)\n * // => false\n * ```\n */\nexport function numericGreaterThan(data: number, expected: number): boolean {\n return (\n data > expected\n );\n}\n","/**\n * Numeric greater than or equals matching.\n *\n * @since 4.6.0\n * @category Numeric\n * @param {number} data The value to be compared.\n * @param {number} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is greater than or equals `expected value`.\n * @example\n * ```javascript\n * numericGreaterThanEquals(5, 5)\n * // => true\n *\n * numericGreaterThanEquals(4, 8)\n * // => false\n * ```\n */\nexport function numericGreaterThanEquals(data: number, expected: number): boolean {\n return (\n data >= expected\n );\n}\n","/**\n * Numeric less than matching.\n *\n * @since 4.6.0\n * @category Numeric\n * @param {number} data The value to be compared.\n * @param {number} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is less than `expected value`.\n * @example\n * ```javascript\n * numericLessThan(5, 6)\n * // => true\n *\n * numericLessThan(8, 4)\n * // => false\n * ```\n */\nexport function numericLessThan(data: number, expected: number): boolean {\n return (\n data < expected\n );\n}\n","/**\n * Numeric less than or equals matching.\n *\n * @since 4.6.0\n * @category Numeric\n * @param {number} data The value to be compared.\n * @param {number} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is less than or equals `expected value`.\n * @example\n * ```javascript\n * numericLessThanEquals(5, 5)\n * // => true\n *\n * numericLessThanEquals(8, 4)\n * // => false\n * ```\n */\nexport function numericLessThanEquals(data: number, expected: number): boolean {\n return (\n data <= expected\n );\n}\n","/**\n * Negated numeric matching.\n *\n * @since 4.6.0\n * @category Numeric\n * @param {number} data The value to be compared.\n * @param {number} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is not equal to `expected value`.\n * @example\n * ```javascript\n * numericNotEquals(2, 4)\n * // => true\n *\n * numericNotEquals(5, 5)\n * // => false\n * ```\n */\nexport function numericNotEquals(data: number, expected: number): boolean {\n return (\n data !== expected\n );\n}\n","/**\n * Exact string matching, case sensitive.\n *\n * @since 4.3.0\n * @category String\n * @param {string} data The value to be compared.\n * @param {string} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is equal to `expected value`.\n * @example\n * ```javascript\n * stringEquals('hi', 'hi')\n * // => true\n *\n * stringEquals('hi', 'no')\n * // => false\n * ```\n */\nexport function stringEquals(data: string, expected: string): boolean {\n return (\n data === expected\n );\n}\n","/**\n * Exact string matching, ignoring case.\n *\n * @since 4.4.0\n * @category String\n * @param {string} data The value to be compared.\n * @param {string} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is equal to `expected value`.\n * @example\n * ```javascript\n * stringEqualsIgnoreCase('hi', 'Hi')\n * // => true\n *\n * stringEqualsIgnoreCase('hi', 'no')\n * // => false\n * ```\n */\nexport function stringEqualsIgnoreCase(data: string, expected: string): boolean {\n return (\n data.toLowerCase() === expected.toLowerCase()\n );\n}\n","import {Matcher} from '../../Matcher';\n\n/**\n * Case-sensitive matching. The values can include a multi-character match wildcard (*) anywhere in the string.\n *\n * @since 4.5.0\n * @category String\n * @param {string} data The value to be compared.\n * @param {string} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is equal like `expected value`.\n * @example\n * ```javascript\n * stringLike('newHouse', 'new*')\n * // => true\n *\n * stringLike('House', 'new*')\n * // => false\n * ```\n */\nexport function stringLike(data: string, expected: string): boolean {\n return (\n new Matcher(data).match(expected)\n );\n}\n","/**\n * Negated string matching.\n *\n * @since 4.4.0\n * @category String\n * @param {string} data The value to be compared.\n * @param {string} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is not equal to `expected value`.\n * @example\n * ```javascript\n * stringNotEquals('hi', 'no')\n * // => true\n * \n * stringNotEquals('hi', 'hi')\n * // => false\n * ```\n */\nexport function stringNotEquals(data: string, expected: string): boolean {\n return (\n data !== expected\n );\n}\n","/**\n * Negated string matching, ignoring case.\n *\n * @since 4.4.0\n * @category String\n * @param {string} data The value to be compared.\n * @param {string} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is not equal to `expected value`.\n * @example\n * ```javascript\n * stringNotEqualsIgnoreCase('hi', 'no')\n * // => true\n * \n * stringNotEqualsIgnoreCase('hi', 'Hi')\n * // => false\n * ```\n */\nexport function stringNotEqualsIgnoreCase(data: string, expected: string): boolean {\n return (\n data.toLowerCase() !== expected.toLowerCase()\n );\n}\n","import {bool} from './boolean/bool';\nimport {dateEquals} from './date/dateEquals';\nimport {dateLessThan} from './date/dateLessThan';\nimport {dateLessThanEquals} from './date/dateLessThanEquals';\nimport {dateNotEquals} from './date/dateNotEquals';\nimport {numericEquals} from './numeric/numericEquals';\nimport {numericGreaterThan} from './numeric/numericGreaterThan';\nimport {numericGreaterThanEquals} from './numeric/numericGreaterThanEquals';\nimport {numericLessThan} from './numeric/numericLessThan';\nimport {numericLessThanEquals} from './numeric/numericLessThanEquals';\nimport {numericNotEquals} from './numeric/numericNotEquals';\nimport {stringEquals} from './string/stringEquals';\nimport {stringEqualsIgnoreCase} from './string/stringEqualsIgnoreCase';\nimport {stringLike} from './string/stringLike';\nimport {stringNotEquals} from './string/stringNotEquals';\nimport {stringNotEqualsIgnoreCase} from './string/stringNotEqualsIgnoreCase';\n\nexport const operators: Record={\n bool,\n dateEquals,\n dateLessThan,\n dateLessThanEquals,\n dateNotEquals,\n numericEquals,\n numericGreaterThan,\n numericGreaterThanEquals,\n numericLessThan,\n numericLessThanEquals,\n numericNotEquals,\n stringEquals,\n stringEqualsIgnoreCase,\n stringLike,\n stringNotEquals,\n stringNotEqualsIgnoreCase\n};\n","import {\n EffectBlock,\n ConditionBlock,\n StatementInterface,\n MatchConditionInterface,\n MatchConditionResolverInterface\n} from './types';\nimport { getValueFromPath } from './utils/getValueFromPath';\nimport { generateUUID } from './utils/generateUUID';\nimport {operators} from './conditionOperators';\n\nabstract class Statement {\n protected sid: string;\n protected readonly condition?: ConditionBlock;\n effect: EffectBlock;\n\n constructor({ sid, effect = 'allow', condition }: StatementInterface) {\n if (!sid) {\n this.sid = generateUUID();\n } else {\n this.sid = sid;\n }\n this.effect = effect;\n this.condition = condition;\n }\n\n matchConditions(\n this: Statement,\n { context, conditionResolver }: MatchConditionInterface\n ): boolean {\n const { condition: conditions } = this;\n\n if(conditions && context){\n return Object.keys(conditions).every((condition) =>\n Object.keys(conditions[condition]).every((path) => {\n const conditionValues = conditions[condition][path];\n if (conditionValues instanceof Array) {\n return conditionValues.some((value) =>\n this.evaluateCondition({\n context,\n conditionResolver,\n condition,\n path,\n value\n })\n );\n }\n\n return this.evaluateCondition({\n context,\n conditionResolver,\n condition,\n path,\n value: conditionValues\n });\n })\n )\n }\n\n return true;\n }\n\n private evaluateCondition(\n this: Statement,\n { context, conditionResolver={}, path, value, condition }: MatchConditionResolverInterface\n ): boolean {\n\n const currentResolver= conditionResolver[condition] || operators[condition]\n\n if(currentResolver){\n return currentResolver(\n getValueFromPath(context, path),\n value\n )\n }\n return false;\n }\n}\n\nexport { Statement };\n","import { ActionBasedType, MatchActionBasedInterface } from './types';\nimport { Matcher } from './Matcher';\nimport { Statement } from './Statement';\nimport { applyContext } from './utils/applyContext';\n\nclass ActionBased extends Statement {\n private action?: string[];\n private notAction?: string[];\n private statement: ActionBasedType;\n\n constructor(action: ActionBasedType) {\n super(action);\n this.checkAndAssignActions(action);\n this.statement = { ...action, sid: this.sid };\n }\n\n getStatement(this: ActionBased): ActionBasedType {\n return this.statement;\n }\n\n matches(\n this: ActionBased,\n { action, context, conditionResolver }: MatchActionBasedInterface\n ): boolean {\n return (\n this.matchActions(action, context) &&\n this.matchNotActions(action, context) &&\n this.matchConditions({ context, conditionResolver })\n );\n }\n\n private checkAndAssignActions(action: ActionBasedType): void {\n const hasAction = 'action' in action;\n const hasNotAction = 'notAction' in action;\n if (hasAction && hasNotAction) {\n throw new TypeError(\n 'ActionBased statement should have an action or a notAction attribute, no both'\n );\n }\n if ('action' in action) {\n this.action =\n typeof action.action === 'string' ? [action.action] : action.action;\n } else {\n this.notAction =\n typeof action.notAction === 'string'\n ? [action.notAction]\n : action.notAction;\n }\n }\n\n private matchActions(action: string, context?: T): boolean {\n return this.action\n ? this.action.some((a) =>\n new Matcher(applyContext(a, context)).match(action)\n )\n : true;\n }\n\n private matchNotActions(action: string, context?: T): boolean {\n return this.notAction\n ? !this.notAction.some((a) =>\n new Matcher(applyContext(a, context)).match(action)\n )\n : true;\n }\n}\n\nexport { ActionBased };\n","import { IdentityBasedType, MatchIdentityBasedInterface } from './types';\nimport { Matcher } from './Matcher';\nimport { Statement } from './Statement';\nimport { applyContext } from './utils/applyContext';\n\nclass IdentityBased extends Statement {\n private resource?: string[];\n private action?: string[];\n private notResource?: string[];\n private notAction?: string[];\n private statement: IdentityBasedType;\n\n constructor(identity: IdentityBasedType) {\n super(identity);\n this.checkAndAssignActions(identity);\n this.checkAndAssignResources(identity);\n this.statement = { ...identity, sid: this.sid };\n }\n\n getStatement(this: IdentityBased): IdentityBasedType {\n return this.statement;\n }\n\n matches(\n this: IdentityBased,\n {\n action,\n resource,\n context,\n conditionResolver\n }: MatchIdentityBasedInterface\n ): boolean {\n return (\n this.matchActions(action, context) &&\n this.matchNotActions(action, context) &&\n this.matchResources(resource, context) &&\n this.matchNotResources(resource, context) &&\n this.matchConditions({ context, conditionResolver })\n );\n }\n\n private checkAndAssignActions(identity: IdentityBasedType): void {\n const hasAction = 'action' in identity;\n const hasNotAction = 'notAction' in identity;\n if (hasAction && hasNotAction) {\n throw new TypeError(\n 'IdentityBased statement should have an action or a notAction attribute, no both'\n );\n }\n if ('action' in identity) {\n this.action =\n typeof identity.action === 'string'\n ? [identity.action]\n : identity.action;\n } else {\n this.notAction =\n typeof identity.notAction === 'string'\n ? [identity.notAction]\n : identity.notAction;\n }\n }\n\n private checkAndAssignResources(identity: IdentityBasedType): void {\n const hasResource = 'resource' in identity;\n const hasNotResource = 'notResource' in identity;\n if (hasResource && hasNotResource) {\n throw new TypeError(\n 'IdentityBased statement should have a resource or a notResource attribute, no both'\n );\n }\n if ('resource' in identity) {\n this.resource =\n typeof identity.resource === 'string'\n ? [identity.resource]\n : identity.resource;\n } else {\n this.notResource =\n typeof identity.notResource === 'string'\n ? [identity.notResource]\n : identity.notResource;\n }\n }\n\n private matchActions(action: string, context?: T): boolean {\n return this.action\n ? this.action.some((a) =>\n new Matcher(applyContext(a, context)).match(action)\n )\n : true;\n }\n\n private matchNotActions(action: string, context?: T): boolean {\n return this.notAction\n ? !this.notAction.some((a) =>\n new Matcher(applyContext(a, context)).match(action)\n )\n : true;\n }\n\n private matchResources(resource: string, context?: T): boolean {\n return this.resource\n ? this.resource.some((a) =>\n new Matcher(applyContext(a, context)).match(resource)\n )\n : true;\n }\n\n private matchNotResources(resource: string, context?: T): boolean {\n return this.notResource\n ? !this.notResource.some((a) =>\n new Matcher(applyContext(a, context)).match(resource)\n )\n : true;\n }\n}\n\nexport { IdentityBased };\n","import {\n PrincipalMap,\n MatchResourceBasedInterface,\n ResourceBasedType\n} from './types';\nimport { Matcher } from './Matcher';\nimport { Statement } from './Statement';\nimport { applyContext } from './utils/applyContext';\n\nclass ResourceBased extends Statement {\n private principal?: PrincipalMap | string[];\n private resource?: string[];\n private action?: string[];\n private notPrincipal?: PrincipalMap | string[];\n private notResource?: string[];\n private notAction?: string[];\n private statement: ResourceBasedType;\n private hasPrincipals: boolean;\n private hasResources: boolean;\n\n constructor(identity: ResourceBasedType) {\n super(identity);\n this.hasPrincipals = false;\n this.hasResources = false;\n this.checkAndAssignActions(identity);\n this.checkAndAssignPrincipals(identity);\n this.checkAndAssignResources(identity);\n this.statement = { ...identity, sid: this.sid };\n }\n\n getStatement(this: ResourceBased): ResourceBasedType {\n return this.statement;\n }\n\n matches(\n this: ResourceBased,\n {\n principal,\n action,\n resource,\n principalType,\n context,\n conditionResolver\n }: MatchResourceBasedInterface\n ): boolean {\n return (\n this.matchPrincipalAndNotPrincipal(principal, principalType, context) &&\n this.matchActions(action, context) &&\n this.matchNotActions(action, context) &&\n this.matchResourceAndNotResource(resource, context) &&\n this.matchConditions({ context, conditionResolver })\n );\n }\n\n /*valueComing principal noPrincipal\n true false false false\n true true false true or false\n true false true true or false\n false false false true\n false true false false\n false false true false*/\n private matchPrincipalAndNotPrincipal(\n principal?: string,\n principalType?: string,\n context?: T\n ): boolean {\n if (principal) {\n if (this.hasPrincipals)\n return (\n this.matchPrincipals(principal, principalType, context) &&\n this.matchNotPrincipals(principal, principalType, context)\n );\n return false;\n }\n if (this.hasPrincipals) return false;\n return true;\n }\n\n /*valueComing resource noResource\n true false false false\n true true false true or false\n true false true true or false\n false false false true\n false true false false\n false false true false*/\n private matchResourceAndNotResource(resource?: string, context?: T): boolean {\n if (resource) {\n if (this.hasResources)\n return (\n this.matchResources(resource, context) &&\n this.matchNotResources(resource, context)\n );\n return false;\n }\n if (this.hasResources) return false;\n return true;\n }\n\n private checkAndAssignActions(identity: ResourceBasedType): void {\n const hasAction = 'action' in identity;\n const hasNotAction = 'notAction' in identity;\n if (hasAction && hasNotAction) {\n throw new TypeError(\n 'ResourceBased statement should have an action or a notAction attribute, no both'\n );\n }\n if ('action' in identity) {\n this.action =\n typeof identity.action === 'string'\n ? [identity.action]\n : identity.action;\n } else {\n this.notAction =\n typeof identity.notAction === 'string'\n ? [identity.notAction]\n : identity.notAction;\n }\n }\n\n private checkAndAssignPrincipals(identity: ResourceBasedType): void {\n const hasPrincipal = 'principal' in identity;\n const hasNotPrincipal = 'notPrincipal' in identity;\n if (hasPrincipal && hasNotPrincipal) {\n throw new TypeError(\n 'ResourceBased statement could have a principal or a notPrincipal attribute, no both'\n );\n }\n if ('principal' in identity) {\n this.principal =\n typeof identity.principal === 'string'\n ? [identity.principal]\n : identity.principal;\n this.hasPrincipals = true;\n } else if ('notPrincipal' in identity) {\n this.notPrincipal =\n typeof identity.notPrincipal === 'string'\n ? [identity.notPrincipal]\n : identity.notPrincipal;\n this.hasPrincipals = true;\n }\n }\n\n private checkAndAssignResources(identity: ResourceBasedType): void {\n const hasResource = 'resource' in identity;\n const hasNotResource = 'notResource' in identity;\n if (hasResource && hasNotResource) {\n throw new TypeError(\n 'ResourceBased statement could have a resource or a notResource attribute, no both'\n );\n }\n if ('resource' in identity) {\n this.resource =\n typeof identity.resource === 'string'\n ? [identity.resource]\n : identity.resource;\n this.hasResources = true;\n } else if ('notResource' in identity) {\n this.notResource =\n typeof identity.notResource === 'string'\n ? [identity.notResource]\n : identity.notResource;\n this.hasResources = true;\n }\n }\n\n private matchPrincipals(\n principal: string,\n principalType?: string,\n context?: T\n ): boolean {\n if (this.principal) {\n if (this.principal instanceof Array) {\n return principalType\n ? false\n : this.principal.some((a) =>\n new Matcher(applyContext(a, context)).match(principal)\n );\n } else {\n if (principalType) {\n const principalValues = this.principal[principalType];\n if (principalValues instanceof Array) {\n return principalValues.some((a) =>\n new Matcher(applyContext(a, context)).match(principal)\n );\n } else if (principalValues) {\n return new Matcher(applyContext(principalValues, context)).match(\n principal\n );\n }\n return false;\n }\n return false;\n }\n }\n return true;\n }\n\n private matchNotPrincipals(\n principal: string,\n principalType?: string,\n context?: T\n ): boolean {\n if (this.notPrincipal) {\n if (this.notPrincipal instanceof Array) {\n return principalType\n ? true\n : !this.notPrincipal.some((a) =>\n new Matcher(applyContext(a, context)).match(principal)\n );\n } else {\n if (principalType) {\n const principalValues = this.notPrincipal[principalType];\n if (principalValues instanceof Array) {\n return !principalValues.some((a) =>\n new Matcher(applyContext(a, context)).match(principal)\n );\n } else if (principalValues) {\n return !new Matcher(applyContext(principalValues, context)).match(\n principal\n );\n }\n return true;\n }\n return true;\n }\n }\n return true;\n }\n\n private matchActions(action: string, context?: T): boolean {\n return this.action\n ? this.action.some((a) =>\n new Matcher(applyContext(a, context)).match(action)\n )\n : true;\n }\n\n private matchNotActions(action: string, context?: T): boolean {\n return this.notAction\n ? !this.notAction.some((a) =>\n new Matcher(applyContext(a, context)).match(action)\n )\n : true;\n }\n\n private matchResources(resource: string, context?: T): boolean {\n return this.resource\n ? this.resource.some((a) =>\n new Matcher(applyContext(a, context)).match(resource)\n )\n : true;\n }\n\n private matchNotResources(resource: string, context?: T): boolean {\n return this.notResource\n ? !this.notResource.some((a) =>\n new Matcher(applyContext(a, context)).match(resource)\n )\n : true;\n }\n}\n\nexport { ResourceBased };\n","import { MatchConditionInterface, ConditionResolver } from './types';\n\nabstract class Policy {\n protected context?: T;\n protected conditionResolver?: ConditionResolver;\n\n constructor({ context, conditionResolver }: MatchConditionInterface) {\n this.context = context;\n this.conditionResolver = conditionResolver;\n }\n\n setContext(this: Policy, context: T): void {\n this.context = context;\n }\n\n getContext(this: Policy): T | undefined {\n return this.context;\n }\n\n setConditionResolver(\n this: Policy,\n conditionResolver: ConditionResolver\n ): void {\n this.conditionResolver = conditionResolver;\n }\n\n getConditionResolver(this: Policy): ConditionResolver | undefined {\n return this.conditionResolver;\n }\n\n abstract getStatements(this: Policy): U[];\n}\n\nexport { Policy };\n","import {\n ActionBasedType,\n ConditionResolver,\n EvaluateActionBasedInterface,\n ProxyOptions\n} from './types';\nimport { ActionBased } from './ActionBasedStatement';\nimport { Policy } from './Policy';\n\nexport interface ActionBasedPolicyInterface {\n statements: ActionBasedType[];\n conditionResolver?: ConditionResolver;\n context?: T;\n}\n\nexport class ActionBasedPolicy extends Policy<\n T,\n ActionBasedType\n> {\n private denyStatements: ActionBased[];\n private allowStatements: ActionBased[];\n private statements: ActionBasedType[];\n\n constructor({\n statements,\n conditionResolver,\n context\n }: ActionBasedPolicyInterface) {\n super({ context, conditionResolver });\n const statementInstances = statements.map(\n (statement) => new ActionBased(statement)\n );\n this.allowStatements = statementInstances.filter(\n (s) => s.effect === 'allow'\n );\n this.denyStatements = statementInstances.filter((s) => s.effect === 'deny');\n this.statements = statementInstances.map((statement) =>\n statement.getStatement()\n );\n }\n\n addStatement(this: ActionBasedPolicy, statement: ActionBasedType): void {\n const statementInstance = new ActionBased(statement);\n if (statementInstance.effect === 'allow') {\n this.allowStatements.push(statementInstance);\n } else {\n this.denyStatements.push(statementInstance);\n }\n this.statements.push(statementInstance.getStatement());\n }\n\n getStatements(this: ActionBasedPolicy): ActionBasedType[] {\n return this.statements;\n }\n\n evaluate(\n this: ActionBasedPolicy,\n { action, context }: EvaluateActionBasedInterface\n ): boolean {\n const args = { action, context };\n return !this.cannot(args) && this.can(args);\n }\n\n can(\n this: ActionBasedPolicy,\n { action, context }: EvaluateActionBasedInterface\n ): boolean {\n return this.allowStatements.some((s) =>\n s.matches({\n action,\n context: context || this.context,\n conditionResolver: this.conditionResolver\n })\n );\n }\n\n cannot(\n this: ActionBasedPolicy,\n { action, context }: EvaluateActionBasedInterface\n ): boolean {\n return this.denyStatements.some((s) =>\n s.matches({\n action,\n context: context || this.context,\n conditionResolver: this.conditionResolver\n })\n );\n }\n\n generateProxy(\n this: ActionBasedPolicy,\n obj: U,\n options: ProxyOptions = {}\n ): U {\n const { get = {}, set = {} } = options;\n const { allow: allowGet = true, propertyMap: propertyMapGet = {} } = get;\n const { allow: allowSet = true, propertyMap: propertyMapSet = {} } = set;\n const handler = {\n ...(allowGet\n ? {\n get: (target: U, prop: W): any => {\n if (prop in target) {\n if (typeof prop === 'string') {\n const property = propertyMapGet[prop] || prop;\n if (this.evaluate({ action: property })) return target[prop];\n throw new Error(`Unauthorize to get ${prop} property`);\n }\n }\n return target[prop];\n }\n }\n : {}),\n ...(allowSet\n ? {\n set: (target: U, prop: W, value: any): boolean => {\n if (typeof prop === 'string') {\n const property = propertyMapSet[prop] || prop;\n if (this.evaluate({ action: property })) {\n target[prop] = value;\n return true;\n } else throw new Error(`Unauthorize to set ${prop} property`);\n }\n return true;\n }\n }\n : {})\n };\n\n return new Proxy(obj, handler);\n }\n}\n","import {\n ConditionResolver,\n EvaluateIdentityBasedInterface,\n IdentityBasedType\n} from './types';\nimport { IdentityBased } from './IdentityBasedStatement';\nimport { Policy } from './Policy';\n\ninterface IdentityBasedPolicyInterface {\n statements: IdentityBasedType[];\n conditionResolver?: ConditionResolver;\n context?: T;\n}\n\nexport class IdentityBasedPolicy extends Policy<\n T,\n IdentityBasedType\n> {\n private denyStatements: IdentityBased[];\n private allowStatements: IdentityBased[];\n private statements: IdentityBasedType[];\n\n constructor({\n statements,\n conditionResolver,\n context\n }: IdentityBasedPolicyInterface) {\n super({ context, conditionResolver });\n const statementInstances = statements.map(\n (statement) => new IdentityBased(statement)\n );\n this.allowStatements = statementInstances.filter(\n (s) => s.effect === 'allow'\n );\n this.denyStatements = statementInstances.filter((s) => s.effect === 'deny');\n this.statements = statementInstances.map((statement) =>\n statement.getStatement()\n );\n }\n\n addStatement(\n this: IdentityBasedPolicy,\n statement: IdentityBasedType\n ): void {\n const statementInstance = new IdentityBased(statement);\n if (statementInstance.effect === 'allow') {\n this.allowStatements.push(statementInstance);\n } else {\n this.denyStatements.push(statementInstance);\n }\n this.statements.push(statementInstance.getStatement());\n }\n\n getStatements(this: IdentityBasedPolicy): IdentityBasedType[] {\n return this.statements;\n }\n\n evaluate(\n this: IdentityBasedPolicy,\n { action, resource, context }: EvaluateIdentityBasedInterface\n ): boolean {\n const args = { action, resource, context };\n return !this.cannot(args) && this.can(args);\n }\n\n can(\n this: IdentityBasedPolicy,\n { action, resource, context }: EvaluateIdentityBasedInterface\n ): boolean {\n return this.allowStatements.some((s) =>\n s.matches({\n action,\n resource,\n context: context || this.context,\n conditionResolver: this.conditionResolver\n })\n );\n }\n\n cannot(\n this: IdentityBasedPolicy,\n { action, resource, context }: EvaluateIdentityBasedInterface\n ): boolean {\n return this.denyStatements.some((s) =>\n s.matches({\n action,\n resource,\n context: context || this.context,\n conditionResolver: this.conditionResolver\n })\n );\n }\n}\n","import {\n ConditionResolver,\n EvaluateResourceBasedInterface,\n ResourceBasedType\n} from './types';\nimport { ResourceBased } from './ResourceBasedStatement';\nimport { Policy } from './Policy';\n\ninterface ResourceBasedPolicyInterface {\n statements: ResourceBasedType[];\n conditionResolver?: ConditionResolver;\n context?: T;\n}\n\nexport class ResourceBasedPolicy extends Policy<\n T,\n ResourceBasedType\n> {\n private denyStatements: ResourceBased[];\n private allowStatements: ResourceBased[];\n private statements: ResourceBasedType[];\n\n constructor({\n statements,\n conditionResolver,\n context\n }: ResourceBasedPolicyInterface) {\n super({ context, conditionResolver });\n const statementInstances = statements.map(\n (statement) => new ResourceBased(statement)\n );\n this.allowStatements = statementInstances.filter(\n (s) => s.effect === 'allow'\n );\n this.denyStatements = statementInstances.filter((s) => s.effect === 'deny');\n this.statements = statementInstances.map((statement) =>\n statement.getStatement()\n );\n }\n\n addStatement(\n this: ResourceBasedPolicy,\n statement: ResourceBasedType\n ): void {\n const statementInstance = new ResourceBased(statement);\n if (statementInstance.effect === 'allow') {\n this.allowStatements.push(statementInstance);\n } else {\n this.denyStatements.push(statementInstance);\n }\n this.statements.push(statementInstance.getStatement());\n }\n\n getStatements(this: ResourceBasedPolicy): ResourceBasedType[] {\n return this.statements;\n }\n\n evaluate(\n this: ResourceBasedPolicy,\n {\n principal,\n action,\n resource,\n principalType,\n context\n }: EvaluateResourceBasedInterface\n ): boolean {\n const args = { principal, action, resource, principalType, context };\n return !this.cannot(args) && this.can(args);\n }\n\n can(\n this: ResourceBasedPolicy,\n {\n principal,\n action,\n resource,\n principalType,\n context\n }: EvaluateResourceBasedInterface\n ): boolean {\n return this.allowStatements.some((s) =>\n s.matches({\n principal,\n action,\n resource,\n principalType,\n context: context || this.context,\n conditionResolver: this.conditionResolver\n })\n );\n }\n\n cannot(\n this: ResourceBasedPolicy,\n {\n principal,\n action,\n resource,\n principalType,\n context\n }: EvaluateResourceBasedInterface\n ): boolean {\n return this.denyStatements.some((s) =>\n s.matches({\n principal,\n action,\n resource,\n principalType,\n context: context || this.context,\n conditionResolver: this.conditionResolver\n })\n );\n }\n}\n"],"names":[],"mappings":";;;;AAAA;;;;;;;;;;;;;;;;SAgBgB,MAAM,CAAC,KAAc;IACnC,OAAO,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC/C;;AChBA;;;;;;;;;;;;;;;;SAgBgB,QAAQ,CAAC,KAAe;IACtC,MAAM,IAAI,GAAG,OAAO,KAAK,CAAC;IAC1B,QACE,IAAI,KAAK,QAAQ;SAChB,IAAI,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,iBAAiB,CAAC,EAC5E;AACJ;;ACtBA;AACA,MAAM,QAAQ,GAAG,CAAC,GAAG,CAAC,CAAC;AAEvB;;;;;;;;;;;;;;;SAegB,KAAK,CAAC,KAAc;IAClC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,QAAQ,CAAC,KAAK,CAAC,EAAE;QAChD,OAAO,KAAK,CAAC;KACd;IAED,OAAO,KAAK,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,KAAK,CAAC,QAAQ,GAAG,IAAI,GAAG,GAAG,KAAK,EAAE,CAAC;AACpE;;ACxBA;AACA,MAAM,YAAY,GAAG,kDAAkD,CAAC;AACxE,MAAM,aAAa,GAAG,OAAO,CAAC;AAE9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SA+BgB,KAAK,CAAmB,KAAc,EAAE,MAAU;IAChE,MAAM,IAAI,GAAG,OAAO,KAAK,CAAC;IAC1B,IACE,IAAI,KAAK,QAAQ;QACjB,IAAI,KAAK,SAAS;QAClB,KAAK,KAAK,IAAI;QACd,KAAK,KAAK,SAAS;QACnB,QAAQ,CAAC,KAAK,CAAC,EACf;QACA,OAAO,IAAI,CAAC;KACb;IACD,IAAI,OAAO,KAAK,KAAK,QA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CAAC,CAAC,CAAC,KAChC,CAAC,CAAC,OAAO,CAAC;YACR,SAAS;YACT,MAAM;YACN,QAAQ;YACR,aAAa;YACb,OAAO,EAAE,OAAO,IAAI,IAAI,CAAC,OAAO;YAChC,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;SAC1C,CAAC,CACH,CAAC;KACH;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"main.js","sources":["../src/utils/getTag.ts","../src/utils/isSymbol.ts","../src/utils/toKey.ts","../src/utils/isKey.ts","../src/utils/memoize.ts","../src/utils/memoizeCapped.ts","../src/utils/stringToPath.ts","../src/utils/getValueFromPath.ts","../src/utils/applyContext.ts","../src/utils/decomposeString.ts","../src/utils/braceExpand.ts","../src/Matcher.ts","../src/utils/mersenneTwister.ts","../src/utils/generateUUID.ts","../src/conditionOperators/boolean/bool.ts","../src/conditionOperators/date/convertDate.ts","../src/conditionOperators/date/dateEquals.ts","../src/conditionOperators/date/dateGreaterThan.ts","../src/conditionOperators/date/dateGreaterThanEquals.ts","../src/conditionOperators/date/dateLessThan.ts","../src/conditionOperators/date/dateLessThanEquals.ts","../src/conditionOperators/date/dateNotEquals.ts","../src/conditionOperators/numeric/numericEquals.ts","../src/conditionOperators/numeric/numericGreaterThan.ts","../src/conditionOperators/numeric/numericGreaterThanEquals.ts","../src/conditionOperators/numeric/numericLessThan.ts","../src/conditionOperators/numeric/numericLessThanEquals.ts","../src/conditionOperators/numeric/numericNotEquals.ts","../src/conditionOperators/string/stringEquals.ts","../src/conditionOperators/string/stringEqualsIgnoreCase.ts","../src/conditionOperators/string/stringLike.ts","../src/conditionOperators/string/stringNotEquals.ts","../src/conditionOperators/string/stringNotEqualsIgnoreCase.ts","../src/conditionOperators/index.ts","../src/Statement.ts","../src/ActionBasedStatement.ts","../src/IdentityBasedStatement.ts","../src/ResourceBasedStatement.ts","../src/Policy.ts","../src/ActionBasedPolicy.ts","../src/IdentityBasedPolicy.ts","../src/ResourceBasedPolicy.ts"],"sourcesContent":["/**\n * Gets the `toStringTag` of `value`.\n *\n * @since 3.1.0\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n * @example\n * ```javascript\n * getTag(1)\n * // => '[object Number]'\n *\n * getTag(null)\n * // => '[object Null]'\n * ```\n */\nexport function getTag(value: unknown): string {\n return Object.prototype.toString.call(value);\n}\n","import { getTag } from './getTag';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @since 3.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n * ```javascript\n * isSymbol(Symbol())\n * // => true\n *\n * isSymbol('abc')\n * // => false\n * ```\n */\nexport function isSymbol(value?: unknown): value is symbol {\n const type = typeof value;\n return (\n type === 'symbol' ||\n (type === 'object' && value !== null && getTag(value) === '[object Symbol]')\n );\n}\n","import { isSymbol } from './isSymbol';\n\n/** Used as references for various `Number` constants. */\nconst INFINITY = 1 / 0;\n\n/**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @since 3.1.0\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n * @example\n *\n * toKey(Symbol.iterator)\n * // => true\n *\n * toKey('abc')\n * // => false\n */\nexport function toKey(value: unknown): string | symbol {\n if (typeof value === 'string' || isSymbol(value)) {\n return value;\n }\n\n return value === 0 && 1 / value === -INFINITY ? '-0' : `${value}`;\n}\n","import { isSymbol } from './isSymbol';\n\n/** Used to match property names within property paths. */\nconst reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/;\nconst reIsPlainProp = /^\\w*$/; //matches any word character (alphanumeric and underscore)\n\n/**\n * Checks if `value` is a property name and not a property path.\n *\n * @since 3.1.0\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n * @example\n * ```javascript\n * isKey(1)\n * // => true\n *\n * isKey('example[test]')\n * // => false\n *\n * isKey('a.b')\n * // => false\n *\n * const obj = {\n * '[a]': 5,\n * 'b.c': true\n * };\n *\n * isKey('[a]', obj)\n * // => true\n *\n * isKey('b.c', obj)\n * // => true\n * ```\n */\nexport function isKey(value: unknown, object?: T): boolean {\n const type = typeof value;\n if (\n type === 'number' ||\n type === 'boolean' ||\n value === null ||\n value === undefined ||\n isSymbol(value)\n ) {\n return true;\n }\n if (typeof value === 'string') {\n return (\n reIsPlainProp.test(value) ||\n !reIsDeepProp.test(value) ||\n (object !== null && value in Object(object))\n );\n }\n return false;\n}\n","import { MemoizeInterface } from '../types';\n\n/**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * @since 3.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n * ```javascript\n * const object = { 'a': 1, 'b': 2 }\n * const other = { 'c': 3, 'd': 4 }\n *\n * const values = memoize(values)\n * values(object)\n * // => [1, 2]\n *\n * values(other)\n * // => [3, 4]\n *\n * object.a = 2\n * values(object)\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b'])\n * values(object)\n * // => ['a', 'b']\n * ```\n */\nexport function memoize(\n func: (...args: unknown[]) => any,\n resolver?: (...args: unknown[]) => any\n): MemoizeInterface {\n const memoized = function (\n this: (...args: unknown[]) => any,\n ...args: unknown[]\n ): MemoizeInterface {\n const key = resolver ? resolver.apply(this, args) : args[0];\n const cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n const result = func.apply(this, args);\n cache.set(key, result);\n return result;\n };\n memoized.cache = new Map();\n return memoized;\n}\n\n/*const memoize = (fn: Function): Function => {\n const cache = {};\n return (...args): any => {\n const stringifiedArgs = JSON.stringify(args);\n const result = (cache[stringifiedArgs] =\n typeof cache[stringifiedArgs] === 'undefined'\n ? fn(...args)\n : cache[stringifiedArgs]);\n return result;\n };\n};*/\n","import { memoize } from './memoize';\nimport { MemoizeInterface } from '../types';\n\n/** Used as the maximum memoize cache size. */\nexport const MAX_MEMOIZE_SIZE = 500;\n\n/**\n * A specialized version of `memoize` which clears the memoized function's\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n *\n * @since 3.1.0\n * @private\n * @param {Function} func The function to have its output memoized.\n * @returns {Function} Returns the new memoized function.\n */\nexport function memoizeCapped(\n func: (...args: any) => unknown\n): MemoizeInterface {\n const result = memoize(func, (key: unknown) => {\n const { cache } = result;\n if (cache.size === MAX_MEMOIZE_SIZE) {\n cache.clear();\n }\n return key;\n });\n\n return result;\n}\n","import { memoizeCapped } from './memoizeCapped';\n\nconst charCodeOfDot = '.'.charCodeAt(0);\nconst reEscapeChar = /\\\\(\\\\)?/g;\nconst rePropName = RegExp(\n // Match anything that isn't a dot or bracket.\n '[^.[\\\\]]+' +\n '|' +\n // Or match property names within brackets.\n '\\\\[(?:' +\n // Match a non-string expression.\n '([^\"\\'][^[]*)' +\n '|' +\n // Or match strings (supports escaping characters).\n '([\"\\'])((?:(?!\\\\x02)[^\\\\\\\\]|\\\\\\\\.)*?)\\\\x02' +\n ')\\\\]' +\n '|' +\n // Or match \"\" as the space between consecutive dots or empty brackets.\n '(?=(?:\\\\.|\\\\[\\\\])(?:\\\\.|\\\\[\\\\]|$))',\n 'g'\n);\n\n/**\n * Converts `string` to a property path array.\n *\n * @since 3.1.0\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\nexport const stringToPath = memoizeCapped((string: string) => {\n const result = [];\n if (string.charCodeAt(0) === charCodeOfDot) {\n result.push('');\n }\n string.replace(\n rePropName,\n (\n match: string,\n expression: string,\n quote: string,\n subString: string\n ): string => {\n let key = match;\n if (quote) {\n key = subString.replace(reEscapeChar, '$1');\n } else if (expression) {\n key = expression.trim();\n }\n result.push(key);\n return '';\n }\n );\n return result;\n});\n","import { toKey } from './toKey';\nimport { isKey } from './isKey';\nimport { stringToPath } from './stringToPath';\n\n/**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {Object} [object] The object to query keys on.\n * @returns {Array} Returns the cast property path array.\n */\nexport function castPath(\n value: unknown,\n object: U\n): Array {\n if (Array.isArray(value)) {\n return value;\n }\n\n return isKey(value, object) ? [value] : stringToPath(value);\n}\n\n/**\n * The base implementation of `get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\nexport function baseGet(\n object: U,\n path: Array | string\n): any {\n const newPath = castPath(path, object);\n\n let index = 0;\n const length = newPath.length;\n\n let value: any = object;\n while (value instanceof Object && index < length) {\n value = value[toKey(newPath[index++])];\n }\n\n return index && index === length ? value : undefined;\n}\n\n/**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @since 3.1.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * const object = { 'a': [{ 'b': { 'c': 3 } }] }\n *\n * getValueFromPath(object, 'a[0].b.c')\n * // => 3\n *\n * getValueFromPath(object, ['a', '0', 'b', 'c'])\n * // => 3\n *\n * getValueFromPath(object, 'a.b.c', 'default')\n * // => 'default'\n */\nexport function getValueFromPath(\n object: U,\n path: Array | string,\n defaultValue?: unknown\n): any {\n const result = object === null ? undefined : baseGet(object, path);\n\n return result === undefined ? defaultValue : result;\n}\n","import { getValueFromPath } from './getValueFromPath';\n\nconst reDelimiters = /\\${([^}]*)}/g;\nconst trim = / +(?= )|^\\s+|\\s+$/g;\n\nconst specialTrim = (str: string): string => str.replace(trim, '');\n\n/**\n * Apply the context value in a string.\n *\n * @param {string} str Pattern string, containing context path.\n * @param {object} context Object to get values from path.\n * @returns {string} Returns a string with embedded context values.\n * @example\n * ```javascript\n * const context = {\n * user: { id: 456, bestFriends: [123, 532, 987] }\n * };\n * applyContext('secrets:${user.id}:*', context)\n * // => 'secrets:456:*'\n *\n * applyContext('secrets:${user.bestFriends}:*', context)\n * // => 'secrets:{123,532,987}:*'\n *\n * applyContext('secrets:${company.address}:account', context)\n * // => 'secrets:undefined:account'\n * ```\n */\nexport function applyContext(\n str: string,\n context?: T\n): string {\n if (!context) return str;\n\n return specialTrim(\n str.replace(reDelimiters, (_, path: string) => {\n const value = getValueFromPath(context, path);\n if (Array.isArray(value)) return `{${value}}`;\n if (value instanceof Object) return 'undefined';\n\n return String(value);\n })\n );\n}\n","import { DecomposeString } from '../types';\n\n/**\n * Get index range where separators are found.\n *\n * @private\n * @since 3.1.1\n * @param {string} initialSeparator First string to be found.\n * @param {string} finalSeparator Second string to be found.\n * @param {string} str String to be decomposed.\n * @returns {number[]} Returns the beginning and final index for those matches.\n * @example\n * ```javascript\n * getIndexRange('first', 'Second', 'firstAndSecond')\n * // => [0, 8]\n *\n * getIndexRange('First', 'Second', '++FirstAndSecond**')\n * // => [2, 10]\n * ```\n */\nfunction getIndexRange(\n initialSeparator: string,\n finalSeparator: string,\n str: string\n): number[] {\n const beginningIndex = str.indexOf(initialSeparator);\n const finalIndex = str.indexOf(finalSeparator, beginningIndex + 1);\n\n if (beginningIndex >= 0 && finalIndex > 0) {\n return [beginningIndex, finalIndex];\n }\n\n return [-1, -1];\n}\n\n/**\n * Object returned by decomposeString function\n *\n * @typedef {Object} DecomposedString\n * @property {number} start Beginning index for first separator match\n * @property {number} end Final index for second separator match\n * @property {string} pre Substring before first separator\n * @property {string} body Substring between separators\n * @property {string} post Substring after second separator\n */\n\n/**\n * Decompose string in pre, body and post strings by using separators.\n *\n * @private\n * @since 3.1.1\n * @param {string} initialSeparator First string to be found.\n * @param {string} finalSeparator Second string to be found.\n * @param {string} str String to be decomposed.\n * @returns {DecomposedString} Returns a decompose string.\n * @example\n * ```javascript\n * decomposeString('first', 'Second', 'firstAndSecond')\n * // => { start: 0, end: 8, pre: '', body: 'And', post: '' }\n *\n * decomposeString('First', 'Second', '++FirstAndSecond**')\n * // => { start: 2, end: 10, pre: '++', body: 'And', post: '**' }\n * ```\n */\nexport function decomposeString(\n initialSeparator: string,\n finalSeparator: string,\n str: string\n): DecomposeString {\n const [beginningIndex, finalIndex] = getIndexRange(\n initialSeparator,\n finalSeparator,\n str\n );\n\n return {\n start: beginningIndex,\n end: finalIndex,\n pre: beginningIndex >= 0 ? str.slice(0, beginningIndex) : '',\n body:\n beginningIndex >= 0\n ? str.slice(beginningIndex + initialSeparator.length, finalIndex)\n : '',\n post:\n beginningIndex >= 0 ? str.slice(finalIndex + finalSeparator.length) : ''\n };\n}\n","import { decomposeString } from './decomposeString';\n\n/**\n * Generate an array of string depending on {} blocks.\n *\n * @param {string} pattern Pattern string that can contains {} blocks.\n * @returns {string[]} Returns an array of string with all the combinations.\n * @example\n * ```javascript\n * braceExpand('${13}')\n * // => ['{13}']\n *\n * braceExpand('a{b,f,m}p')\n * // => ['abp','afp','amp']\n *\n * braceExpand('-v{,,}')\n * // => ['-v','-v','-v']\n * ```\n */\nconst braceExpand = (pattern: string): string[] => {\n if (!pattern.match(/{.*}/)) {\n return [pattern];\n }\n\n return expand(pattern, true);\n};\n\nconst expand = (str: string, isTop?: boolean): string[] => {\n const expansions = [] as string[];\n const balance = decomposeString('{', '}', str);\n if (balance.start < 0) return [str];\n\n const parts = balance.body.split(',');\n // no need to expand pre, since it is guaranteed to be free of brace-sets\n const pre = balance.pre;\n const postParts = balance.post.length ? expand(balance.post, false) : [''];\n\n if (/\\$$/.test(balance.pre)) {\n postParts.forEach((postPart) => {\n const expansion = `${balance.pre.slice(0, -1)}{${\n balance.body\n }}${postPart}`;\n expansions.push(expansion);\n });\n } else {\n parts.forEach((part: string) => {\n postParts.forEach((postPart) => {\n const expansion = pre + part + postPart;\n if (!isTop || expansion) expansions.push(expansion);\n });\n });\n }\n\n return expansions;\n};\n\nexport { braceExpand };\n","import { braceExpand } from './utils/braceExpand';\n\nexport class Matcher {\n private readonly pattern: string;\n private readonly maxLength: number;\n private readonly set: (string | RegExp)[];\n private readonly empty: boolean;\n\n constructor(pattern: string, maxLength = 1024 * 64) {\n this.set = [];\n this.pattern = pattern.trim();\n this.maxLength = maxLength;\n this.empty = !this.pattern ? true : false;\n\n const set = braceExpand(pattern);\n this.set = set.map((val) => this.parse(val));\n this.set = this.set.filter((s) => {\n return Boolean(s);\n });\n }\n\n match(this: Matcher, str: string): boolean {\n if (this.empty) return str === '';\n\n return this.set.some((pattern) => this.matchOne(str, pattern));\n }\n\n private parse(pattern: string): string | RegExp {\n if (pattern.length > this.maxLength) {\n throw new TypeError('Pattern is too long');\n }\n let regExp;\n let hasSpecialCharacter = false;\n if (pattern === '') return '';\n\n const re = pattern.replace(/\\*/g, () => {\n hasSpecialCharacter = true;\n return '.+?';\n });\n\n // skip the regexp for non-* patterns\n // unescape anything in it, though, so that it'll be\n // an exact match.\n if (!hasSpecialCharacter) {\n return pattern.replace(/\\\\(.)/g, '$1');\n }\n\n try {\n regExp = new RegExp('^' + re + '$');\n } catch (error) {\n // If it was an invalid regular expression, then it can't match\n // anything.\n return new RegExp('$.');\n }\n\n return regExp;\n }\n\n private matchOne(str: string, pattern: string | RegExp): boolean {\n if (typeof pattern === 'string') {\n return str === pattern;\n }\n\n return Boolean(str.match(pattern));\n }\n}\n","/*\n https://github.com/banksean wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace\n so it's better encapsulated. Now you can have multiple random number generators\n and they won't stomp all over each other's state.\n If you want to use this as a substitute for Math.random(), use the random()\n method like so:\n var m = new MersenneTwister();\n var randomNumber = m.random();\n You can also call the other genrand_{foo}() methods on the instance.\n If you want to use a specific seed in order to get a repeatable random\n sequence, pass an integer into the constructor:\n var m = new MersenneTwister(123);\n and that will always produce the same random sequence.\n Sean McCullough (banksean@gmail.com)\n*/\n\n/*\n A C-program for MT19937, with initialization improved 2002/1/26.\n Coded by Takuji Nishimura and Makoto Matsumoto.\n Before using, initialize the state by using init_seed(seed)\n or init_by_array(init_key, key_length).\n Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,\n All rights reserved.\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions\n are met:\n 1. Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n 2. Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n 3. The names of its contributors may not be used to endorse or promote\n products derived from this software without specific prior written\n permission.\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n Any feedback is very welcome.\n http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html\n email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space)\n*/\n\nexport class MersenneTwister {\n private readonly N: number;\n private readonly M: number;\n private readonly MATRIX_A: number;\n private readonly UPPER_MASK: number;\n private readonly LOWER_MASK: number;\n private readonly mt: number[];\n private mti: number;\n\n constructor(seed?: number | number[]) {\n /* Period parameters */\n this.N = 624;\n this.M = 397;\n this.MATRIX_A = 0x9908b0df; /* constant vector a */\n this.UPPER_MASK = 0x80000000; /* most significant w-r bits */\n this.LOWER_MASK = 0x7fffffff; /* least significant r bits */\n\n this.mt = new Array(this.N); /* the array for the state vector */\n this.mti = this.N + 1; /* mti==N+1 means mt[N] is not initialized */\n\n if (Array.isArray(seed)) {\n if (seed.length > 0) this.initByArray(seed, seed.length);\n } else {\n if (seed === undefined) {\n this.initSeed(new Date().getTime());\n } else {\n this.initSeed(seed);\n }\n }\n }\n\n /* initializes mt[N] with a seed */\n /* origin name init_genrand */\n initSeed(seed: number): void {\n this.mt[0] = seed >>> 0;\n for (this.mti = 1; this.mti < this.N; this.mti++) {\n const s = this.mt[this.mti - 1] ^ (this.mt[this.mti - 1] >>> 30);\n this.mt[this.mti] =\n ((((s & 0xffff0000) >>> 16) * 1812433253) << 16) +\n (s & 0x0000ffff) * 1812433253 +\n this.mti;\n /* See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier. */\n /* In the previous versions, MSBs of the seed affect */\n /* only MSBs of the array mt[]. */\n /* 2002/01/09 modified by Makoto Matsumoto */\n this.mt[this.mti] >>>= 0;\n /* for >32 bit machines */\n }\n }\n\n /* initialize by an array with array-length */\n /* init_key is the array for initializing keys */\n /* key_length is its length */\n /* slight change for C++, 2004/2/26 */\n initByArray(initKey: number[], keyLength: number): void {\n this.initSeed(19650218);\n let i = 1;\n let j = 0;\n let k = this.N > keyLength ? this.N : keyLength;\n for (; k; k--) {\n const s = this.mt[i - 1] ^ (this.mt[i - 1] >>> 30);\n this.mt[i] =\n (this.mt[i] ^\n (((((s & 0xffff0000) >>> 16) * 1664525) << 16) +\n (s & 0x0000ffff) * 1664525)) +\n initKey[j] +\n j; /* non linear */\n this.mt[i] >>>= 0; /* for WORDSIZE > 32 machines */\n i++;\n j++;\n if (i >= this.N) {\n this.mt[0] = this.mt[this.N - 1];\n i = 1;\n }\n if (j >= keyLength) j = 0;\n }\n for (k = this.N - 1; k; k--) {\n const s = this.mt[i - 1] ^ (this.mt[i - 1] >>> 30);\n this.mt[i] =\n (this.mt[i] ^\n (((((s & 0xffff0000) >>> 16) * 1566083941) << 16) +\n (s & 0x0000ffff) * 1566083941)) -\n i; /* non linear */\n this.mt[i] >>>= 0; /* for WORDSIZE > 32 machines */\n i++;\n if (i >= this.N) {\n this.mt[0] = this.mt[this.N - 1];\n i = 1;\n }\n }\n\n this.mt[0] = 0x80000000; /* MSB is 1; assuring non-zero initial array */\n }\n\n /* generates a random number on [0,0xffffffff]-interval */\n /* origin name genrand_int32 */\n randomInt32(): number {\n let y;\n const mag01 = [0x0, this.MATRIX_A];\n /* mag01[x] = x * MATRIX_A for x=0,1 */\n\n if (this.mti >= this.N) {\n /* generate N words at one time */\n let kk;\n\n if (this.mti === this.N + 1)\n /* if init_seed() has not been called, */\n this.initSeed(5489); /* a default initial seed is used */\n\n for (kk = 0; kk < this.N - this.M; kk++) {\n y =\n (this.mt[kk] & this.UPPER_MASK) | (this.mt[kk + 1] & this.LOWER_MASK);\n this.mt[kk] = this.mt[kk + this.M] ^ (y >>> 1) ^ mag01[y & 0x1];\n }\n for (; kk < this.N - 1; kk++) {\n y =\n (this.mt[kk] & this.UPPER_MASK) | (this.mt[kk + 1] & this.LOWER_MASK);\n this.mt[kk] =\n this.mt[kk + (this.M - this.N)] ^ (y >>> 1) ^ mag01[y & 0x1];\n }\n y =\n (this.mt[this.N - 1] & this.UPPER_MASK) |\n (this.mt[0] & this.LOWER_MASK);\n this.mt[this.N - 1] = this.mt[this.M - 1] ^ (y >>> 1) ^ mag01[y & 0x1];\n\n this.mti = 0;\n }\n\n y = this.mt[this.mti++];\n\n /* Tempering */\n y ^= y >>> 11;\n y ^= (y << 7) & 0x9d2c5680;\n y ^= (y << 15) & 0xefc60000;\n y ^= y >>> 18;\n\n return y >>> 0;\n }\n\n /* generates a random number on [0,0x7fffffff]-interval */\n /* origin name genrand_int31 */\n randomInt31(): number {\n return this.randomInt32() >>> 1;\n }\n\n /* generates a random number on [0,1]-real-interval */\n /* origin name genrand_real1 */\n randomReal1(): number {\n return this.randomInt32() * (1.0 / 4294967295.0);\n /* divided by 2^32-1 */\n }\n\n /* generates a random number on [0,1)-real-interval */\n /* origin name genrand_real2 */\n randomReal2(): number {\n return this.randomInt32() * (1.0 / 4294967296.0);\n /* divided by 2^32 */\n }\n\n /* generates a random number on (0,1)-real-interval */\n /* origin name genrand_real3 */\n randomReal3(): number {\n return (this.randomInt32() + 0.5) * (1.0 / 4294967296.0);\n /* divided by 2^32 */\n }\n\n /* generates a random number on [0,1) with 53-bit resolution*/\n /* origin name genrand_res53 */\n randomRes53(): number {\n const a = this.randomInt32() >>> 5;\n const b = this.randomInt32() >>> 6;\n return (a * 67108864.0 + b) * (1.0 / 9007199254740992.0);\n }\n}\n\n/* These real versions are due to Isaku Wada, 2002/01/09 added */\n","import { MersenneTwister } from './mersenneTwister';\n\nconst replacePlaceholders = (mersenne: MersenneTwister) => (\n placeholder: string\n): string => {\n const random = Math.floor(mersenne.randomReal2() * 16);\n\n const value = placeholder === 'x' ? random : (random & 0x3) | 0x8;\n return value.toString(16);\n};\n\n/**\n * Generate a uuid.\n *\n * @private\n * @since 3.5.0\n * @returns {string} Returns the generated uuid.\n * @example\n * ```javascript\n * generateUUID()\n * // => 49e71c40-9b21-4371-9699-2def33f62e66\n *\n * generateUUID()\n * // => da94f128-4247-48e3-bc73-d0cae46b5093\n * ```\n */\nexport function generateUUID(): string {\n const mersenne = new MersenneTwister();\n const RFC4122_TEMPLATE = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx';\n\n return RFC4122_TEMPLATE.replace(/[xy]/g, replacePlaceholders(mersenne));\n}\n","/**\n * Boolean matching.\n *\n * @since 4.7.0\n * @category Boolean\n * @param {number} data The value to be compared.\n * @param {number} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is equal to `expected value`.\n * @example\n * ```javascript\n * bool(true, true)\n * // => true\n *\n * bool(true, false)\n * // => false\n * ```\n */\nexport function bool(data: boolean, expected: boolean): boolean {\n return (\n data === expected\n );\n}\n","export type DateType = Date | string;\n\nexport const convertDate = (date: DateType): number=>{\n if(date instanceof Date){\n return date.getTime();\n }\n\n return Date.parse(date);\n}","import {DateType, convertDate} from './convertDate';\n\n/**\n * Exact date matching.\n *\n * @since 4.8.0\n * @category Date\n * @param {Date} data The value to be compared.\n * @param {Date} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is equal to `expected value`.\n * @example\n * ```javascript\n * dateEquals('December 15, 1994 03:24:00', 'December 15, 1994 03:24:00')\n * // => true\n *\n * dateEquals('December 15, 2000 03:24:00', 'December 10, 2001 03:24:00')\n * // => false\n * ```\n */\nexport function dateEquals(data: DateType, expected: DateType): boolean {\n const convertedData = convertDate(data);\n const convertedExpectation = convertDate(expected);\n return (\n convertedData === convertedExpectation\n );\n}\n","import { DateType, convertDate } from './convertDate';\n\n/**\n * Matching after a specific date and time\n *\n * @since 4.11.0\n * @category Date\n * @param {Date} data The value to be compared.\n * @param {Date} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is after than `expected value`.\n * @example\n * ```javascript\n * dateGreaterThan('December 17, 1994 03:24:00', 'December 16, 1994 03:24:00')\n * // => true\n *\n * dateGreaterThan('December 15, 2000 03:24:00', 'December 15, 2000 03:24:00')\n * // => false\n * ```\n */\nexport function dateGreaterThan(data: DateType, expected: DateType): boolean {\n const convertedData = convertDate(data);\n const convertedExpectation = convertDate(expected);\n return convertedData > convertedExpectation;\n}\n","import { DateType, convertDate } from './convertDate';\n\n/**\n * Matching at or after a specific date and time\n *\n * @since 4.11.0\n * @category Date\n * @param {Date} data The value to be compared.\n * @param {Date} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is after than or equals `expected value`.\n * @example\n * ```javascript\n * dateGreaterThanEquals('December 17, 1994 03:24:00', 'December 16, 1994 03:24:00')\n * // => true\n *\n * dateGreaterThanEquals('December 15, 2000 03:24:00', 'December 15, 2000 03:25:00')\n * // => false\n * ```\n */\nexport function dateGreaterThanEquals(\n data: DateType,\n expected: DateType\n): boolean {\n const convertedData = convertDate(data);\n const convertedExpectation = convertDate(expected);\n return convertedData >= convertedExpectation;\n}\n","import {DateType, convertDate} from './convertDate';\n\n/**\n * Matching before a specific date and time\n *\n * @since 4.10.0\n * @category Date\n * @param {Date} data The value to be compared.\n * @param {Date} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is before than `expected value`.\n * @example\n * ```javascript\n * dateLessThan('December 15, 1994 03:24:00', 'December 16, 1994 03:24:00')\n * // => true\n *\n * dateLessThan('December 15, 2000 03:24:00', 'December 15, 2000 03:24:00')\n * // => false\n * ```\n */\nexport function dateLessThan(data: DateType, expected: DateType): boolean {\n const convertedData = convertDate(data);\n const convertedExpectation = convertDate(expected);\n return (\n convertedData < convertedExpectation\n );\n}\n","import {DateType, convertDate} from './convertDate';\n\n/**\n * Matching at or before a specific date and time\n *\n * @since 4.10.0\n * @category Date\n * @param {Date} data The value to be compared.\n * @param {Date} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is equal or before than `expected value`.\n * @example\n * ```javascript\n * dateLessThanEquals('December 15, 1994 03:24:00', 'December 15, 1994 03:24:00')\n * // => true\n *\n * dateLessThanEquals('December 15, 2000 03:24:00', 'December 15, 2000 03:24:00')\n * // => false\n * ```\n */\nexport function dateLessThanEquals(data: DateType, expected: DateType): boolean {\n const convertedData = convertDate(data);\n const convertedExpectation = convertDate(expected);\n return (\n convertedData <= convertedExpectation\n );\n}\n","import {DateType, convertDate} from './convertDate';\n\n/**\n * Negated date matching.\n *\n * @since 4.9.0\n * @category Date\n * @param {Date} data The value to be compared.\n * @param {Date} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is not equal to `expected value`.\n * @example\n * ```javascript\n * dateNotEquals('December 15, 1994 03:24:00', 'December 16, 1995 03:24:00')\n * // => true\n *\n * dateNotEquals('December 15, 2000 03:24:00', 'December 15, 2000 03:24:00')\n * // => false\n * ```\n */\nexport function dateNotEquals(data: DateType, expected: DateType): boolean {\n const convertedData = convertDate(data);\n const convertedExpectation = convertDate(expected);\n return (\n convertedData !== convertedExpectation\n );\n}\n","/**\n * Exact numeric matching.\n *\n * @since 4.6.0\n * @category Numeric\n * @param {number} data The value to be compared.\n * @param {number} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is equal to `expected value`.\n * @example\n * ```javascript\n * numericEquals(5, 5)\n * // => true\n *\n * numericEquals(2, 4)\n * // => false\n * ```\n */\nexport function numericEquals(data: number, expected: number): boolean {\n return (\n data === expected\n );\n}\n","/**\n * Numeric greater than matching.\n *\n * @since 4.6.0\n * @category Numeric\n * @param {number} data The value to be compared.\n * @param {number} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is greater than `expected value`.\n * @example\n * ```javascript\n * numericGreaterThan(6, 5)\n * // => true\n *\n * numericGreaterThan(4, 8)\n * // => false\n * ```\n */\nexport function numericGreaterThan(data: number, expected: number): boolean {\n return (\n data > expected\n );\n}\n","/**\n * Numeric greater than or equals matching.\n *\n * @since 4.6.0\n * @category Numeric\n * @param {number} data The value to be compared.\n * @param {number} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is greater than or equals `expected value`.\n * @example\n * ```javascript\n * numericGreaterThanEquals(5, 5)\n * // => true\n *\n * numericGreaterThanEquals(4, 8)\n * // => false\n * ```\n */\nexport function numericGreaterThanEquals(data: number, expected: number): boolean {\n return (\n data >= expected\n );\n}\n","/**\n * Numeric less than matching.\n *\n * @since 4.6.0\n * @category Numeric\n * @param {number} data The value to be compared.\n * @param {number} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is less than `expected value`.\n * @example\n * ```javascript\n * numericLessThan(5, 6)\n * // => true\n *\n * numericLessThan(8, 4)\n * // => false\n * ```\n */\nexport function numericLessThan(data: number, expected: number): boolean {\n return (\n data < expected\n );\n}\n","/**\n * Numeric less than or equals matching.\n *\n * @since 4.6.0\n * @category Numeric\n * @param {number} data The value to be compared.\n * @param {number} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is less than or equals `expected value`.\n * @example\n * ```javascript\n * numericLessThanEquals(5, 5)\n * // => true\n *\n * numericLessThanEquals(8, 4)\n * // => false\n * ```\n */\nexport function numericLessThanEquals(data: number, expected: number): boolean {\n return (\n data <= expected\n );\n}\n","/**\n * Negated numeric matching.\n *\n * @since 4.6.0\n * @category Numeric\n * @param {number} data The value to be compared.\n * @param {number} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is not equal to `expected value`.\n * @example\n * ```javascript\n * numericNotEquals(2, 4)\n * // => true\n *\n * numericNotEquals(5, 5)\n * // => false\n * ```\n */\nexport function numericNotEquals(data: number, expected: number): boolean {\n return (\n data !== expected\n );\n}\n","/**\n * Exact string matching, case sensitive.\n *\n * @since 4.3.0\n * @category String\n * @param {string} data The value to be compared.\n * @param {string} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is equal to `expected value`.\n * @example\n * ```javascript\n * stringEquals('hi', 'hi')\n * // => true\n *\n * stringEquals('hi', 'no')\n * // => false\n * ```\n */\nexport function stringEquals(data: string, expected: string): boolean {\n return (\n data === expected\n );\n}\n","/**\n * Exact string matching, ignoring case.\n *\n * @since 4.4.0\n * @category String\n * @param {string} data The value to be compared.\n * @param {string} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is equal to `expected value`.\n * @example\n * ```javascript\n * stringEqualsIgnoreCase('hi', 'Hi')\n * // => true\n *\n * stringEqualsIgnoreCase('hi', 'no')\n * // => false\n * ```\n */\nexport function stringEqualsIgnoreCase(data: string, expected: string): boolean {\n return (\n data.toLowerCase() === expected.toLowerCase()\n );\n}\n","import {Matcher} from '../../Matcher';\n\n/**\n * Case-sensitive matching. The values can include a multi-character match wildcard (*) anywhere in the string.\n *\n * @since 4.5.0\n * @category String\n * @param {string} data The value to be compared.\n * @param {string} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is equal like `expected value`.\n * @example\n * ```javascript\n * stringLike('newHouse', 'new*')\n * // => true\n *\n * stringLike('House', 'new*')\n * // => false\n * ```\n */\nexport function stringLike(data: string, expected: string): boolean {\n return (\n new Matcher(data).match(expected)\n );\n}\n","/**\n * Negated string matching.\n *\n * @since 4.4.0\n * @category String\n * @param {string} data The value to be compared.\n * @param {string} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is not equal to `expected value`.\n * @example\n * ```javascript\n * stringNotEquals('hi', 'no')\n * // => true\n * \n * stringNotEquals('hi', 'hi')\n * // => false\n * ```\n */\nexport function stringNotEquals(data: string, expected: string): boolean {\n return (\n data !== expected\n );\n}\n","/**\n * Negated string matching, ignoring case.\n *\n * @since 4.4.0\n * @category String\n * @param {string} data The value to be compared.\n * @param {string} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is not equal to `expected value`.\n * @example\n * ```javascript\n * stringNotEqualsIgnoreCase('hi', 'no')\n * // => true\n * \n * stringNotEqualsIgnoreCase('hi', 'Hi')\n * // => false\n * ```\n */\nexport function stringNotEqualsIgnoreCase(data: string, expected: string): boolean {\n return (\n data.toLowerCase() !== expected.toLowerCase()\n );\n}\n","import { bool } from './boolean/bool';\nimport { dateEquals } from './date/dateEquals';\nimport { dateGreaterThan } from './date/dateGreaterThan';\nimport { dateGreaterThanEquals } from './date/dateGreaterThanEquals';\nimport { dateLessThan } from './date/dateLessThan';\nimport { dateLessThanEquals } from './date/dateLessThanEquals';\nimport { dateNotEquals } from './date/dateNotEquals';\nimport { numericEquals } from './numeric/numericEquals';\nimport { numericGreaterThan } from './numeric/numericGreaterThan';\nimport { numericGreaterThanEquals } from './numeric/numericGreaterThanEquals';\nimport { numericLessThan } from './numeric/numericLessThan';\nimport { numericLessThanEquals } from './numeric/numericLessThanEquals';\nimport { numericNotEquals } from './numeric/numericNotEquals';\nimport { stringEquals } from './string/stringEquals';\nimport { stringEqualsIgnoreCase } from './string/stringEqualsIgnoreCase';\nimport { stringLike } from './string/stringLike';\nimport { stringNotEquals } from './string/stringNotEquals';\nimport { stringNotEqualsIgnoreCase } from './string/stringNotEqualsIgnoreCase';\n\nexport const operators: Record = {\n bool,\n dateEquals,\n dateGreaterThan,\n dateGreaterThanEquals,\n dateLessThan,\n dateLessThanEquals,\n dateNotEquals,\n numericEquals,\n numericGreaterThan,\n numericGreaterThanEquals,\n numericLessThan,\n numericLessThanEquals,\n numericNotEquals,\n stringEquals,\n stringEqualsIgnoreCase,\n stringLike,\n stringNotEquals,\n stringNotEqualsIgnoreCase\n};\n","import {\n EffectBlock,\n ConditionBlock,\n StatementInterface,\n MatchConditionInterface,\n MatchConditionResolverInterface\n} from './types';\nimport { getValueFromPath } from './utils/getValueFromPath';\nimport { generateUUID } from './utils/generateUUID';\nimport {operators} from './conditionOperators';\n\nabstract class Statement {\n protected sid: string;\n protected readonly condition?: ConditionBlock;\n effect: EffectBlock;\n\n constructor({ sid, effect = 'allow', condition }: StatementInterface) {\n if (!sid) {\n this.sid = generateUUID();\n } else {\n this.sid = sid;\n }\n this.effect = effect;\n this.condition = condition;\n }\n\n matchConditions(\n this: Statement,\n { context, conditionResolver }: MatchConditionInterface\n ): boolean {\n const { condition: conditions } = this;\n\n if(conditions && context){\n return Object.keys(conditions).every((condition) =>\n Object.keys(conditions[condition]).every((path) => {\n const conditionValues = conditions[condition][path];\n if (conditionValues instanceof Array) {\n return conditionValues.some((value) =>\n this.evaluateCondition({\n context,\n conditionResolver,\n condition,\n path,\n value\n })\n );\n }\n\n return this.evaluateCondition({\n context,\n conditionResolver,\n condition,\n path,\n value: conditionValues\n });\n })\n )\n }\n\n return true;\n }\n\n private evaluateCondition(\n this: Statement,\n { context, conditionResolver={}, path, value, condition }: MatchConditionResolverInterface\n ): boolean {\n\n const currentResolver= conditionResolver[condition] || operators[condition]\n\n if(currentResolver){\n return currentResolver(\n getValueFromPath(context, path),\n value\n )\n }\n return false;\n }\n}\n\nexport { Statement };\n","import { ActionBasedType, MatchActionBasedInterface } from './types';\nimport { Matcher } from './Matcher';\nimport { Statement } from './Statement';\nimport { applyContext } from './utils/applyContext';\n\nclass ActionBased extends Statement {\n private action?: string[];\n private notAction?: string[];\n private statement: ActionBasedType;\n\n constructor(action: ActionBasedType) {\n super(action);\n this.checkAndAssignActions(action);\n this.statement = { ...action, sid: this.sid };\n }\n\n getStatement(this: ActionBased): ActionBasedType {\n return this.statement;\n }\n\n matches(\n this: ActionBased,\n { action, context, conditionResolver }: MatchActionBasedInterface\n ): boolean {\n return (\n this.matchActions(action, context) &&\n this.matchNotActions(action, context) &&\n this.matchConditions({ context, conditionResolver })\n );\n }\n\n private checkAndAssignActions(action: ActionBasedType): void {\n const hasAction = 'action' in action;\n const hasNotAction = 'notAction' in action;\n if (hasAction && hasNotAction) {\n throw new TypeError(\n 'ActionBased statement should have an action or a notAction attribute, no both'\n );\n }\n if ('action' in action) {\n this.action =\n typeof action.action === 'string' ? [action.action] : action.action;\n } else {\n this.notAction =\n typeof action.notAction === 'string'\n ? [action.notAction]\n : action.notAction;\n }\n }\n\n private matchActions(action: string, context?: T): boolean {\n return this.action\n ? this.action.some((a) =>\n new Matcher(applyContext(a, context)).match(action)\n )\n : true;\n }\n\n private matchNotActions(action: string, context?: T): boolean {\n return this.notAction\n ? !this.notAction.some((a) =>\n new Matcher(applyContext(a, context)).match(action)\n )\n : true;\n }\n}\n\nexport { ActionBased };\n","import { IdentityBasedType, MatchIdentityBasedInterface } from './types';\nimport { Matcher } from './Matcher';\nimport { Statement } from './Statement';\nimport { applyContext } from './utils/applyContext';\n\nclass IdentityBased extends Statement {\n private resource?: string[];\n private action?: string[];\n private notResource?: string[];\n private notAction?: string[];\n private statement: IdentityBasedType;\n\n constructor(identity: IdentityBasedType) {\n super(identity);\n this.checkAndAssignActions(identity);\n this.checkAndAssignResources(identity);\n this.statement = { ...identity, sid: this.sid };\n }\n\n getStatement(this: IdentityBased): IdentityBasedType {\n return this.statement;\n }\n\n matches(\n this: IdentityBased,\n {\n action,\n resource,\n context,\n conditionResolver\n }: MatchIdentityBasedInterface\n ): boolean {\n return (\n this.matchActions(action, context) &&\n this.matchNotActions(action, context) &&\n this.matchResources(resource, context) &&\n this.matchNotResources(resource, context) &&\n this.matchConditions({ context, conditionResolver })\n );\n }\n\n private checkAndAssignActions(identity: IdentityBasedType): void {\n const hasAction = 'action' in identity;\n const hasNotAction = 'notAction' in identity;\n if (hasAction && hasNotAction) {\n throw new TypeError(\n 'IdentityBased statement should have an action or a notAction attribute, no both'\n );\n }\n if ('action' in identity) {\n this.action =\n typeof identity.action === 'string'\n ? [identity.action]\n : identity.action;\n } else {\n this.notAction =\n typeof identity.notAction === 'string'\n ? [identity.notAction]\n : identity.notAction;\n }\n }\n\n private checkAndAssignResources(identity: IdentityBasedType): void {\n const hasResource = 'resource' in identity;\n const hasNotResource = 'notResource' in identity;\n if (hasResource && hasNotResource) {\n throw new TypeError(\n 'IdentityBased statement should have a resource or a notResource attribute, no both'\n );\n }\n if ('resource' in identity) {\n this.resource =\n typeof identity.resource === 'string'\n ? [identity.resource]\n : identity.resource;\n } else {\n this.notResource =\n typeof identity.notResource === 'string'\n ? [identity.notResource]\n : identity.notResource;\n }\n }\n\n private matchActions(action: string, context?: T): boolean {\n return this.action\n ? this.action.some((a) =>\n new Matcher(applyContext(a, context)).match(action)\n )\n : true;\n }\n\n private matchNotActions(action: string, context?: T): boolean {\n return this.notAction\n ? !this.notAction.some((a) =>\n new Matcher(applyContext(a, context)).match(action)\n )\n : true;\n }\n\n private matchResources(resource: string, context?: T): boolean {\n return this.resource\n ? this.resource.some((a) =>\n new Matcher(applyContext(a, context)).match(resource)\n )\n : true;\n }\n\n private matchNotResources(resource: string, context?: T): boolean {\n return this.notResource\n ? !this.notResource.some((a) =>\n new Matcher(applyContext(a, context)).match(resource)\n )\n : true;\n }\n}\n\nexport { IdentityBased };\n","import {\n PrincipalMap,\n MatchResourceBasedInterface,\n ResourceBasedType\n} from './types';\nimport { Matcher } from './Matcher';\nimport { Statement } from './Statement';\nimport { applyContext } from './utils/applyContext';\n\nclass ResourceBased extends Statement {\n private principal?: PrincipalMap | string[];\n private resource?: string[];\n private action?: string[];\n private notPrincipal?: PrincipalMap | string[];\n private notResource?: string[];\n private notAction?: string[];\n private statement: ResourceBasedType;\n private hasPrincipals: boolean;\n private hasResources: boolean;\n\n constructor(identity: ResourceBasedType) {\n super(identity);\n this.hasPrincipals = false;\n this.hasResources = false;\n this.checkAndAssignActions(identity);\n this.checkAndAssignPrincipals(identity);\n this.checkAndAssignResources(identity);\n this.statement = { ...identity, sid: this.sid };\n }\n\n getStatement(this: ResourceBased): ResourceBasedType {\n return this.statement;\n }\n\n matches(\n this: ResourceBased,\n {\n principal,\n action,\n resource,\n principalType,\n context,\n conditionResolver\n }: MatchResourceBasedInterface\n ): boolean {\n return (\n this.matchPrincipalAndNotPrincipal(principal, principalType, context) &&\n this.matchActions(action, context) &&\n this.matchNotActions(action, context) &&\n this.matchResourceAndNotResource(resource, context) &&\n this.matchConditions({ context, conditionResolver })\n );\n }\n\n /*valueComing principal noPrincipal\n true false false false\n true true false true or false\n true false true true or false\n false false false true\n false true false false\n false false true false*/\n private matchPrincipalAndNotPrincipal(\n principal?: string,\n principalType?: string,\n context?: T\n ): boolean {\n if (principal) {\n if (this.hasPrincipals)\n return (\n this.matchPrincipals(principal, principalType, context) &&\n this.matchNotPrincipals(principal, principalType, context)\n );\n return false;\n }\n if (this.hasPrincipals) return false;\n return true;\n }\n\n /*valueComing resource noResource\n true false false false\n true true false true or false\n true false true true or false\n false false false true\n false true false false\n false false true false*/\n private matchResourceAndNotResource(resource?: string, context?: T): boolean {\n if (resource) {\n if (this.hasResources)\n return (\n this.matchResources(resource, context) &&\n this.matchNotResources(resource, context)\n );\n return false;\n }\n if (this.hasResources) return false;\n return true;\n }\n\n private checkAndAssignActions(identity: ResourceBasedType): void {\n const hasAction = 'action' in identity;\n const hasNotAction = 'notAction' in identity;\n if (hasAction && hasNotAction) {\n throw new TypeError(\n 'ResourceBased statement should have an action or a notAction attribute, no both'\n );\n }\n if ('action' in identity) {\n this.action =\n typeof identity.action === 'string'\n ? [identity.action]\n : identity.action;\n } else {\n this.notAction =\n typeof identity.notAction === 'string'\n ? [identity.notAction]\n : identity.notAction;\n }\n }\n\n private checkAndAssignPrincipals(identity: ResourceBasedType): void {\n const hasPrincipal = 'principal' in identity;\n const hasNotPrincipal = 'notPrincipal' in identity;\n if (hasPrincipal && hasNotPrincipal) {\n throw new TypeError(\n 'ResourceBased statement could have a principal or a notPrincipal attribute, no both'\n );\n }\n if ('principal' in identity) {\n this.principal =\n typeof identity.principal === 'string'\n ? [identity.principal]\n : identity.principal;\n this.hasPrincipals = true;\n } else if ('notPrincipal' in identity) {\n this.notPrincipal =\n typeof identity.notPrincipal === 'string'\n ? [identity.notPrincipal]\n : identity.notPrincipal;\n this.hasPrincipals = true;\n }\n }\n\n private checkAndAssignResources(identity: ResourceBasedType): void {\n const hasResource = 'resource' in identity;\n const hasNotResource = 'notResource' in identity;\n if (hasResource && hasNotResource) {\n throw new TypeError(\n 'ResourceBased statement could have a resource or a notResource attribute, no both'\n );\n }\n if ('resource' in identity) {\n this.resource =\n typeof identity.resource === 'string'\n ? [identity.resource]\n : identity.resource;\n this.hasResources = true;\n } else if ('notResource' in identity) {\n this.notResource =\n typeof identity.notResource === 'string'\n ? [identity.notResource]\n : identity.notResource;\n this.hasResources = true;\n }\n }\n\n private matchPrincipals(\n principal: string,\n principalType?: string,\n context?: T\n ): boolean {\n if (this.principal) {\n if (this.principal instanceof Array) {\n return principalType\n ? false\n : this.principal.some((a) =>\n new Matcher(applyContext(a, context)).match(principal)\n );\n } else {\n if (principalType) {\n const principalValues = this.principal[principalType];\n if (principalValues instanceof Array) {\n return principalValues.some((a) =>\n new Matcher(applyContext(a, context)).match(principal)\n );\n } else if (principalValues) {\n return new Matcher(applyContext(principalValues, context)).match(\n principal\n );\n }\n return false;\n }\n return false;\n }\n }\n return true;\n }\n\n private matchNotPrincipals(\n principal: string,\n principalType?: string,\n context?: T\n ): boolean {\n if (this.notPrincipal) {\n if (this.notPrincipal instanceof Array) {\n return principalType\n ? true\n : !this.notPrincipal.some((a) =>\n new Matcher(applyContext(a, context)).match(principal)\n );\n } else {\n if (principalType) {\n const principalValues = this.notPrincipal[principalType];\n if (principalValues instanceof Array) {\n return !principalValues.some((a) =>\n new Matcher(applyContext(a, context)).match(principal)\n );\n } else if (principalValues) {\n return !new Matcher(applyContext(principalValues, context)).match(\n principal\n );\n }\n return true;\n }\n return true;\n }\n }\n return true;\n }\n\n private matchActions(action: string, context?: T): boolean {\n return this.action\n ? this.action.some((a) =>\n new Matcher(applyContext(a, context)).match(action)\n )\n : true;\n }\n\n private matchNotActions(action: string, context?: T): boolean {\n return this.notAction\n ? !this.notAction.some((a) =>\n new Matcher(applyContext(a, context)).match(action)\n )\n : true;\n }\n\n private matchResources(resource: string, context?: T): boolean {\n return this.resource\n ? this.resource.some((a) =>\n new Matcher(applyContext(a, context)).match(resource)\n )\n : true;\n }\n\n private matchNotResources(resource: string, context?: T): boolean {\n return this.notResource\n ? !this.notResource.some((a) =>\n new Matcher(applyContext(a, context)).match(resource)\n )\n : true;\n }\n}\n\nexport { ResourceBased };\n","import { MatchConditionInterface, ConditionResolver } from './types';\n\nabstract class Policy {\n protected context?: T;\n protected conditionResolver?: ConditionResolver;\n\n constructor({ context, conditionResolver }: MatchConditionInterface) {\n this.context = context;\n this.conditionResolver = conditionResolver;\n }\n\n setContext(this: Policy, context: T): void {\n this.context = context;\n }\n\n getContext(this: Policy): T | undefined {\n return this.context;\n }\n\n setConditionResolver(\n this: Policy,\n conditionResolver: ConditionResolver\n ): void {\n this.conditionResolver = conditionResolver;\n }\n\n getConditionResolver(this: Policy): ConditionResolver | undefined {\n return this.conditionResolver;\n }\n\n abstract getStatements(this: Policy): U[];\n}\n\nexport { Policy };\n","import {\n ActionBasedType,\n ConditionResolver,\n EvaluateActionBasedInterface,\n ProxyOptions\n} from './types';\nimport { ActionBased } from './ActionBasedStatement';\nimport { Policy } from './Policy';\n\nexport interface ActionBasedPolicyInterface {\n statements: ActionBasedType[];\n conditionResolver?: ConditionResolver;\n context?: T;\n}\n\nexport class ActionBasedPolicy extends Policy<\n T,\n ActionBasedType\n> {\n private denyStatements: ActionBased[];\n private allowStatements: ActionBased[];\n private statements: ActionBasedType[];\n\n constructor({\n statements,\n conditionResolver,\n context\n }: ActionBasedPolicyInterface) {\n super({ context, conditionResolver });\n const statementInstances = statements.map(\n (statement) => new ActionBased(statement)\n );\n this.allowStatements = statementInstances.filter(\n (s) => s.effect === 'allow'\n );\n this.denyStatements = statementInstances.filter((s) => s.effect === 'deny');\n this.statements = statementInstances.map((statement) =>\n statement.getStatement()\n );\n }\n\n addStatement(this: ActionBasedPolicy, statement: ActionBasedType): void {\n const statementInstance = new ActionBased(statement);\n if (statementInstance.effect === 'allow') {\n this.allowStatements.push(statementInstance);\n } else {\n this.denyStatements.push(statementInstance);\n }\n this.statements.push(statementInstance.getStatement());\n }\n\n getStatements(this: ActionBasedPolicy): ActionBasedType[] {\n return this.statements;\n }\n\n evaluate(\n this: ActionBasedPolicy,\n { action, context }: EvaluateActionBasedInterface\n ): boolean {\n const args = { action, context };\n return !this.cannot(args) && this.can(args);\n }\n\n can(\n this: ActionBasedPolicy,\n { action, context }: EvaluateActionBasedInterface\n ): boolean {\n return this.allowStatements.some((s) =>\n s.matches({\n action,\n context: context || this.context,\n conditionResolver: this.conditionResolver\n })\n );\n }\n\n cannot(\n this: ActionBasedPolicy,\n { action, context }: EvaluateActionBasedInterface\n ): boolean {\n return this.denyStatements.some((s) =>\n s.matches({\n action,\n context: context || this.context,\n conditionResolver: this.conditionResolver\n })\n );\n }\n\n generateProxy(\n this: ActionBasedPolicy,\n obj: U,\n options: ProxyOptions = {}\n ): U {\n const { get = {}, set = {} } = options;\n const { allow: allowGet = true, propertyMap: propertyMapGet = {} } = get;\n const { allow: allowSet = true, propertyMap: propertyMapSet = {} } = set;\n const handler = {\n ...(allowGet\n ? {\n get: (target: U, prop: W): any => {\n if (prop in target) {\n if (typeof prop === 'string') {\n const property = propertyMapGet[prop] || prop;\n if (this.evaluate({ action: property })) return target[prop];\n throw new Error(`Unauthorize to get ${prop} property`);\n }\n }\n return target[prop];\n }\n }\n : {}),\n ...(allowSet\n ? {\n set: (target: U, prop: W, value: any): boolean => {\n if (typeof prop === 'string') {\n const property = propertyMapSet[prop] || prop;\n if (this.evaluate({ action: property })) {\n target[prop] = value;\n return true;\n } else throw new Error(`Unauthorize to set ${prop} property`);\n }\n return true;\n }\n }\n : {})\n };\n\n return new Proxy(obj, handler);\n }\n}\n","import {\n ConditionResolver,\n EvaluateIdentityBasedInterface,\n IdentityBasedType\n} from './types';\nimport { IdentityBased } from './IdentityBasedStatement';\nimport { Policy } from './Policy';\n\ninterface IdentityBasedPolicyInterface {\n statements: IdentityBasedType[];\n conditionResolver?: ConditionResolver;\n context?: T;\n}\n\nexport class IdentityBasedPolicy extends Policy<\n T,\n IdentityBasedType\n> {\n private denyStatements: IdentityBased[];\n private allowStatements: IdentityBased[];\n private statements: IdentityBasedType[];\n\n constructor({\n statements,\n conditionResolver,\n context\n }: IdentityBasedPolicyInterface) {\n super({ context, conditionResolver });\n const statementInstances = statements.map(\n (statement) => new IdentityBased(statement)\n );\n this.allowStatements = statementInstances.filter(\n (s) => s.effect === 'allow'\n );\n this.denyStatements = statementInstances.filter((s) => s.effect === 'deny');\n this.statements = statementInstances.map((statement) =>\n statement.getStatement()\n );\n }\n\n addStatement(\n this: IdentityBasedPolicy,\n statement: IdentityBasedType\n ): void {\n const statementInstance = new IdentityBased(statement);\n if (statementInstance.effect === 'allow') {\n this.allowStatements.push(statementInstance);\n } else {\n this.denyStatements.push(statementInstance);\n }\n this.statements.push(statementInstance.getStatement());\n }\n\n getStatements(this: IdentityBasedPolicy): IdentityBasedType[] {\n return this.statements;\n }\n\n evaluate(\n this: IdentityBasedPolicy,\n { action, resource, context }: EvaluateIdentityBasedInterface\n ): boolean {\n const args = { action, resource, context };\n return !this.cannot(args) && this.can(args);\n }\n\n can(\n this: IdentityBasedPolicy,\n { action, resource, context }: EvaluateIdentityBasedInterface\n ): boolean {\n return this.allowStatements.some((s) =>\n s.matches({\n action,\n resource,\n context: context || this.context,\n conditionResolver: this.conditionResolver\n })\n );\n }\n\n cannot(\n this: IdentityBasedPolicy,\n { action, resource, context }: EvaluateIdentityBasedInterface\n ): boolean {\n return this.denyStatements.some((s) =>\n s.matches({\n action,\n resource,\n context: context || this.context,\n conditionResolver: this.conditionResolver\n })\n );\n }\n}\n","import {\n ConditionResolver,\n EvaluateResourceBasedInterface,\n ResourceBasedType\n} from './types';\nimport { ResourceBased } from './ResourceBasedStatement';\nimport { Policy } from './Policy';\n\ninterface ResourceBasedPolicyInterface {\n statements: ResourceBasedType[];\n conditionResolver?: ConditionResolver;\n context?: T;\n}\n\nexport class ResourceBasedPolicy extends Policy<\n T,\n ResourceBasedType\n> {\n private denyStatements: ResourceBased[];\n private allowStatements: ResourceBased[];\n private statements: ResourceBasedType[];\n\n constructor({\n statements,\n conditionResolver,\n context\n }: ResourceBasedPolicyInterface) {\n super({ context, conditionResolver });\n const statementInstances = statements.map(\n (statement) => new ResourceBased(statement)\n );\n this.allowStatements = statementInstances.filter(\n (s) => s.effect === 'allow'\n );\n this.denyStatements = statementInstances.filter((s) => s.effect === 'deny');\n this.statements = statementInstances.map((statement) =>\n statement.getStatement()\n );\n }\n\n addStatement(\n this: ResourceBasedPolicy,\n statement: ResourceBasedType\n ): void {\n const statementInstance = new ResourceBased(statement);\n if (statementInstance.effect === 'allow') {\n this.allowStatements.push(statementInstance);\n } else {\n this.denyStatements.push(statementInstance);\n }\n this.statements.push(statementInstance.getStatement());\n }\n\n getStatements(this: ResourceBasedPolicy): ResourceBasedType[] {\n return this.statements;\n }\n\n evaluate(\n this: ResourceBasedPolicy,\n {\n principal,\n action,\n resource,\n principalType,\n context\n }: EvaluateResourceBasedInterface\n ): boolean {\n const args = { principal, action, resource, principalType, context };\n return !this.cannot(args) && this.can(args);\n }\n\n can(\n this: ResourceBasedPolicy,\n {\n principal,\n action,\n resource,\n principalType,\n context\n }: EvaluateResourceBasedInterface\n ): boolean {\n return this.allowStatements.some((s) =>\n s.matches({\n principal,\n action,\n resource,\n principalType,\n context: context || this.context,\n conditionResolver: this.conditionResolver\n })\n );\n }\n\n cannot(\n this: ResourceBasedPolicy,\n {\n principal,\n action,\n resource,\n principalType,\n context\n }: EvaluateResourceBasedInterface\n ): boolean {\n return this.denyStatements.some((s) =>\n s.matches({\n principal,\n action,\n resource,\n principalType,\n context: context || this.context,\n conditionResolver: this.conditionResolver\n })\n );\n }\n}\n"],"names":[],"mappings":";;;;AAAA;;;;;;;;;;;;;;;;SAgBgB,MAAM,CAAC,KAAc;IACnC,OAAO,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC/C;;AChBA;;;;;;;;;;;;;;;;SAgBgB,QAAQ,CAAC,KAAe;IACtC,MAAM,IAAI,GAAG,OAAO,KAAK,CAAC;IAC1B,QACE,IAAI,KAAK,QAAQ;SAChB,IAAI,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,iBAAiB,CAAC,EAC5E;AACJ;;ACtBA;AACA,MAAM,QAAQ,GAAG,CAAC,GAAG,CAAC,CAAC;AAEvB;;;;;;;;;;;;;;;SAegB,KAAK,CAAC,KAAc;IAClC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,QAAQ,CAAC,KAAK,CAAC,EAAE;QAChD,OAAO,KAAK,CAAC;KACd;IAED,OAAO,KAAK,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,KAAK,CAAC,QAAQ,GAAG,IAAI,GAAG,GAAG,KAAK,EAAE,CAAC;AACpE;;ACxBA;AACA,MAAM,YAAY,GAAG,kDAAkD,CAAC;AACxE,MAAM,aAAa,GAAG,OAAO,CAAC;AAE9B;;;;;;;;;;;;;;;;;;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I,CAAC,UAAU,CAAC;KACxB;IAED,QAAQ,CAEN,EACE,SAAS,EACT,MAAM,EACN,QAAQ,EACR,aAAa,EACb,OAAO,EAC2B;QAEpC,MAAM,IAAI,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC;QACrE,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;KAC7C;IAED,GAAG,CAED,EACE,SAAS,EACT,MAAM,EACN,QAAQ,EACR,aAAa,EACb,OAAO,EAC2B;QAEpC,OAAO,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KACjC,CAAC,CAAC,OAAO,CAAC;YACR,SAAS;YACT,MAAM;YACN,QAAQ;YACR,aAAa;YACb,OAAO,EAAE,OAAO,IAAI,IAAI,CAAC,OAAO;YAChC,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;SAC1C,CAAC,CACH,CAAC;KACH;IAED,MAAM,CAEJ,EACE,SAAS,EACT,MAAM,EACN,QAAQ,EACR,aAAa,EACb,OAAO,EAC2B;QAEpC,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,KAChC,CAAC,CAAC,OAAO,CAAC;YACR,SAAS;YACT,MAAM;YACN,QAAQ;YACR,aAAa;YACb,OAAO,EAAE,OAAO,IAAI,IAAI,CAAC,OAAO;YAChC,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;SAC1C,CAAC,CACH,CAAC;KACH;;;;;;;;;;;;"} \ No newline at end of file diff --git a/www/src/docs/en.md b/www/src/docs/en.md index bd3f5f4..4d689bd 100644 --- a/www/src/docs/en.md +++ b/www/src/docs/en.md @@ -707,12 +707,14 @@ Boolean conditions let you construct **condition** elements that restrict access Date conditions let you construct **condition** elements that restrict access based on comparing a key to **date/time** value. -| Name | First Parameter | Expected Parameter | Description | -| -------------------- | --------------- | ------------------ | ----------------------------------------------- | -| `dateEquals` | Date or string | Date or string | Matching a specific date. | -| `dateNotEquals` | Date or string | Date or string | Negated matching. | -| `dateLessThan` | Date or string | Date or string | Matching before a specific date and time. | -| `dateLessThanEquals` | Date or string | Date or string | Matching at or before a specific date and time. | +| Name | First Parameter | Expected Parameter | Description | +| ----------------------- | --------------- | ------------------ | ----------------------------------------------- | +| `dateEquals` | Date or string | Date or string | Matching a specific date. | +| `dateNotEquals` | Date or string | Date or string | Negated matching. | +| `dateLessThan` | Date or string | Date or string | Matching before a specific date and time. | +| `dateLessThanEquals` | Date or string | Date or string | Matching at or before a specific date and time. | +| `dateGreaterThan` | Date or string | Date or string | Matching after a specific date and time. | +| `dateGreaterThanEquals` | Date or string | Date or string | Matching at or after a specific date and time. | ### Numeric condition operators