├── .gitignore ├── LICENSE ├── README.md ├── firewall.js ├── package-lock.json ├── package.json └── test ├── all.js └── service.js /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | out/ 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Aycan Gulez 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | firewall-js is a Node.js library that safeguards your codebase with seamless access control based on directory structure. 2 | 3 | ## Installation 4 | 5 | ```bash 6 | npm install --save firewall-js 7 | ``` 8 | 9 | ## Usage 10 | 11 | ```js 12 | const firewall = require('firewall-js'); 13 | const proxiedObj = firewall.allow(allowedPathsArray, targetObj); 14 | ``` 15 | 16 | By using JavaScript proxies, firewall-js allows only the files specified in `allowedPathsArray` to access any object or function. 17 | 18 | 19 | 20 | As a quick example, take a simple backend application with three layers: **routes > controllers > services**. Each layer has its own directory, and each file in a directory houses a module. The directory listing should look something like this: 21 | 22 | ```text 23 | > controllers 24 | > routes 25 | v services 26 | auth.js 27 | log.js 28 | user.js 29 | ``` 30 | 31 | If you want all the controller and service modules to have access to a particular service module, it can be done with a single line: 32 | 33 | ```js 34 | // services/user.js 35 | // ... 36 | const firewall = require('firewall-js'); 37 | 38 | const userService = { 39 | hashPassword: function (password) { 40 | return bcrypt.hash(password, 8); 41 | }, 42 | 43 | getUserByEmail: function (email) { 44 | return db('user').where('email', email).then(_.head); 45 | }, 46 | 47 | // ... 48 | }; 49 | 50 | module.exports = firewall.allow(['controllers', 'services'], userService); 51 | ``` 52 | 53 | If you attempt to call, for example, *userService.hashPassword()* from a file in any other directory, an exception will be thrown: 54 | 55 | ```text 56 | Error: Access denied for hashPassword from /Users/me/my-app/routes/main.js:51:19 57 | ``` 58 | 59 | You can also allow access not just from directories, but from files too. In the following example, only the userProfile controller can access userService, and no one else: 60 | 61 | ```js 62 | module.exports = firewall.allow(['controllers/userProfile.js'], userService); 63 | ``` 64 | 65 | Having the filesystem structure as the basis of the access control system offers two benefits: 66 | 67 | * A clear-cut organization of code with directories acting as layers and files as modules within those layers. 68 | * Permissions that are easy to understand, since most everyone is familiar with how a filesystem works. 69 | -------------------------------------------------------------------------------- /firewall.js: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | 3 | const is = require('fn-arg-validator'); 4 | const find = require('lodash/fp/find'); 5 | const includes = require('lodash/fp/includes'); 6 | const isSymbol = require('lodash/fp/isSymbol'); 7 | const callsites = require('callsites'); 8 | 9 | is.config.throw = true; 10 | 11 | function firewall() { 12 | /** 13 | * @param {string[]} locations 14 | * @param {string | symbol} prop 15 | */ 16 | function throwIfCallerNotAuthorized(locations, prop) { 17 | is.valid(is.array, is.oneOf(is.maybeString, isSymbol), arguments); 18 | const caller = find((c) => c.getFileName() && !includes('firewall-js/firewall.js')(c.getFileName()))( 19 | callsites() 20 | ); 21 | const callerFileName = caller ? caller.getFileName() : ''; 22 | 23 | if ( 24 | callerFileName && 25 | !find((location) => { 26 | if (!includes('.')(location)) { 27 | location += '/'; 28 | } 29 | const fullPath = (process.env.PWD + '/' + location).replace(/\/{2,}/g, '/'); 30 | return includes(fullPath)(callerFileName) || includes('node_modules')(callerFileName); 31 | })(locations) 32 | ) { 33 | const err = `Access denied for ${prop.toString()} from ${callerFileName}:${caller.getLineNumber()}:${caller.getColumnNumber()}`; 34 | throw new Error(err); 35 | } 36 | } 37 | 38 | /** 39 | * @param {string[]} locations 40 | * @param {Object} objToProxy 41 | * @returns {Object} 42 | */ 43 | function createProxiedObject(locations, objToProxy) { 44 | is.valid(is.array, is.object, arguments); 45 | const proxied = new Proxy(objToProxy, { 46 | apply: function (target, thisArg, argumentsList) { 47 | throwIfCallerNotAuthorized(locations, 'calling function'); 48 | // @ts-expect-error 49 | return Reflect.apply(...arguments); 50 | }, 51 | construct(target, args) { 52 | throwIfCallerNotAuthorized(locations, 'creating new object'); 53 | // @ts-expect-error 54 | return Reflect.construct(...arguments); 55 | }, 56 | defineProperty(target, prop, descriptor) { 57 | throwIfCallerNotAuthorized(locations, prop); 58 | // @ts-expect-error 59 | return Reflect.defineProperty(...arguments); 60 | }, 61 | deleteProperty(target, prop) { 62 | throwIfCallerNotAuthorized(locations, 'deleting property'); 63 | // @ts-expect-error 64 | return Reflect.deleteProperty(...arguments); 65 | }, 66 | get: function (target, prop, receiver) { 67 | throwIfCallerNotAuthorized(locations, prop); 68 | // @ts-expect-error 69 | return Reflect.get(...arguments); 70 | }, 71 | getOwnPropertyDescriptor(target, prop) { 72 | throwIfCallerNotAuthorized(locations, prop); 73 | // @ts-expect-error 74 | return Reflect.getOwnPropertyDescriptor(...arguments); 75 | }, 76 | getPrototypeOf(target) { 77 | throwIfCallerNotAuthorized(locations, 'getting prototype'); 78 | // @ts-expect-error 79 | return Reflect.getPrototypeOf(...arguments); 80 | }, 81 | has: function (target, prop) { 82 | throwIfCallerNotAuthorized(locations, prop); 83 | // @ts-expect-error 84 | return Reflect.has(...arguments); 85 | }, 86 | isExtensible(target) { 87 | throwIfCallerNotAuthorized(locations, 'checking extensibility'); 88 | // @ts-expect-error 89 | return Reflect.isExtensible(...arguments); 90 | }, 91 | ownKeys: function (target) { 92 | throwIfCallerNotAuthorized(locations, 'observing own keys'); 93 | // @ts-expect-error 94 | return Reflect.ownKeys(...arguments); 95 | }, 96 | preventExtensions(target) { 97 | throwIfCallerNotAuthorized(locations, 'preventing extensions'); 98 | // @ts-expect-error 99 | return Reflect.preventExtensions(...arguments); 100 | }, 101 | set: function (target, prop, value) { 102 | throwIfCallerNotAuthorized(locations, prop); 103 | // @ts-expect-error 104 | return Reflect.set(...arguments); 105 | }, 106 | setPrototypeOf(target, prototype) { 107 | throwIfCallerNotAuthorized(locations, 'setting prototype'); 108 | // @ts-expect-error 109 | return Reflect.setPrototypeOf(...arguments); 110 | }, 111 | }); 112 | return proxied; 113 | } 114 | 115 | /** 116 | * @param {string[]} locations Allowed paths 117 | * @param {Object} targetObj Target object 118 | * @returns {Object} Proxied object 119 | */ 120 | this.allow = function (locations, targetObj) { 121 | is.valid(is.array, is.object, arguments); 122 | return createProxiedObject(locations, targetObj); 123 | }; 124 | 125 | return this; 126 | } 127 | 128 | module.exports = firewall(); 129 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "firewall-js", 3 | "version": "0.2.0", 4 | "lockfileVersion": 3, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "firewall-js", 9 | "version": "0.2.0", 10 | "license": "MIT", 11 | "dependencies": { 12 | "callsites": "^3.1.0", 13 | "fn-arg-validator": "^1.1.2", 14 | "lodash": "^4.17.21" 15 | }, 16 | "devDependencies": { 17 | "@types/chai": "^5.0.0", 18 | "@types/mocha": "^10.0.8", 19 | "@types/node": "^22.7.4", 20 | "chai": "^4.5.0", 21 | "jsdoc": "^4.0.3", 22 | "mocha": "^10.7.3" 23 | } 24 | }, 25 | "node_modules/@babel/helper-string-parser": { 26 | "version": "7.24.8", 27 | "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.8.tgz", 28 | "integrity": "sha512-pO9KhhRcuUyGnJWwyEgnRJTSIZHiT+vMD0kPeD+so0l7mxkMT19g3pjY9GTnHySck/hDzq+dtW/4VgnMkippsQ==", 29 | "dev": true, 30 | "engines": { 31 | "node": ">=6.9.0" 32 | } 33 | }, 34 | "node_modules/@babel/helper-validator-identifier": { 35 | "version": "7.24.7", 36 | "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz", 37 | "integrity": "sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==", 38 | "dev": true, 39 | "engines": { 40 | "node": ">=6.9.0" 41 | } 42 | }, 43 | "node_modules/@babel/parser": { 44 | "version": "7.25.6", 45 | "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.25.6.tgz", 46 | "integrity": "sha512-trGdfBdbD0l1ZPmcJ83eNxB9rbEax4ALFTF7fN386TMYbeCQbyme5cOEXQhbGXKebwGaB/J52w1mrklMcbgy6Q==", 47 | "dev": true, 48 | "dependencies": { 49 | "@babel/types": "^7.25.6" 50 | }, 51 | "bin": { 52 | "parser": "bin/babel-parser.js" 53 | }, 54 | "engines": { 55 | "node": ">=6.0.0" 56 | } 57 | }, 58 | "node_modules/@babel/types": { 59 | "version": "7.25.6", 60 | "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.6.tgz", 61 | "integrity": "sha512-/l42B1qxpG6RdfYf343Uw1vmDjeNhneUXtzhojE7pDgfpEypmRhI6j1kr17XCVv4Cgl9HdAiQY2x0GwKm7rWCw==", 62 | "dev": true, 63 | "dependencies": { 64 | "@babel/helper-string-parser": "^7.24.8", 65 | "@babel/helper-validator-identifier": "^7.24.7", 66 | "to-fast-properties": "^2.0.0" 67 | }, 68 | "engines": { 69 | "node": ">=6.9.0" 70 | } 71 | }, 72 | "node_modules/@jsdoc/salty": { 73 | "version": "0.2.8", 74 | "resolved": "https://registry.npmjs.org/@jsdoc/salty/-/salty-0.2.8.tgz", 75 | "integrity": "sha512-5e+SFVavj1ORKlKaKr2BmTOekmXbelU7dC0cDkQLqag7xfuTPuGMUFx7KWJuv4bYZrTsoL2Z18VVCOKYxzoHcg==", 76 | "dev": true, 77 | "dependencies": { 78 | "lodash": "^4.17.21" 79 | }, 80 | "engines": { 81 | "node": ">=v12.0.0" 82 | } 83 | }, 84 | "node_modules/@types/chai": { 85 | "version": "5.0.0", 86 | "resolved": "https://registry.npmjs.org/@types/chai/-/chai-5.0.0.tgz", 87 | "integrity": "sha512-+DwhEHAaFPPdJ2ral3kNHFQXnTfscEEFsUxzD+d7nlcLrFK23JtNjH71RGasTcHb88b4vVi4mTyfpf8u2L8bdA==", 88 | "dev": true 89 | }, 90 | "node_modules/@types/linkify-it": { 91 | "version": "5.0.0", 92 | "resolved": "https://registry.npmjs.org/@types/linkify-it/-/linkify-it-5.0.0.tgz", 93 | "integrity": "sha512-sVDA58zAw4eWAffKOaQH5/5j3XeayukzDk+ewSsnv3p4yJEZHCCzMDiZM8e0OUrRvmpGZ85jf4yDHkHsgBNr9Q==", 94 | "dev": true 95 | }, 96 | "node_modules/@types/markdown-it": { 97 | "version": "14.1.2", 98 | "resolved": "https://registry.npmjs.org/@types/markdown-it/-/markdown-it-14.1.2.tgz", 99 | "integrity": "sha512-promo4eFwuiW+TfGxhi+0x3czqTYJkG8qB17ZUJiVF10Xm7NLVRSLUsfRTU/6h1e24VvRnXCx+hG7li58lkzog==", 100 | "dev": true, 101 | "dependencies": { 102 | "@types/linkify-it": "^5", 103 | "@types/mdurl": "^2" 104 | } 105 | }, 106 | "node_modules/@types/mdurl": { 107 | "version": "2.0.0", 108 | "resolved": "https://registry.npmjs.org/@types/mdurl/-/mdurl-2.0.0.tgz", 109 | "integrity": "sha512-RGdgjQUZba5p6QEFAVx2OGb8rQDL/cPRG7GiedRzMcJ1tYnUANBncjbSB1NRGwbvjcPeikRABz2nshyPk1bhWg==", 110 | "dev": true 111 | }, 112 | "node_modules/@types/mocha": { 113 | "version": "10.0.8", 114 | "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.8.tgz", 115 | "integrity": "sha512-HfMcUmy9hTMJh66VNcmeC9iVErIZJli2bszuXc6julh5YGuRb/W5OnkHjwLNYdFlMis0sY3If5SEAp+PktdJjw==", 116 | "dev": true 117 | }, 118 | "node_modules/@types/node": { 119 | "version": "22.7.4", 120 | "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.4.tgz", 121 | "integrity": "sha512-y+NPi1rFzDs1NdQHHToqeiX2TIS79SWEAw9GYhkkx8bD0ChpfqC+n2j5OXOCpzfojBEBt6DnEnnG9MY0zk1XLg==", 122 | "dev": true, 123 | "dependencies": { 124 | "undici-types": "~6.19.2" 125 | } 126 | }, 127 | "node_modules/ansi-colors": { 128 | "version": "4.1.3", 129 | "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", 130 | "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", 131 | "dev": true, 132 | "engines": { 133 | "node": ">=6" 134 | } 135 | }, 136 | "node_modules/ansi-regex": { 137 | "version": "5.0.1", 138 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", 139 | "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", 140 | "dev": true, 141 | "engines": { 142 | "node": ">=8" 143 | } 144 | }, 145 | "node_modules/ansi-styles": { 146 | "version": "4.3.0", 147 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", 148 | "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", 149 | "dev": true, 150 | "dependencies": { 151 | "color-convert": "^2.0.1" 152 | }, 153 | "engines": { 154 | "node": ">=8" 155 | }, 156 | "funding": { 157 | "url": "https://github.com/chalk/ansi-styles?sponsor=1" 158 | } 159 | }, 160 | "node_modules/anymatch": { 161 | "version": "3.1.3", 162 | "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", 163 | "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", 164 | "dev": true, 165 | "dependencies": { 166 | "normalize-path": "^3.0.0", 167 | "picomatch": "^2.0.4" 168 | }, 169 | "engines": { 170 | "node": ">= 8" 171 | } 172 | }, 173 | "node_modules/argparse": { 174 | "version": "2.0.1", 175 | "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", 176 | "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", 177 | "dev": true 178 | }, 179 | "node_modules/assertion-error": { 180 | "version": "1.1.0", 181 | "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", 182 | "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", 183 | "dev": true, 184 | "engines": { 185 | "node": "*" 186 | } 187 | }, 188 | "node_modules/balanced-match": { 189 | "version": "1.0.2", 190 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", 191 | "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", 192 | "dev": true 193 | }, 194 | "node_modules/binary-extensions": { 195 | "version": "2.3.0", 196 | "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", 197 | "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", 198 | "dev": true, 199 | "engines": { 200 | "node": ">=8" 201 | }, 202 | "funding": { 203 | "url": "https://github.com/sponsors/sindresorhus" 204 | } 205 | }, 206 | "node_modules/bluebird": { 207 | "version": "3.7.2", 208 | "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", 209 | "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", 210 | "dev": true 211 | }, 212 | "node_modules/brace-expansion": { 213 | "version": "2.0.1", 214 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", 215 | "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", 216 | "dev": true, 217 | "dependencies": { 218 | "balanced-match": "^1.0.0" 219 | } 220 | }, 221 | "node_modules/braces": { 222 | "version": "3.0.3", 223 | "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", 224 | "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", 225 | "dev": true, 226 | "dependencies": { 227 | "fill-range": "^7.1.1" 228 | }, 229 | "engines": { 230 | "node": ">=8" 231 | } 232 | }, 233 | "node_modules/browser-stdout": { 234 | "version": "1.3.1", 235 | "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", 236 | "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", 237 | "dev": true 238 | }, 239 | "node_modules/callsites": { 240 | "version": "3.1.0", 241 | "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", 242 | "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", 243 | "engines": { 244 | "node": ">=6" 245 | } 246 | }, 247 | "node_modules/camelcase": { 248 | "version": "6.3.0", 249 | "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", 250 | "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", 251 | "dev": true, 252 | "engines": { 253 | "node": ">=10" 254 | }, 255 | "funding": { 256 | "url": "https://github.com/sponsors/sindresorhus" 257 | } 258 | }, 259 | "node_modules/catharsis": { 260 | "version": "0.9.0", 261 | "resolved": "https://registry.npmjs.org/catharsis/-/catharsis-0.9.0.tgz", 262 | "integrity": "sha512-prMTQVpcns/tzFgFVkVp6ak6RykZyWb3gu8ckUpd6YkTlacOd3DXGJjIpD4Q6zJirizvaiAjSSHlOsA+6sNh2A==", 263 | "dev": true, 264 | "dependencies": { 265 | "lodash": "^4.17.15" 266 | }, 267 | "engines": { 268 | "node": ">= 10" 269 | } 270 | }, 271 | "node_modules/chai": { 272 | "version": "4.5.0", 273 | "resolved": "https://registry.npmjs.org/chai/-/chai-4.5.0.tgz", 274 | "integrity": "sha512-RITGBfijLkBddZvnn8jdqoTypxvqbOLYQkGGxXzeFjVHvudaPw0HNFD9x928/eUwYWd2dPCugVqspGALTZZQKw==", 275 | "dev": true, 276 | "dependencies": { 277 | "assertion-error": "^1.1.0", 278 | "check-error": "^1.0.3", 279 | "deep-eql": "^4.1.3", 280 | "get-func-name": "^2.0.2", 281 | "loupe": "^2.3.6", 282 | "pathval": "^1.1.1", 283 | "type-detect": "^4.1.0" 284 | }, 285 | "engines": { 286 | "node": ">=4" 287 | } 288 | }, 289 | "node_modules/chalk": { 290 | "version": "4.1.2", 291 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", 292 | "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", 293 | "dev": true, 294 | "dependencies": { 295 | "ansi-styles": "^4.1.0", 296 | "supports-color": "^7.1.0" 297 | }, 298 | "engines": { 299 | "node": ">=10" 300 | }, 301 | "funding": { 302 | "url": "https://github.com/chalk/chalk?sponsor=1" 303 | } 304 | }, 305 | "node_modules/chalk/node_modules/supports-color": { 306 | "version": "7.2.0", 307 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", 308 | "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", 309 | "dev": true, 310 | "dependencies": { 311 | "has-flag": "^4.0.0" 312 | }, 313 | "engines": { 314 | "node": ">=8" 315 | } 316 | }, 317 | "node_modules/check-error": { 318 | "version": "1.0.3", 319 | "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", 320 | "integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==", 321 | "dev": true, 322 | "dependencies": { 323 | "get-func-name": "^2.0.2" 324 | }, 325 | "engines": { 326 | "node": "*" 327 | } 328 | }, 329 | "node_modules/chokidar": { 330 | "version": "3.6.0", 331 | "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", 332 | "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", 333 | "dev": true, 334 | "dependencies": { 335 | "anymatch": "~3.1.2", 336 | "braces": "~3.0.2", 337 | "glob-parent": "~5.1.2", 338 | "is-binary-path": "~2.1.0", 339 | "is-glob": "~4.0.1", 340 | "normalize-path": "~3.0.0", 341 | "readdirp": "~3.6.0" 342 | }, 343 | "engines": { 344 | "node": ">= 8.10.0" 345 | }, 346 | "funding": { 347 | "url": "https://paulmillr.com/funding/" 348 | }, 349 | "optionalDependencies": { 350 | "fsevents": "~2.3.2" 351 | } 352 | }, 353 | "node_modules/cliui": { 354 | "version": "7.0.4", 355 | "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", 356 | "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", 357 | "dev": true, 358 | "dependencies": { 359 | "string-width": "^4.2.0", 360 | "strip-ansi": "^6.0.0", 361 | "wrap-ansi": "^7.0.0" 362 | } 363 | }, 364 | "node_modules/color-convert": { 365 | "version": "2.0.1", 366 | "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", 367 | "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", 368 | "dev": true, 369 | "dependencies": { 370 | "color-name": "~1.1.4" 371 | }, 372 | "engines": { 373 | "node": ">=7.0.0" 374 | } 375 | }, 376 | "node_modules/color-name": { 377 | "version": "1.1.4", 378 | "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", 379 | "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", 380 | "dev": true 381 | }, 382 | "node_modules/debug": { 383 | "version": "4.3.6", 384 | "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", 385 | "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", 386 | "dev": true, 387 | "dependencies": { 388 | "ms": "2.1.2" 389 | }, 390 | "engines": { 391 | "node": ">=6.0" 392 | }, 393 | "peerDependenciesMeta": { 394 | "supports-color": { 395 | "optional": true 396 | } 397 | } 398 | }, 399 | "node_modules/debug/node_modules/ms": { 400 | "version": "2.1.2", 401 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", 402 | "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", 403 | "dev": true 404 | }, 405 | "node_modules/decamelize": { 406 | "version": "4.0.0", 407 | "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", 408 | "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", 409 | "dev": true, 410 | "engines": { 411 | "node": ">=10" 412 | }, 413 | "funding": { 414 | "url": "https://github.com/sponsors/sindresorhus" 415 | } 416 | }, 417 | "node_modules/deep-eql": { 418 | "version": "4.1.4", 419 | "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.4.tgz", 420 | "integrity": "sha512-SUwdGfqdKOwxCPeVYjwSyRpJ7Z+fhpwIAtmCUdZIWZ/YP5R9WAsyuSgpLVDi9bjWoN2LXHNss/dk3urXtdQxGg==", 421 | "dev": true, 422 | "dependencies": { 423 | "type-detect": "^4.0.0" 424 | }, 425 | "engines": { 426 | "node": ">=6" 427 | } 428 | }, 429 | "node_modules/diff": { 430 | "version": "5.2.0", 431 | "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz", 432 | "integrity": "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==", 433 | "dev": true, 434 | "engines": { 435 | "node": ">=0.3.1" 436 | } 437 | }, 438 | "node_modules/emoji-regex": { 439 | "version": "8.0.0", 440 | "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", 441 | "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", 442 | "dev": true 443 | }, 444 | "node_modules/entities": { 445 | "version": "4.5.0", 446 | "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", 447 | "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", 448 | "dev": true, 449 | "engines": { 450 | "node": ">=0.12" 451 | }, 452 | "funding": { 453 | "url": "https://github.com/fb55/entities?sponsor=1" 454 | } 455 | }, 456 | "node_modules/escalade": { 457 | "version": "3.1.2", 458 | "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", 459 | "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", 460 | "dev": true, 461 | "engines": { 462 | "node": ">=6" 463 | } 464 | }, 465 | "node_modules/escape-string-regexp": { 466 | "version": "4.0.0", 467 | "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", 468 | "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", 469 | "dev": true, 470 | "engines": { 471 | "node": ">=10" 472 | }, 473 | "funding": { 474 | "url": "https://github.com/sponsors/sindresorhus" 475 | } 476 | }, 477 | "node_modules/fill-range": { 478 | "version": "7.1.1", 479 | "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", 480 | "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", 481 | "dev": true, 482 | "dependencies": { 483 | "to-regex-range": "^5.0.1" 484 | }, 485 | "engines": { 486 | "node": ">=8" 487 | } 488 | }, 489 | "node_modules/find-up": { 490 | "version": "5.0.0", 491 | "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", 492 | "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", 493 | "dev": true, 494 | "dependencies": { 495 | "locate-path": "^6.0.0", 496 | "path-exists": "^4.0.0" 497 | }, 498 | "engines": { 499 | "node": ">=10" 500 | }, 501 | "funding": { 502 | "url": "https://github.com/sponsors/sindresorhus" 503 | } 504 | }, 505 | "node_modules/flat": { 506 | "version": "5.0.2", 507 | "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", 508 | "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", 509 | "dev": true, 510 | "bin": { 511 | "flat": "cli.js" 512 | } 513 | }, 514 | "node_modules/fn-arg-validator": { 515 | "version": "1.1.2", 516 | "resolved": "https://registry.npmjs.org/fn-arg-validator/-/fn-arg-validator-1.1.2.tgz", 517 | "integrity": "sha512-XsKa25klGtQmDxBE86zbHqbgf8HuFSKrVDB7VwuBk5g2bDKLvcRm84o/VLceybKmcFo2joXs2hsPdZDugJHQnw==", 518 | "dependencies": { 519 | "lodash": "^4.17.21" 520 | } 521 | }, 522 | "node_modules/fs.realpath": { 523 | "version": "1.0.0", 524 | "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", 525 | "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", 526 | "dev": true 527 | }, 528 | "node_modules/fsevents": { 529 | "version": "2.3.3", 530 | "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", 531 | "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", 532 | "dev": true, 533 | "hasInstallScript": true, 534 | "optional": true, 535 | "os": [ 536 | "darwin" 537 | ], 538 | "engines": { 539 | "node": "^8.16.0 || ^10.6.0 || >=11.0.0" 540 | } 541 | }, 542 | "node_modules/get-caller-file": { 543 | "version": "2.0.5", 544 | "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", 545 | "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", 546 | "dev": true, 547 | "engines": { 548 | "node": "6.* || 8.* || >= 10.*" 549 | } 550 | }, 551 | "node_modules/get-func-name": { 552 | "version": "2.0.2", 553 | "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", 554 | "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", 555 | "dev": true, 556 | "engines": { 557 | "node": "*" 558 | } 559 | }, 560 | "node_modules/glob": { 561 | "version": "8.1.0", 562 | "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", 563 | "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", 564 | "deprecated": "Glob versions prior to v9 are no longer supported", 565 | "dev": true, 566 | "dependencies": { 567 | "fs.realpath": "^1.0.0", 568 | "inflight": "^1.0.4", 569 | "inherits": "2", 570 | "minimatch": "^5.0.1", 571 | "once": "^1.3.0" 572 | }, 573 | "engines": { 574 | "node": ">=12" 575 | }, 576 | "funding": { 577 | "url": "https://github.com/sponsors/isaacs" 578 | } 579 | }, 580 | "node_modules/glob-parent": { 581 | "version": "5.1.2", 582 | "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", 583 | "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", 584 | "dev": true, 585 | "dependencies": { 586 | "is-glob": "^4.0.1" 587 | }, 588 | "engines": { 589 | "node": ">= 6" 590 | } 591 | }, 592 | "node_modules/graceful-fs": { 593 | "version": "4.2.11", 594 | "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", 595 | "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", 596 | "dev": true 597 | }, 598 | "node_modules/has-flag": { 599 | "version": "4.0.0", 600 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", 601 | "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", 602 | "dev": true, 603 | "engines": { 604 | "node": ">=8" 605 | } 606 | }, 607 | "node_modules/he": { 608 | "version": "1.2.0", 609 | "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", 610 | "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", 611 | "dev": true, 612 | "bin": { 613 | "he": "bin/he" 614 | } 615 | }, 616 | "node_modules/inflight": { 617 | "version": "1.0.6", 618 | "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", 619 | "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", 620 | "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", 621 | "dev": true, 622 | "dependencies": { 623 | "once": "^1.3.0", 624 | "wrappy": "1" 625 | } 626 | }, 627 | "node_modules/inherits": { 628 | "version": "2.0.4", 629 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 630 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", 631 | "dev": true 632 | }, 633 | "node_modules/is-binary-path": { 634 | "version": "2.1.0", 635 | "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", 636 | "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", 637 | "dev": true, 638 | "dependencies": { 639 | "binary-extensions": "^2.0.0" 640 | }, 641 | "engines": { 642 | "node": ">=8" 643 | } 644 | }, 645 | "node_modules/is-extglob": { 646 | "version": "2.1.1", 647 | "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", 648 | "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", 649 | "dev": true, 650 | "engines": { 651 | "node": ">=0.10.0" 652 | } 653 | }, 654 | "node_modules/is-fullwidth-code-point": { 655 | "version": "3.0.0", 656 | "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", 657 | "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", 658 | "dev": true, 659 | "engines": { 660 | "node": ">=8" 661 | } 662 | }, 663 | "node_modules/is-glob": { 664 | "version": "4.0.3", 665 | "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", 666 | "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", 667 | "dev": true, 668 | "dependencies": { 669 | "is-extglob": "^2.1.1" 670 | }, 671 | "engines": { 672 | "node": ">=0.10.0" 673 | } 674 | }, 675 | "node_modules/is-number": { 676 | "version": "7.0.0", 677 | "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", 678 | "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", 679 | "dev": true, 680 | "engines": { 681 | "node": ">=0.12.0" 682 | } 683 | }, 684 | "node_modules/is-plain-obj": { 685 | "version": "2.1.0", 686 | "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", 687 | "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", 688 | "dev": true, 689 | "engines": { 690 | "node": ">=8" 691 | } 692 | }, 693 | "node_modules/is-unicode-supported": { 694 | "version": "0.1.0", 695 | "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", 696 | "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", 697 | "dev": true, 698 | "engines": { 699 | "node": ">=10" 700 | }, 701 | "funding": { 702 | "url": "https://github.com/sponsors/sindresorhus" 703 | } 704 | }, 705 | "node_modules/js-yaml": { 706 | "version": "4.1.0", 707 | "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", 708 | "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", 709 | "dev": true, 710 | "dependencies": { 711 | "argparse": "^2.0.1" 712 | }, 713 | "bin": { 714 | "js-yaml": "bin/js-yaml.js" 715 | } 716 | }, 717 | "node_modules/js2xmlparser": { 718 | "version": "4.0.2", 719 | "resolved": "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-4.0.2.tgz", 720 | "integrity": "sha512-6n4D8gLlLf1n5mNLQPRfViYzu9RATblzPEtm1SthMX1Pjao0r9YI9nw7ZIfRxQMERS87mcswrg+r/OYrPRX6jA==", 721 | "dev": true, 722 | "dependencies": { 723 | "xmlcreate": "^2.0.4" 724 | } 725 | }, 726 | "node_modules/jsdoc": { 727 | "version": "4.0.3", 728 | "resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-4.0.3.tgz", 729 | "integrity": "sha512-Nu7Sf35kXJ1MWDZIMAuATRQTg1iIPdzh7tqJ6jjvaU/GfDf+qi5UV8zJR3Mo+/pYFvm8mzay4+6O5EWigaQBQw==", 730 | "dev": true, 731 | "dependencies": { 732 | "@babel/parser": "^7.20.15", 733 | "@jsdoc/salty": "^0.2.1", 734 | "@types/markdown-it": "^14.1.1", 735 | "bluebird": "^3.7.2", 736 | "catharsis": "^0.9.0", 737 | "escape-string-regexp": "^2.0.0", 738 | "js2xmlparser": "^4.0.2", 739 | "klaw": "^3.0.0", 740 | "markdown-it": "^14.1.0", 741 | "markdown-it-anchor": "^8.6.7", 742 | "marked": "^4.0.10", 743 | "mkdirp": "^1.0.4", 744 | "requizzle": "^0.2.3", 745 | "strip-json-comments": "^3.1.0", 746 | "underscore": "~1.13.2" 747 | }, 748 | "bin": { 749 | "jsdoc": "jsdoc.js" 750 | }, 751 | "engines": { 752 | "node": ">=12.0.0" 753 | } 754 | }, 755 | "node_modules/jsdoc/node_modules/escape-string-regexp": { 756 | "version": "2.0.0", 757 | "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", 758 | "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", 759 | "dev": true, 760 | "engines": { 761 | "node": ">=8" 762 | } 763 | }, 764 | "node_modules/klaw": { 765 | "version": "3.0.0", 766 | "resolved": "https://registry.npmjs.org/klaw/-/klaw-3.0.0.tgz", 767 | "integrity": "sha512-0Fo5oir+O9jnXu5EefYbVK+mHMBeEVEy2cmctR1O1NECcCkPRreJKrS6Qt/j3KC2C148Dfo9i3pCmCMsdqGr0g==", 768 | "dev": true, 769 | "dependencies": { 770 | "graceful-fs": "^4.1.9" 771 | } 772 | }, 773 | "node_modules/linkify-it": { 774 | "version": "5.0.0", 775 | "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-5.0.0.tgz", 776 | "integrity": "sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ==", 777 | "dev": true, 778 | "dependencies": { 779 | "uc.micro": "^2.0.0" 780 | } 781 | }, 782 | "node_modules/locate-path": { 783 | "version": "6.0.0", 784 | "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", 785 | "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", 786 | "dev": true, 787 | "dependencies": { 788 | "p-locate": "^5.0.0" 789 | }, 790 | "engines": { 791 | "node": ">=10" 792 | }, 793 | "funding": { 794 | "url": "https://github.com/sponsors/sindresorhus" 795 | } 796 | }, 797 | "node_modules/lodash": { 798 | "version": "4.17.21", 799 | "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", 800 | "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" 801 | }, 802 | "node_modules/log-symbols": { 803 | "version": "4.1.0", 804 | "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", 805 | "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", 806 | "dev": true, 807 | "dependencies": { 808 | "chalk": "^4.1.0", 809 | "is-unicode-supported": "^0.1.0" 810 | }, 811 | "engines": { 812 | "node": ">=10" 813 | }, 814 | "funding": { 815 | "url": "https://github.com/sponsors/sindresorhus" 816 | } 817 | }, 818 | "node_modules/loupe": { 819 | "version": "2.3.7", 820 | "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz", 821 | "integrity": "sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==", 822 | "dev": true, 823 | "dependencies": { 824 | "get-func-name": "^2.0.1" 825 | } 826 | }, 827 | "node_modules/markdown-it": { 828 | "version": "14.1.0", 829 | "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-14.1.0.tgz", 830 | "integrity": "sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg==", 831 | "dev": true, 832 | "dependencies": { 833 | "argparse": "^2.0.1", 834 | "entities": "^4.4.0", 835 | "linkify-it": "^5.0.0", 836 | "mdurl": "^2.0.0", 837 | "punycode.js": "^2.3.1", 838 | "uc.micro": "^2.1.0" 839 | }, 840 | "bin": { 841 | "markdown-it": "bin/markdown-it.mjs" 842 | } 843 | }, 844 | "node_modules/markdown-it-anchor": { 845 | "version": "8.6.7", 846 | "resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-8.6.7.tgz", 847 | "integrity": "sha512-FlCHFwNnutLgVTflOYHPW2pPcl2AACqVzExlkGQNsi4CJgqOHN7YTgDd4LuhgN1BFO3TS0vLAruV1Td6dwWPJA==", 848 | "dev": true, 849 | "peerDependencies": { 850 | "@types/markdown-it": "*", 851 | "markdown-it": "*" 852 | } 853 | }, 854 | "node_modules/marked": { 855 | "version": "4.3.0", 856 | "resolved": "https://registry.npmjs.org/marked/-/marked-4.3.0.tgz", 857 | "integrity": "sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A==", 858 | "dev": true, 859 | "bin": { 860 | "marked": "bin/marked.js" 861 | }, 862 | "engines": { 863 | "node": ">= 12" 864 | } 865 | }, 866 | "node_modules/mdurl": { 867 | "version": "2.0.0", 868 | "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-2.0.0.tgz", 869 | "integrity": "sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w==", 870 | "dev": true 871 | }, 872 | "node_modules/minimatch": { 873 | "version": "5.1.6", 874 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", 875 | "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", 876 | "dev": true, 877 | "dependencies": { 878 | "brace-expansion": "^2.0.1" 879 | }, 880 | "engines": { 881 | "node": ">=10" 882 | } 883 | }, 884 | "node_modules/mkdirp": { 885 | "version": "1.0.4", 886 | "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", 887 | "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", 888 | "dev": true, 889 | "bin": { 890 | "mkdirp": "bin/cmd.js" 891 | }, 892 | "engines": { 893 | "node": ">=10" 894 | } 895 | }, 896 | "node_modules/mocha": { 897 | "version": "10.7.3", 898 | "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.7.3.tgz", 899 | "integrity": "sha512-uQWxAu44wwiACGqjbPYmjo7Lg8sFrS3dQe7PP2FQI+woptP4vZXSMcfMyFL/e1yFEeEpV4RtyTpZROOKmxis+A==", 900 | "dev": true, 901 | "dependencies": { 902 | "ansi-colors": "^4.1.3", 903 | "browser-stdout": "^1.3.1", 904 | "chokidar": "^3.5.3", 905 | "debug": "^4.3.5", 906 | "diff": "^5.2.0", 907 | "escape-string-regexp": "^4.0.0", 908 | "find-up": "^5.0.0", 909 | "glob": "^8.1.0", 910 | "he": "^1.2.0", 911 | "js-yaml": "^4.1.0", 912 | "log-symbols": "^4.1.0", 913 | "minimatch": "^5.1.6", 914 | "ms": "^2.1.3", 915 | "serialize-javascript": "^6.0.2", 916 | "strip-json-comments": "^3.1.1", 917 | "supports-color": "^8.1.1", 918 | "workerpool": "^6.5.1", 919 | "yargs": "^16.2.0", 920 | "yargs-parser": "^20.2.9", 921 | "yargs-unparser": "^2.0.0" 922 | }, 923 | "bin": { 924 | "_mocha": "bin/_mocha", 925 | "mocha": "bin/mocha.js" 926 | }, 927 | "engines": { 928 | "node": ">= 14.0.0" 929 | } 930 | }, 931 | "node_modules/ms": { 932 | "version": "2.1.3", 933 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", 934 | "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", 935 | "dev": true 936 | }, 937 | "node_modules/normalize-path": { 938 | "version": "3.0.0", 939 | "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", 940 | "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", 941 | "dev": true, 942 | "engines": { 943 | "node": ">=0.10.0" 944 | } 945 | }, 946 | "node_modules/once": { 947 | "version": "1.4.0", 948 | "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", 949 | "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", 950 | "dev": true, 951 | "dependencies": { 952 | "wrappy": "1" 953 | } 954 | }, 955 | "node_modules/p-limit": { 956 | "version": "3.1.0", 957 | "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", 958 | "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", 959 | "dev": true, 960 | "dependencies": { 961 | "yocto-queue": "^0.1.0" 962 | }, 963 | "engines": { 964 | "node": ">=10" 965 | }, 966 | "funding": { 967 | "url": "https://github.com/sponsors/sindresorhus" 968 | } 969 | }, 970 | "node_modules/p-locate": { 971 | "version": "5.0.0", 972 | "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", 973 | "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", 974 | "dev": true, 975 | "dependencies": { 976 | "p-limit": "^3.0.2" 977 | }, 978 | "engines": { 979 | "node": ">=10" 980 | }, 981 | "funding": { 982 | "url": "https://github.com/sponsors/sindresorhus" 983 | } 984 | }, 985 | "node_modules/path-exists": { 986 | "version": "4.0.0", 987 | "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", 988 | "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", 989 | "dev": true, 990 | "engines": { 991 | "node": ">=8" 992 | } 993 | }, 994 | "node_modules/pathval": { 995 | "version": "1.1.1", 996 | "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", 997 | "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", 998 | "dev": true, 999 | "engines": { 1000 | "node": "*" 1001 | } 1002 | }, 1003 | "node_modules/picomatch": { 1004 | "version": "2.3.1", 1005 | "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", 1006 | "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", 1007 | "dev": true, 1008 | "engines": { 1009 | "node": ">=8.6" 1010 | }, 1011 | "funding": { 1012 | "url": "https://github.com/sponsors/jonschlinkert" 1013 | } 1014 | }, 1015 | "node_modules/punycode.js": { 1016 | "version": "2.3.1", 1017 | "resolved": "https://registry.npmjs.org/punycode.js/-/punycode.js-2.3.1.tgz", 1018 | "integrity": "sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA==", 1019 | "dev": true, 1020 | "engines": { 1021 | "node": ">=6" 1022 | } 1023 | }, 1024 | "node_modules/randombytes": { 1025 | "version": "2.1.0", 1026 | "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", 1027 | "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", 1028 | "dev": true, 1029 | "dependencies": { 1030 | "safe-buffer": "^5.1.0" 1031 | } 1032 | }, 1033 | "node_modules/readdirp": { 1034 | "version": "3.6.0", 1035 | "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", 1036 | "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", 1037 | "dev": true, 1038 | "dependencies": { 1039 | "picomatch": "^2.2.1" 1040 | }, 1041 | "engines": { 1042 | "node": ">=8.10.0" 1043 | } 1044 | }, 1045 | "node_modules/require-directory": { 1046 | "version": "2.1.1", 1047 | "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", 1048 | "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", 1049 | "dev": true, 1050 | "engines": { 1051 | "node": ">=0.10.0" 1052 | } 1053 | }, 1054 | "node_modules/requizzle": { 1055 | "version": "0.2.4", 1056 | "resolved": "https://registry.npmjs.org/requizzle/-/requizzle-0.2.4.tgz", 1057 | "integrity": "sha512-JRrFk1D4OQ4SqovXOgdav+K8EAhSB/LJZqCz8tbX0KObcdeM15Ss59ozWMBWmmINMagCwmqn4ZNryUGpBsl6Jw==", 1058 | "dev": true, 1059 | "dependencies": { 1060 | "lodash": "^4.17.21" 1061 | } 1062 | }, 1063 | "node_modules/safe-buffer": { 1064 | "version": "5.2.1", 1065 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", 1066 | "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", 1067 | "dev": true, 1068 | "funding": [ 1069 | { 1070 | "type": "github", 1071 | "url": "https://github.com/sponsors/feross" 1072 | }, 1073 | { 1074 | "type": "patreon", 1075 | "url": "https://www.patreon.com/feross" 1076 | }, 1077 | { 1078 | "type": "consulting", 1079 | "url": "https://feross.org/support" 1080 | } 1081 | ] 1082 | }, 1083 | "node_modules/serialize-javascript": { 1084 | "version": "6.0.2", 1085 | "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", 1086 | "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", 1087 | "dev": true, 1088 | "dependencies": { 1089 | "randombytes": "^2.1.0" 1090 | } 1091 | }, 1092 | "node_modules/string-width": { 1093 | "version": "4.2.3", 1094 | "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", 1095 | "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", 1096 | "dev": true, 1097 | "dependencies": { 1098 | "emoji-regex": "^8.0.0", 1099 | "is-fullwidth-code-point": "^3.0.0", 1100 | "strip-ansi": "^6.0.1" 1101 | }, 1102 | "engines": { 1103 | "node": ">=8" 1104 | } 1105 | }, 1106 | "node_modules/strip-ansi": { 1107 | "version": "6.0.1", 1108 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", 1109 | "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", 1110 | "dev": true, 1111 | "dependencies": { 1112 | "ansi-regex": "^5.0.1" 1113 | }, 1114 | "engines": { 1115 | "node": ">=8" 1116 | } 1117 | }, 1118 | "node_modules/strip-json-comments": { 1119 | "version": "3.1.1", 1120 | "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", 1121 | "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", 1122 | "dev": true, 1123 | "engines": { 1124 | "node": ">=8" 1125 | }, 1126 | "funding": { 1127 | "url": "https://github.com/sponsors/sindresorhus" 1128 | } 1129 | }, 1130 | "node_modules/supports-color": { 1131 | "version": "8.1.1", 1132 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", 1133 | "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", 1134 | "dev": true, 1135 | "dependencies": { 1136 | "has-flag": "^4.0.0" 1137 | }, 1138 | "engines": { 1139 | "node": ">=10" 1140 | }, 1141 | "funding": { 1142 | "url": "https://github.com/chalk/supports-color?sponsor=1" 1143 | } 1144 | }, 1145 | "node_modules/to-fast-properties": { 1146 | "version": "2.0.0", 1147 | "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", 1148 | "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", 1149 | "dev": true, 1150 | "engines": { 1151 | "node": ">=4" 1152 | } 1153 | }, 1154 | "node_modules/to-regex-range": { 1155 | "version": "5.0.1", 1156 | "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", 1157 | "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", 1158 | "dev": true, 1159 | "dependencies": { 1160 | "is-number": "^7.0.0" 1161 | }, 1162 | "engines": { 1163 | "node": ">=8.0" 1164 | } 1165 | }, 1166 | "node_modules/type-detect": { 1167 | "version": "4.1.0", 1168 | "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.1.0.tgz", 1169 | "integrity": "sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw==", 1170 | "dev": true, 1171 | "engines": { 1172 | "node": ">=4" 1173 | } 1174 | }, 1175 | "node_modules/uc.micro": { 1176 | "version": "2.1.0", 1177 | "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-2.1.0.tgz", 1178 | "integrity": "sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==", 1179 | "dev": true 1180 | }, 1181 | "node_modules/underscore": { 1182 | "version": "1.13.7", 1183 | "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.7.tgz", 1184 | "integrity": "sha512-GMXzWtsc57XAtguZgaQViUOzs0KTkk8ojr3/xAxXLITqf/3EMwxC0inyETfDFjH/Krbhuep0HNbbjI9i/q3F3g==", 1185 | "dev": true 1186 | }, 1187 | "node_modules/undici-types": { 1188 | "version": "6.19.8", 1189 | "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", 1190 | "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", 1191 | "dev": true 1192 | }, 1193 | "node_modules/workerpool": { 1194 | "version": "6.5.1", 1195 | "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.5.1.tgz", 1196 | "integrity": "sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA==", 1197 | "dev": true 1198 | }, 1199 | "node_modules/wrap-ansi": { 1200 | "version": "7.0.0", 1201 | "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", 1202 | "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", 1203 | "dev": true, 1204 | "dependencies": { 1205 | "ansi-styles": "^4.0.0", 1206 | "string-width": "^4.1.0", 1207 | "strip-ansi": "^6.0.0" 1208 | }, 1209 | "engines": { 1210 | "node": ">=10" 1211 | }, 1212 | "funding": { 1213 | "url": "https://github.com/chalk/wrap-ansi?sponsor=1" 1214 | } 1215 | }, 1216 | "node_modules/wrappy": { 1217 | "version": "1.0.2", 1218 | "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", 1219 | "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", 1220 | "dev": true 1221 | }, 1222 | "node_modules/xmlcreate": { 1223 | "version": "2.0.4", 1224 | "resolved": "https://registry.npmjs.org/xmlcreate/-/xmlcreate-2.0.4.tgz", 1225 | "integrity": "sha512-nquOebG4sngPmGPICTS5EnxqhKbCmz5Ox5hsszI2T6U5qdrJizBc+0ilYSEjTSzU0yZcmvppztXe/5Al5fUwdg==", 1226 | "dev": true 1227 | }, 1228 | "node_modules/y18n": { 1229 | "version": "5.0.8", 1230 | "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", 1231 | "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", 1232 | "dev": true, 1233 | "engines": { 1234 | "node": ">=10" 1235 | } 1236 | }, 1237 | "node_modules/yargs": { 1238 | "version": "16.2.0", 1239 | "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", 1240 | "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", 1241 | "dev": true, 1242 | "dependencies": { 1243 | "cliui": "^7.0.2", 1244 | "escalade": "^3.1.1", 1245 | "get-caller-file": "^2.0.5", 1246 | "require-directory": "^2.1.1", 1247 | "string-width": "^4.2.0", 1248 | "y18n": "^5.0.5", 1249 | "yargs-parser": "^20.2.2" 1250 | }, 1251 | "engines": { 1252 | "node": ">=10" 1253 | } 1254 | }, 1255 | "node_modules/yargs-parser": { 1256 | "version": "20.2.9", 1257 | "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", 1258 | "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", 1259 | "dev": true, 1260 | "engines": { 1261 | "node": ">=10" 1262 | } 1263 | }, 1264 | "node_modules/yargs-unparser": { 1265 | "version": "2.0.0", 1266 | "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", 1267 | "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", 1268 | "dev": true, 1269 | "dependencies": { 1270 | "camelcase": "^6.0.0", 1271 | "decamelize": "^4.0.0", 1272 | "flat": "^5.0.2", 1273 | "is-plain-obj": "^2.1.0" 1274 | }, 1275 | "engines": { 1276 | "node": ">=10" 1277 | } 1278 | }, 1279 | "node_modules/yocto-queue": { 1280 | "version": "0.1.0", 1281 | "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", 1282 | "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", 1283 | "dev": true, 1284 | "engines": { 1285 | "node": ">=10" 1286 | }, 1287 | "funding": { 1288 | "url": "https://github.com/sponsors/sindresorhus" 1289 | } 1290 | } 1291 | } 1292 | } 1293 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "firewall-js", 3 | "version": "0.2.0", 4 | "description": "Safeguard your codebase with seamless access control based on directory structure.", 5 | "main": "firewall.js", 6 | "scripts": { 7 | "test": "mocha", 8 | "jsdoc": "jsdoc" 9 | }, 10 | "author": "Aycan Gulez", 11 | "homepage": "https://github.com/aycangulez/firewall-js", 12 | "license": "MIT", 13 | "dependencies": { 14 | "callsites": "^3.1.0", 15 | "fn-arg-validator": "^1.1.2", 16 | "lodash": "^4.17.21" 17 | }, 18 | "devDependencies": { 19 | "@types/chai": "^5.0.0", 20 | "@types/mocha": "^10.0.8", 21 | "@types/node": "^22.7.4", 22 | "chai": "^4.5.0", 23 | "jsdoc": "^4.0.3", 24 | "mocha": "^10.7.3" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /test/all.js: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | 3 | const chai = require('chai'); 4 | const should = chai.should(); 5 | const firewall = require('../firewall'); 6 | const { testService, UserService, extensibilityTest, square } = require('./service'); 7 | 8 | describe('should', function () { 9 | it('access to object property', function () { 10 | const fwService = firewall.allow(['test'], testService); 11 | fwService.prop1.should.equal('hello'); 12 | }); 13 | 14 | it('access to object property from file only', function () { 15 | const fwService = firewall.allow(['test/all.js'], testService); 16 | fwService.prop1.should.equal('hello'); 17 | }); 18 | 19 | it('access to nested object property', function () { 20 | const fwService = firewall.allow(['test'], testService); 21 | fwService.prop3.subProp1.should.equal('deep down'); 22 | }); 23 | 24 | it('set object property', function () { 25 | const fwService = firewall.allow(['test'], testService); 26 | fwService.prop2 = 'there'; 27 | fwService.prop2.should.equal('there'); 28 | }); 29 | 30 | it('define object property', function () { 31 | const fwService = firewall.allow(['test'], testService); 32 | Object.defineProperty(fwService, 'prop4', { 33 | value: 42, 34 | }); 35 | fwService.prop4.should.equal(42); 36 | delete fwService.prop4; 37 | }); 38 | 39 | it('get own property descriptor', function () { 40 | const fwService = firewall.allow(['test'], testService); 41 | Object?.getOwnPropertyDescriptor(fwService, 'prop1')?.value.should.equal('hello'); 42 | }); 43 | 44 | it('get prototype', function () { 45 | const fwService = firewall.allow(['test'], testService); 46 | (fwService instanceof Object).should.equal(true); 47 | }); 48 | 49 | it('set prototype', function () { 50 | const fwService = firewall.allow(['test'], testService); 51 | Object.setPrototypeOf(fwService, {}); 52 | (fwService instanceof Object).should.equal(true); 53 | }); 54 | 55 | it('delete object property', function () { 56 | const fwService = firewall.allow(['test'], testService); 57 | delete fwService.prop2; 58 | fwService.should.not.include({ prop2: 'world' }); 59 | fwService.prop2 = 'world'; 60 | }); 61 | 62 | it('access object method', function () { 63 | const fwService = firewall.allow(['test'], testService); 64 | fwService.increment(1).should.equal(2); 65 | }); 66 | 67 | it('access own keys', function () { 68 | const fwService = firewall.allow(['test'], testService); 69 | const keys = []; 70 | for (let k in fwService) { 71 | keys.push(k); 72 | } 73 | keys.should.include('prop1'); 74 | }); 75 | 76 | it('check the extensibility of object', function () { 77 | const fwService = firewall.allow(['test'], extensibilityTest); 78 | Object.isExtensible(fwService).should.equal(true); 79 | }); 80 | 81 | it('prevent the extensibility of object', function () { 82 | const fwService = firewall.allow(['test'], extensibilityTest); 83 | Object.preventExtensions(fwService); 84 | Object.isExtensible(fwService).should.equal(false); 85 | }); 86 | 87 | it('call a function', function () { 88 | var fwFunc = firewall.allow(['test'], square); 89 | fwFunc(5).should.equal(25); 90 | }); 91 | 92 | it('create a new object', function () { 93 | const fwService = firewall.allow(['test'], UserService); 94 | new fwService().create('Katniss', 'Everdeen').getFullName().should.equal('Katniss Everdeen'); 95 | }); 96 | }); 97 | 98 | describe('should not', function () { 99 | it('access to object property', function () { 100 | const fwService = firewall.allow(['some-dir'], testService); 101 | try { 102 | fwService.prop1; 103 | should.fail(); 104 | } catch (e) { 105 | e.message.should.include('Access denied for prop1'); 106 | } 107 | }); 108 | 109 | it('access to object property from file', function () { 110 | const fwService = firewall.allow(['test/all'], testService); 111 | try { 112 | fwService.prop1; 113 | should.fail(); 114 | } catch (e) { 115 | e.message.should.include('Access denied for prop1'); 116 | } 117 | }); 118 | 119 | it('access to nested object property', function () { 120 | const fwService = firewall.allow(['some-dir'], testService); 121 | try { 122 | fwService.prop3.subProp1; 123 | should.fail(); 124 | } catch (e) { 125 | e.message.should.include('Access denied for prop3'); 126 | } 127 | }); 128 | 129 | it('set object property', function () { 130 | const fwService = firewall.allow(['some-dir'], testService); 131 | try { 132 | fwService.prop2 = 'there'; 133 | should.fail(); 134 | } catch (e) { 135 | e.message.should.include('Access denied for prop2'); 136 | } 137 | }); 138 | 139 | it('define object property', function () { 140 | const fwService = firewall.allow(['some-dir'], testService); 141 | try { 142 | Object.defineProperty(fwService, 'prop4', { 143 | value: 42, 144 | }); 145 | should.fail(); 146 | } catch (e) { 147 | e.message.should.include('Access denied for prop4'); 148 | } 149 | }); 150 | 151 | it('get own property descriptor', function () { 152 | const fwService = firewall.allow(['some-dir'], testService); 153 | try { 154 | Object?.getOwnPropertyDescriptor(fwService, 'prop1')?.value; 155 | should.fail(); 156 | } catch (e) { 157 | e.message.should.include('Access denied for prop1'); 158 | } 159 | }); 160 | 161 | it('get prototype', function () { 162 | const fwService = firewall.allow(['some-dir'], testService); 163 | try { 164 | fwService instanceof Object; 165 | should.fail(); 166 | } catch (e) { 167 | e.message.should.include('Access denied for getting prototype'); 168 | } 169 | }); 170 | 171 | it('set prototype', function () { 172 | const fwService = firewall.allow(['some-dir'], testService); 173 | try { 174 | Object.setPrototypeOf(fwService, {}); 175 | should.fail(); 176 | } catch (e) { 177 | e.message.should.include('Access denied for setting prototype'); 178 | } 179 | }); 180 | 181 | it('delete object property', function () { 182 | const fwService = firewall.allow(['some-dir'], testService); 183 | try { 184 | delete fwService.prop2; 185 | should.fail(); 186 | } catch (e) { 187 | e.message.should.include('Access denied for deleting property'); 188 | } 189 | }); 190 | 191 | it('access object method', function () { 192 | const fwService = firewall.allow(['some-dir'], testService); 193 | try { 194 | fwService.increment(1); 195 | should.fail(); 196 | } catch (e) { 197 | e.message.should.include('Access denied for increment'); 198 | } 199 | }); 200 | 201 | it('access own keys', function () { 202 | const fwService = firewall.allow(['some-dir'], testService); 203 | try { 204 | for (let k in fwService) { 205 | } 206 | should.fail(); 207 | } catch (e) { 208 | e.message.should.include('Access denied for observing own keys'); 209 | } 210 | }); 211 | 212 | it('check the extensibility of object', function () { 213 | const fwService = firewall.allow(['some-dir'], testService); 214 | try { 215 | Object.isExtensible(fwService); 216 | should.fail(); 217 | } catch (e) { 218 | e.message.should.include('Access denied for checking extensibility'); 219 | } 220 | }); 221 | 222 | it('prevent the extensibility of object', function () { 223 | const fwService = firewall.allow(['some-dir'], extensibilityTest); 224 | try { 225 | Object.preventExtensions(fwService); 226 | should.fail(); 227 | } catch (e) { 228 | e.message.should.include('Access denied for preventing extensions'); 229 | } 230 | }); 231 | 232 | it('call a function', function () { 233 | const fwFunc = firewall.allow(['some-dir'], square); 234 | try { 235 | fwFunc(); 236 | should.fail(); 237 | } catch (e) { 238 | e.message.should.include('Access denied for calling function'); 239 | } 240 | }); 241 | 242 | it('create a new object', function () { 243 | const fwService = firewall.allow(['some-dir'], UserService); 244 | try { 245 | new fwService(); 246 | should.fail(); 247 | } catch (e) { 248 | e.message.should.include('Access denied for creating new object'); 249 | } 250 | }); 251 | }); 252 | -------------------------------------------------------------------------------- /test/service.js: -------------------------------------------------------------------------------- 1 | const testService = { 2 | prop1: 'hello', 3 | prop2: 'world', 4 | prop3: { subProp1: 'deep down' }, 5 | increment: (x) => x + 1, 6 | }; 7 | 8 | const UserService = function () { 9 | this.create = (firstName, lastName) => { 10 | let getFullName = () => firstName + ' ' + lastName; 11 | return { firstName, lastName, getFullName }; 12 | }; 13 | }; 14 | 15 | const extensibilityTest = {}; 16 | 17 | function square(x) { 18 | return x * x; 19 | } 20 | 21 | module.exports = { 22 | testService, 23 | UserService, 24 | extensibilityTest, 25 | square, 26 | }; 27 | --------------------------------------------------------------------------------